x402
HTTP 402 Payment Required with USDC settlement. The Coinbase-led standard for agent payments on-chain.
Signed payload
Overview
x402 revives the long-reserved 402 Payment Required HTTP status code.
When an agent hits a priced endpoint without a payment, the server
responds with a 402 carrying a payment challenge. The agent signs a
USDC transfer, replays the request with a Payment header, and receives
the response.
Custena speaks x402 out of the box — both as a seller (accepting settlements) and as a buyer (signing and retrying for your agent).
Flow
GET /tools/search?q=hello HTTP/1.1
Host: seller.example.comHTTP/1.1 402 Payment Required
X-Payment-Required: {"amount":"0.01","currency":"USDC","network":"base-sepolia","payto":"0xabc..."}Agent signs and retries:
GET /tools/search?q=hello HTTP/1.1
Host: seller.example.com
X-Payment: eyJ0eXAiOiJKV1Qi...HTTP/1.1 200 OK
Content-Type: application/json
{ "results": [...] }Settlement
- Network: Base mainnet (production) / Base Sepolia (test)
- Asset: USDC
- Facilitator: Custena's x402 facilitator verifies the signed transfer and releases the response. Sellers never need to run a node.
When to use it
- Agent already holds USDC in a managed or self-custodial wallet
- You want cryptographic proof of payment stamped into the request
- You need per-call settlement below card-fee viability