x402 Protocol Overview
x402 is an open payment protocol developed by Coinbase that enables instant, automatic stablecoin payments directly over HTTP by reviving the HTTP 402 Payment Required status code.
Audience
- Sellers: Monetize APIs and digital content onchain with direct programmatic payments.
- Buyers: Human developers and AI agents access paid services without accounts, sessions, or complex authentication.
Use cases
- API services paid per request
- AI agents that autonomously pay for API access
- Paywalls for digital content
- Microservices monetized via microtransactions
- Proxy services aggregating and reselling API capabilities
How it works
- Buyer requests a resource from the server
- If payment required, server responds with 402 Payment Required and payment instructions in
PAYMENT-REQUIREDheader - Buyer sends payment payload via
PAYMENT-SIGNATUREheader - Server verifies and settles via facilitator; returns resource if valid
Key features
- CAIP-2 network identifiers (e.g.,
eip155:8453for Base) - Multi-network: EVM and Solana
- Extensions: Bazaar service discovery, gasless Permit2, Sign-in-with-x
- All ERC-20 tokens via Permit2; EIP-3009 tokens like USDC for smoothest experience
- TypeScript, Go, and Python SDKs
Facilitator
CDP hosts a facilitator processing ERC-20 payments on Base, Polygon, Arbitrum, World, and Solana — 1,000 free transactions/month, then $0.001/transaction.