Developer Quickstart

From checkout
to first API call

Four steps: buy credits, register your agent, check your balance, make a payment. Copy-paste curl commands — works in under 60 seconds.

Authorization: Bearer <key>X-API-Key: <key>— both headers accepted

MCP server

Add AgentPay to Claude or Cursor

Use AgentPay natively from any MCP-compatible agent runtime. The server wraps the live API and exposes register_agent, check_balance, pay, and redeem.

/mcp
claude_desktop_config.json / .cursor/mcp.json
{
  "mcpServers": {
    "agentpay": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://agentpay.nanocorp.app/mcp"]
    }
  }
}

Direct remote endpoint: https://agentpay.nanocorp.app/mcp. If pay hits low balance, the tool returns the raw 402 body with topup_url for the operator.

1

Buy the $10 Agent Credits Pack

One-time purchase — 1,000 prepaid transaction credits, no subscription. Credits never expire.

Buy $10 Agent Credits Pack1,000 credits

Secure checkout via Stripe · Instant delivery · No account required

2

Register your agent — get an API key

No auth required. Provide the same email you used at checkout so your credits are automatically matched when they arrive. You get 25 free trial credits instantly.

terminal
curl -X POST https://agentpay.nanocorp.app/api/register-agent \
  -H "Content-Type: application/json" \
  -d '{"agent_name": "my-agent", "email": "agent@example.com"}'
response.json
{
  "api_key": "ap_live_aBcDeFgHiJkLmNoPqRsTuVwXyZ01",
  "balance": 25,
  "credits_included": 25,
  "topup_url": "https://checkout.nanocorp.so/c/QfsWt42Pnik0EmvWOyvr"
}
Save your api_key. It is shown only once. Use it in the Authorization: Bearer header for all subsequent requests.
3

Check your balance

Verify your agent wallet is active and credits are credited. Works without auth (demo mode) or with your key (live mode — shows real balance).

terminal
curl https://agentpay.nanocorp.app/api/demo/balance \
  -H "Authorization: Bearer ap_live_aBcDeFgHiJkLmNoPqRsTuVwXyZ01"
response.json
{
  "status": "success",
  "mode": "live",
  "agent_name": "my-agent",
  "balance": 25.0,
  "credits_included": 25,
  "topup_url": "https://checkout.nanocorp.so/c/QfsWt42Pnik0EmvWOyvr"
}
Without an Authorization header this returns a "mode": "demo"response with a simulated balance — useful for testing pipelines without spending real credits.
4

Make a payment

Send credits from your agent to any recipient agent. The tofield is the recipient’s agent name or identifier.

terminal
curl -X POST https://agentpay.nanocorp.app/api/pay \
  -H "Authorization: Bearer ap_live_aBcDeFgHiJkLmNoPqRsTuVwXyZ01" \
  -H "Content-Type: application/json" \
  -d '{"amount": 1.00, "to": "vendor-agent"}'
response.json
{
  "status": "success",
  "mode": "live",
  "tx_id": "live-a1b2c3d4",
  "balance_after": 24.0,
  "topup_url": "https://checkout.nanocorp.so/c/QfsWt42Pnik0EmvWOyvr"
}
Returns 402 insufficient_balance when your wallet is empty — the response includes a topup_url to send to your operator for a refill.
5

Receive credits after a top-up

After your operator completes checkout with the registered email, call POST /api/redeem to apply the credits to your wallet. Idempotent — safe to call multiple times.

terminal
curl -X POST https://agentpay.nanocorp.app/api/redeem \
  -H "Authorization: Bearer ap_live_aBcDeFgHiJkLmNoPqRsTuVwXyZ01"
response.json
{
  "status": "success",
  "credits_added": 1000,
  "balance_after": 1000,
  "checkout_session_id": "cs_live_abc123"
}

Authentication reference

HeaderFormatRequired on
AuthorizationBearer ap_live_…/api/pay, /api/redeem, live balance
X-API-Keyap_live_…Alternative to Authorization
POST/api/register-agent

No auth — returns key

GET/api/demo/balance

Auth optional

POST/api/demo

Auth optional (sandbox)

POST/api/pay

Auth required

POST/api/redeem

Auth required

Ready to integrate?

Buy the credits pack, register your agent, and you’re live in under a minute.

Buy $10 Agent Credits Pack

Machine-readable descriptor at /.well-known/agent.json