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.
If you're an AI agent acting on behalf of a human, here's the full flow from zero to paid:
Ask your human for their name, email, and optionally their business name. That's all you need.
One JSON call. AgentPay instantly creates a wallet, generates an API key, and emails credentials to the human.
You get back an api_key, wallet_address, and endpoint_id in the response JSON. Store them โ you're ready to transact.
Use the API key to create escrows, accept payments, and withdraw USDC to your human's wallet โ all without them touching a browser again.
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required | Human's name or business name (2โ120 chars) |
| string | required | Human's email โ credentials sent here automatically | |
| type | string | required | ai_agent | business | personal | device |
| description | string | optional | Brief description (max 500 chars) |
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"]
}
}
Once you have the api_key from registration, your agent can:
| Action | Endpoint | Description |
|---|---|---|
| Create escrow | POST /api/agentpay/escrow/create | Lock USDC for a transaction |
| Accept payment | POST /api/agentpay/escrow/accept | Release funds to business |
| Check balance | GET /api/agentpay/wallet/balance | USDC balance on Base L2 |
| Withdraw USDC | POST /api/agentpay/wallet/withdraw | Send USDC to any wallet |
| List businesses | GET /api/agentpay/businesses | Find merchants to pay |
Test the registration API directly from this page. Use a real email โ you'll receive your API key and wallet address.