Partner Hub

Top up AI credits from your platform in 10 minutes

One REST API, one MCP server, four webhook events, and a standardized envelope. Test with staging keys, ship with live keys.

1. Get keys

Sign in, then visit Agent API and mint a key. Choose the environment:

  • ak_staging_… — test calls, no real credits.
  • ak_live_… — real top-ups, debited from your wallet.

2. Endpoints

MethodPathPurpose
POST/api/public/v1/topup/sendSend a top-up
POST/api/public/v1/topup/cancelCancel a pending top-up
GET/api/public/v1/topup/status/:transaction_idLook up a transaction
GET/api/public/v1/topup/balanceWallet + key cap snapshot
GET/api/public/v1/topup/historyRecent transactions (50)
POST/api/public/v1/topup/validateDry-run a payload
POST/api/public/v1/webhooks/registerRegister a webhook URL
DELETE/api/public/v1/webhooks/:idDelete a webhook

3. Standard response envelope

{
  "success": true,
  "code": 1001,
  "transaction_id": "txn_abc123",
  "status": "delivered",
  "timestamp": "2026-01-01T00:00:00Z",
  "data": {
    "voucher_code": "ATU-7Q3X-...",
    "platform": "claude",
    "amount_cents": 1000,
    "new_balance_cents": 5400
  }
}

4. Error & status codes

1000Success
1001Top-up delivered
1002Top-up pending
2001Invalid API key
2002Insufficient balance
2003Invalid platform
2004Invalid recipient email
2005Amount out of range
2006Duplicate transaction
3001Cancelled successfully
3002Cannot cancel — already delivered
3003Transaction not found
4001Rate limit exceeded
4002IP not whitelisted
5001Webhook delivery failed
5002Webhook URL invalid

5. Webhooks

Register a URL via the API or from Webhooks settings. You'll receive these events:

  • topup.delivered — credit sent
  • topup.failed — delivery failed
  • topup.cancelled — top-up cancelled
  • balance.low — wallet below threshold

Each request is signed with X-AiTopUp-Signature: t=<unix>,v1=<hex>. Verify with HMAC-SHA256 using your whsec_… secret. Retried up to 3× with exponential backoff (0s, 5s, 30s).

6. Quick start

curl -X POST https://aitopup.app/api/public/v1/topup/send \
  -H "Authorization: Bearer ak_staging_..." \
  -H "Content-Type: application/json" \
  -d '{"platform":"claude","amount_cents":1000}'

7. MCP server

Connect any MCP-aware agent (Claude Desktop, custom clients) to the same API. The endpoint speaks the MCP Streamable HTTP transport and exposes four tools: send_topup, check_balance, get_status, cancel_topup.

Streamable HTTP (recommended)

{
  "mcpServers": {
    "aitopup": {
      "url": "https://aitopup.app/api/public/mcp",
      "transport": "http",
      "headers": { "Authorization": "Bearer ak_staging_..." }
    }
  }
}

Legacy SSE (Claude Desktop, n8n MCP node)

{
  "mcpServers": {
    "aitopup": {
      "url": "https://mcp.aitopup.com/sse",
      "transport": "sse",
      "headers": { "Authorization": "Bearer ak_staging_..." }
    }
  }
}

mcp.aitopup.com/sse requires a CNAME from mcp → your app origin plus an edge rewrite from /sse/api/public/mcp/sse. Until DNS is live, point clients at https://aitopup.app/api/public/mcp/sse — same server, same tools. Auth is per-Bearer-token so each agent carries its own scoped key.

8. Reseller pricing

Buy wholesale, sell at list. Your discount tier is set on each key and applied to every top-up — the difference between list and cost is your margin, tracked per key.

TierWholesale discount$10 list = you payRequirement
Standard0%$10.00Default. Pay list price.
Silver10%$9.00$500+ / mo in top-ups
Gold17%$8.30$2,500+ / mo in top-ups
Platinum25%$7.50$10,000+ / mo or contract