x402 — HTTP 402 reborn
x402 is the open standard for pay-per-call HTTP APIs. Server returns402 Payment Required with USDC settlement details, client signs once (EIP-3009 TransferWithAuthorization), retries withX-Payment header, gets the result. No accounts. No card numbers. Just signatures.
⚡ WHY X402
Built for AI agents calling APIs
No accounts
Wallet signature only. No emails, no Stripe, no API keys to leak.
Agent-native
Built for autonomous agents to pay each other without human approval per call.
Sub-second
Signature → settlement → result in one round-trip. No invoices, no Net-30.
Micropayments
Pay $0.05 per call. Pricing that wouldn't survive Stripe fees works here.
Open standard
Any client, any server, any chain. Coinbase ships the reference impl.
USDC on Base
Blue Agent uses Coinbase's CDP x402 facilitator on Base mainnet, chain 8453.
📡 THE FLOW
3 requests, 1 signature
Request without payment
POST /api/x402/honeypot-check
{ "token": "0x..." }Server returns 402 with USDC details
HTTP/1.1 402 Payment Required
{ "accepts": [{
"scheme": "exact",
"network": "eip155:8453",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"payTo": "0xb058...3b5f",
"maxAmountRequired": "50000"
}] }Client signs EIP-3009 TransferWithAuthorization
wallet.signTypedData({
domain: { name: "USD Coin", verifyingContract: USDC, chainId: 8453 },
types: { TransferWithAuthorization: [...] },
message: { from, to: payTo, value: 50000, ... }
})Retry with X-Payment header → result
POST /api/x402/honeypot-check
X-Payment: base64({ signature, authorization })
→ 200 OK
{ "honeypot": false, "confidence": 0.94, ... }📚 REFERENCES