Quick Start

Get from zero to first payment in 3 API calls. No SDK required — just curl (or any HTTP client).

Step 1: Register your platform

POST/v1/auth/register
curl -X POST https://clawdpay.me/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-platform",
    "contact_email": "dev@example.com"
  }'

# Response:
{
  "platform_id": "550e8400-...",
  "name": "my-platform",
  "api_key": "agx_pk_aBcDeFgH...",  // Save this!
  "message": "Platform registered..."
}

Step 2: Create an agent

POST/v1/agents
curl -X POST https://clawdpay.me/v1/agents \
  -H "Authorization: Bearer agx_pk_aBcDeFgH..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "research-bot",
    "monthly_limit": 1000
  }'

# Response:
{
  "agent_id": "770e8400-...",
  "api_key": "agx_sk_xYzAbC...",  // Agent's key
  "wallet_balance": 100  // Signup bonus!
}

Step 3: Make a payment

POST/v1/pay
curl -X POST https://clawdpay.me/v1/pay \
  -H "Authorization: Bearer agx_sk_xYzAbC..." \
  -H "Content-Type: application/json" \
  -d '{
    "to": "weather-api",
    "amount": 5,
    "memo": "Beijing weather"
  }'

# Response:
{
  "payment_id": "pay_abc123",
  "status": "completed",
  "amount": 5,
  "balance_after": 95,
  "currency": "AGX"
}

That's it. Three calls, zero certificates, zero signatures, zero human intervention.

Authentication

ClawdPay uses Bearer token authentication. There are two key types:

Key TypePrefixWho Uses ItPermissions
Platform Keyagx_pk_Platform backendCreate/manage agents, create products
Agent Keyagx_sk_AI AgentPay, check balance, view transactions

Include the key in every request:

Header
Authorization: Bearer agx_sk_your_key_here

Register Platform

POST /v1/auth/register

Register a new platform to start creating agents. No authentication required.

FieldTypeRequiredDescription
namestringYesUnique slug (2-100 chars)
display_namestringNoHuman-readable name
contact_emailstringYesEmail for notifications
websitestringNoPlatform URL
descriptionstringNoWhat your platform does

Create Agent

POST /v1/agents

Create a new agent under your platform. Requires agx_pk_ key.

FieldTypeRequiredDescription
namestringYesAgent name (unique per platform)
display_namestringNoFriendly name
external_idstringNoYour platform's agent ID
monthly_limitintNoMax credits/month (0 = unlimited)

Each new agent receives 100 AGX bonus credits.

Wallet

GET /v1/wallet

Check the agent's wallet balance. Requires agx_sk_ key.

Response
{
  "balance": 950,
  "frozen": 0,
  "available": 950,
  "total_earned": 200,
  "total_spent": 350,
  "total_topup": 1100,
  "currency": "AGX"
}

POST /v1/wallet/topup

Add credits to the wallet. Requires agx_sk_ key.

FieldTypeRequiredDescription
amountintYesCredits to add (> 0)
memostringNoNote for the record

Make Payment

POST /v1/pay

The core API. Pay another agent, buy a product, or tip a creator. Requires agx_sk_ key.

FieldTypeRequiredDescription
tostringYesRecipient: agent UUID, agent name, or product slug
amountintYesCredits to pay (> 0)
product_idstringNoProduct slug (for product purchase)
memostringNoPayment description
idempotency_keystringNoPrevent duplicate charges

GET /v1/pay/{payment_id}

Retrieve details for a specific payment.

Products

POST /v1/products

Create a priced product (tool, API, content). Requires agx_pk_ key.

FieldTypeRequiredDescription
slugstringYesURL-safe ID: weather-api-call
namestringYesHuman-readable name
priceintYesCredits per unit (0 = free)
pricing_modelstringNoper_call | subscription | one_time
provider_agent_idstringNoAgent that receives payment

GET /v1/products

List all active products. No authentication required.

GET /v1/products/{slug}

Get product details by slug.

Transactions

GET /v1/transactions

List the agent's transaction history. Requires agx_sk_ key.

ParamTypeDescription
tx_typestringFilter: pay / topup / refund / earn
limitint1-100, default 20
offsetintPagination offset

Error Codes

All errors return a JSON body with error (human-readable) and code (machine-readable).

HTTPCodeMeaning
401auth_requiredMissing or invalid API key
401invalid_keyAPI key not found in database
402insufficient_balanceWallet balance too low
403monthly_limit_exceededMonthly spending limit reached
404recipient_not_foundCannot resolve the to field
409duplicateName/slug already exists
422no_walletAgent has no wallet (system error)

Idempotency

Pass idempotency_key in the payment body. If a payment with the same key already exists, the original result is returned without charging again. Keys are unique globally.

Safe retry
# First call — creates payment
POST /v1/pay { "to": "api", "amount": 5, "idempotency_key": "req-001" }
→ { "status": "completed", "balance_after": 95 }

# Retry (network glitch) — returns same result, no double charge
POST /v1/pay { "to": "api", "amount": 5, "idempotency_key": "req-001" }
→ { "status": "completed", "balance_after": 95 }  // Same!

Rate Limits

Default limits (will increase as the platform scales):

ScopeLimit
Per agent key100 requests/minute
Per platform key300 requests/minute
Payment endpoint60 payments/minute per agent