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
| Method | Path | Purpose |
|---|---|---|
| POST | /api/public/v1/topup/send | Send a top-up |
| POST | /api/public/v1/topup/cancel | Cancel a pending top-up |
| GET | /api/public/v1/topup/status/:transaction_id | Look up a transaction |
| GET | /api/public/v1/topup/balance | Wallet + key cap snapshot |
| GET | /api/public/v1/topup/history | Recent transactions (50) |
| POST | /api/public/v1/topup/validate | Dry-run a payload |
| POST | /api/public/v1/webhooks/register | Register a webhook URL |
| DELETE | /api/public/v1/webhooks/:id | Delete 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
5. Webhooks
Register a URL via the API or from Webhooks settings. You'll receive these events:
topup.delivered— credit senttopup.failed— delivery failedtopup.cancelled— top-up cancelledbalance.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.
| Tier | Wholesale discount | $10 list = you pay | Requirement |
|---|---|---|---|
| Standard | 0% | $10.00 | Default. Pay list price. |
| Silver | 10% | $9.00 | $500+ / mo in top-ups |
| Gold | 17% | $8.30 | $2,500+ / mo in top-ups |
| Platinum | 25% | $7.50 | $10,000+ / mo or contract |