๐Ÿค– Built for AI Agents

Register Your Human
in One API Call

No browser. No OAuth. No friction. An AI agent can sign up a human for AgentPay services in under 2 seconds โ€” then immediately start accepting payments on their behalf.

๐Ÿ”„ How Agent Auto-Registration Works

If you're an AI agent acting on behalf of a human, here's the full flow from zero to paid:

1

Collect human's info

Ask your human for their name, email, and optionally their business name. That's all you need.

2

POST to /api/agentpay/register

One JSON call. AgentPay instantly creates a wallet, generates an API key, and emails credentials to the human.

3

Receive API key + wallet in the response

You get back an api_key, wallet_address, and endpoint_id in the response JSON. Store them โ€” you're ready to transact.

4

Start creating escrows immediately

Use the API key to create escrows, accept payments, and withdraw USDC to your human's wallet โ€” all without them touching a browser again.

๐Ÿ“ก Registration Endpoint

POST https://x402-agent-pay.com/api/agentpay/register
Request Body (JSON)
FieldTypeRequiredDescription
namestringrequiredHuman's name or business name (2โ€“120 chars)
emailstringrequiredHuman's email โ€” credentials sent here automatically
typestringrequiredai_agent | business | personal | device
descriptionstringoptionalBrief description (max 500 chars)

Response (201 Created)
{
  "success": true,
  "endpoint_id": "ep_abc123...",
  "api_key": "apk_xxxxxxxxxxxxxxxxxxxx",
  "wallet_address": "0xABCD...1234",
  "wallet_mode": "custodial",
  "network": "Base L2",
  "asset": "USDC",
  "message": "Credentials emailed. Save your API key."
}

๐Ÿ’ป Code Examples

import requests

def register_human(name, email, account_type="personal"):
    res = requests.post(
        "https://x402-agent-pay.com/api/agentpay/register",
        json={"name": name, "email": email, "type": account_type}
    )
    data = res.json()
    if res.status_code == 201:
        print(f"โœ… Registered! API Key: {data['api_key']}")
        print(f"   Wallet: {data['wallet_address']}")
        return data
    else:
        raise Exception(f"Registration failed: {data.get('error')}")

# Agent calls this when human says "sign me up"
result = register_human("Alice Smith", "alice@example.com", "business")
async function registerHuman(name, email, type = "personal") {
  const res = await fetch("https://x402-agent-pay.com/api/agentpay/register", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ name, email, type })
  });
  const data = await res.json();
  if (res.status === 201) {
    console.log(`โœ… Registered! API Key: ${data.api_key}`);
    console.log(`   Wallet: ${data.wallet_address}`);
    return data;
  }
  throw new Error(`Registration failed: ${data.error}`);
}

// Agent calls this when human says "sign me up"
const result = await registerHuman("Alice Smith", "alice@example.com", "business");
curl -X POST https://x402-agent-pay.com/api/agentpay/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Alice Smith",
    "email": "alice@example.com",
    "type": "business",
    "description": "Registered by AI agent on behalf of user"
  }'
# OpenAI function-calling tool definition
{
  "name": "register_agentpay",
  "description": "Register a human user on AgentPay to enable USDC payments. Call this when the user asks to sign up, get paid, or accept payments. Returns an API key and wallet address.",
  "parameters": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "The user's full name or business name"
      },
      "email": {
        "type": "string",
        "description": "The user's email address โ€” credentials will be sent here"
      },
      "type": {
        "type": "string",
        "enum": ["personal", "business", "ai_agent", "device"],
        "description": "Account type"
      }
    },
    "required": ["name", "email", "type"]
  }
}

โšก What You Can Do After Registration

Once you have the api_key from registration, your agent can:

ActionEndpointDescription
Create escrowPOST /api/agentpay/escrow/createLock USDC for a transaction
Accept paymentPOST /api/agentpay/escrow/acceptRelease funds to business
Check balanceGET /api/agentpay/wallet/balanceUSDC balance on Base L2
Withdraw USDCPOST /api/agentpay/wallet/withdrawSend USDC to any wallet
List businessesGET /api/agentpay/businessesFind merchants to pay

๐Ÿงช Try It Live โ€” Register a Test Account

Test the registration API directly from this page. Use a real email โ€” you'll receive your API key and wallet address.