RaaS — Referral-as-a-Service API for x402 Payments on Base

🔗

Referral-as-a-Service: short-link referrals that turn verified x402 payments on Base into service credits. Provision a project with one paid x402 call — POST https://x402.freeq.one/tools/raas_project_provision at $0.05 in USDC on Base, one-time — and it returns a project_id and an API key. Mint links at freeq.one/{code} that route traffic to any x402-gateway tool: link creation and stats are free with that key, and referrers are credited automatically when referred settlements verify on-chain. Credit-only — rewards are redeemable for API access, never USDC payouts.

How it works

RaaS rides on x402-gateway, where every tool settles per-call in USDC on Base. RaaS turns those payments into a referral channel:

1. Provision a project — $0.05, one-time. POST https://x402.freeq.one/tools/raas_project_provision over x402 (USDC on Base, Coinbase CDP settlement) returns a project_id and an apiKey (shown once, stored hashed server-side).

2. Mint referral links — free with the API key. POST https://api.freeq.one/v1/raas/link with the x-api-key header mints freeq.one/{code} short links pointing at any gateway tool, tagged to your referrer wallet.

3. Credits settle — verified on-chain. When a visitor pays for a gateway tool via the x402 protocol and the settlement verifies on Base, the referrer earns credits. GET /v1/raas/stats, free with the same key, reports clicks and credits per code or project-wide.

Example call

# 1. Provision a project — paid, one-time $0.05. An unpaid POST returns
#    402 Payment Required with the USDC amount on Base; sign it and retry:
curl -X POST https://x402.freeq.one/tools/raas_project_provision \
  -H "Content-Type: application/json" -d '{"name": "my-store"}'
# -> {"data": {"projectId": "...", "apiKey": "raas_...", "referralRate": 0.2, ...}}

# 2. Mint a referral link — free, x-api-key from step 1:
curl -X POST https://api.freeq.one/v1/raas/link \
  -H "Content-Type: application/json" -H "x-api-key: raas_..." \
  -d '{"referrerWallet": "0x1a2b...9f0e"}'
# -> {"refCode": "XSEUCT", "shortLink": "https://freeq.one/XSEUCT", ...}

# 3. Stats — free, same key:
curl https://api.freeq.one/v1/raas/stats -H "x-api-key: raas_..."

Read the full RaaS docs, run the interactive flow at x402.freeq.one/try.html?tool=raas, or browse every pay-per-call API on the all APIs page.