DEV Community

nanoempireai
nanoempireai

Posted on

Why I Built a 10% Referral Program for AI Agent APIs (And How You Can Copy It)

Why I Built a 10% Referral Program for AI Agent APIs (And How You Can Copy It)

Last week I launched a referral program for my x402 payment gateway. Here's why, how it works, and the code you can steal.

The Problem: Distribution Without Cold Outreach

I don't do cold emails. I don't DM. I don't pay for ads.

But I need developers to integrate my x402 payment gateway so their APIs become agent-discoverable and agent-payable.

The solution: Make my users my sales team.

The Referral Program Design

10% revenue share for 12 months.

If you refer an API that integrates my x402 gateway, you earn 10% of ALL revenue that API generates for 12 months.

Event Revenue Your Commission (10%)
Parser API call $0.05/call $0.005/call
Audit purchase $499 $49.90
Certification $199 $19.90

After 12 months, the referral expires automatically. No awkward conversations.

Why 10% for 12 Months?

  • High enough to matter: $49.90 per audit referral adds up fast
  • Time-bound: Creates urgency, prevents lifetime obligations
  • Self-liquidating: The referred API pays for its own referral
  • No cap: One referral doing $1K/month = $100/month for you

The Code (Steal This)

I built it as a standalone Python module. SQLite, zero external deps.

from referral_program import ReferralProgram

program = ReferralProgram()

# Register yourself as a referrer
result = program.register_referrer("your_client_id", "you@company.com")
# Returns: referral_code, referral_link, commission_rate

# When someone signs up via your link
program.process_referral("NANO_ABC123DEF", "new_client_id")

# When they generate revenue (called automatically)
program.record_revenue("referred_client_id", 499, "audit_purchase")
# You get $49.90 credited automatically
Enter fullscreen mode Exit fullscreen mode

The full module handles:

  • Unique referral codes (NANO_XXXXXXXX)
  • 12-month expiry with auto-cleanup
  • Commission tracking per event type
  • Referrer dashboard with earnings
  • Public referrer info for landing pages

Why This Works for Agent APIs

  1. Agent developers are networked — they talk to each other
  2. High trust — they only recommend tools they use
  3. High value — one audit referral = $49.90, one parser integration = recurring
  4. Zero friction — referral link auto-applies, no coupon codes

The Economics

If 10 developers each refer 2 APIs that do $500/month:

  • 20 APIs × $500 = $10,000/month revenue
  • 10% = $1,000/month to referrers
  • My cost: $1,000/month for $10,000/month revenue = 10% CAC
  • Payback: immediate (first payment covers referral cost)

The Code Is Open

Full module at: github.com/roblambert9/nano-empire-tollbooth/referral_program.py

Includes:

  • SQLite persistence (zero config)
  • 12-month auto-expiry
  • Commission events audit trail
  • Referrer dashboard API
  • Public referrer info for landing pages

Try It

My referral code: NANO_AGENT2024

If you integrate x402 via my link, I earn 10% of your revenue for a year. You get agent-native payments. Win-win.


Referral program code: github.com/roblambert9/nano-empire-tollbooth/referral_program.py
Live proof chain: https://api.nanoempireai.com/proof/summary
SDK: pip install nano-empire-tollbooth

Top comments (0)