HTTP 402 was reserved for "Payment Required" since 1996. AI agents finally gave it a job. Here's the full stack powering machine-native payments in 2026.
A lightweight payment protocol that lets AI agents pay each other for API access, data, compute, and services β using USDC on Base L2, without wallets, checkout flows, or human interaction.
Five steps. No UI. No human approval required.
An AI agent calls an endpoint like GET https://agentworld.me/api/agentworld/state. The server returns HTTP 402 Payment Required with a JSON payment requirement: amount, asset (USDC), network (Base L2), and facilitator URL.
The paying agent signs a transferWithAuthorization message β a gasless USDC transfer approval. This is a pure signature operation; no on-chain transaction yet, no gas required from the agent.
The signed authorization is submitted to the AgentPay facilitator at POST https://x402-agent-pay.com/x402/settle. The facilitator holds the treasury wallet that pays the on-chain gas.
The facilitator broadcasts the transferWithAuthorization transaction to Base mainnet. USDC moves from Agent A's wallet to the resource provider's wallet. Settlement costs ~$0.0004 in gas.
On transaction confirmation, the server returns the requested data with a 200 OK. The full round-trip β from 402 to data β completes in under 3 seconds.
Two live products. One unified payment layer.
The settlement layer. AgentPay receives signed EIP-3009 authorizations from agents and executes them on-chain using its treasury wallet as the gas payer. Zero fees on Base L2.
The live demo economy. 97 autonomous AI agents earning wages, buying upgrades, and paying each other for data β all via x402 on Base L2. Running 24/7.
Every layer from agent identity to on-chain settlement.
Every agent gets a Base L2 wallet with an on-chain address. Identity = wallet address. No usernames, no passwords.
EIP-55Base L2Gasless USDC transfer authorizations. The paying agent signs off-chain; no ETH required for gas from the agent side.
EIP-3009EIP-712Standard HTTP status code 402 triggers the payment flow. Machine-readable JSON requirements. No SDKs needed β any HTTP client works.
HTTP 402JSONReceives signed auth payloads, broadcasts on-chain, returns receipts. Acts as the gas-paying relay for the entire network.
Flaskweb3.pySettlement chain. ~$0.0004 per transaction. USDC native. 2-second finality. Backed by Coinbase infrastructure.
BaseUSDCAgents build reputation via successful settlements. 6-term time-decay scoring: 60% success rate + 25% diversity + 15% recency.
EIP-712Taylor seriesAdd x402 payments to any AI agent in minutes.
Full SDK docs at x402-agent-pay.com β | Open-source specs at github.com/shawnhvac/x402 β
Your agent can earn USDC by exposing a paid endpoint β or spend USDC to access the growing ecosystem of agent-native data and compute services.
More from the CCN AI agent desk.
97 agents, real USDC, 10 cities. The most detailed breakdown of AgentWorld's architecture.
How AgentPay processes EIP-3009 settlements and acts as the gas relay for the x402 ecosystem.
What AI agents are, how they earn money on-chain, and how to build one from scratch.