{
  "name": "AgentPay",
  "description": "x402 payment infrastructure for AI agents. Register humans, create escrows, accept and send USDC atomically on Base L2.",
  "version": "1.0",
  "base_url": "https://x402-agent-pay.com",
  "agent_signup_page": "https://x402-agent-pay.com/agent-signup",
  "auth": {
    "type": "api_key",
    "header": "X-API-Key",
    "obtain_at": "POST /api/agentpay/register"
  },
  "actions": [
    {
      "id": "register_human",
      "name": "Register a human user",
      "description": "One API call to create an account, wallet, and API key for a human. Credentials are emailed automatically. No browser required.",
      "method": "POST",
      "endpoint": "/api/agentpay/register",
      "auth_required": false,
      "body": {
        "name": "string (required) — human's name or business name",
        "email": "string (required) — credentials sent here",
        "type": "string (required) — one of: ai_agent, business, personal, device",
        "description": "string (optional)"
      },
      "returns": {
        "endpoint_id": "unique account ID",
        "api_key": "API key — save this, shown once",
        "wallet_address": "Base L2 USDC wallet address",
        "wallet_mode": "custodial",
        "network": "Base L2"
      }
    },
    {
      "id": "create_escrow",
      "name": "Create a payment escrow",
      "description": "Lock USDC in escrow for a transaction. Business gets notified and can accept or deny.",
      "method": "POST",
      "endpoint": "/api/agentpay/escrow/create",
      "auth_required": true,
      "body": {
        "amount_usdc": "number — amount to lock",
        "business_id": "string — target business endpoint_id",
        "description": "string — what the payment is for"
      }
    },
    {
      "id": "check_balance",
      "name": "Check USDC wallet balance",
      "method": "GET",
      "endpoint": "/api/agentpay/wallet/balance",
      "auth_required": true
    },
    {
      "id": "withdraw_usdc",
      "name": "Withdraw USDC to external wallet",
      "method": "POST",
      "endpoint": "/api/agentpay/wallet/withdraw",
      "auth_required": true,
      "body": {
        "amount_usdc": "number",
        "to_address": "string — destination wallet on Base L2"
      }
    },
    {
      "id": "list_businesses",
      "name": "List registered businesses",
      "description": "Find merchants your human can pay via escrow.",
      "method": "GET",
      "endpoint": "/api/agentpay/businesses",
      "auth_required": false
    }
  ],
  "example_agent_script": "https://x402-agent-pay.com/agent-signup#code-openai",
  "openapi": "https://x402-agent-pay.com/openapi.json"
}
