x402 is an open payment protocol that lets a web server charge for a resource inside an ordinary web request, using the long-reserved HTTP status code 402 Payment Required. When a client asks for a paid page, file or API call, the server replies with the price and payment details, the client attaches a signed payment and retries, and the server returns the content once payment is confirmed. Payments are normally made in stablecoins such as USDC on public blockchains.
The protocol was published by the developer platform of Coinbase in 2025 as an open specification with reference code. It is aimed at machine-to-machine and pay-per-use payments, particularly purchases made by AI agents, where account sign-ups, stored cards and monthly subscriptions fit poorly. It is one of several efforts in agentic payments, alongside card-network and wallet initiatives.
Background: the unused 402 code
The Hypertext Transfer Protocol has included status code 402 since its early specifications, marked as reserved for future use in digital payments. For decades no common payment method suited it: card payments need checkout pages, stored credentials and several days to settle, and their fixed fees make very small charges uneconomic. Most paid web services therefore rely on accounts, API keys and prepaid or monthly billing. x402 gives the code a concrete meaning by pairing it with blockchain payments that settle in seconds and can be authorised by a signature alone.
How a payment works
- The client requests a resource in the normal way.
- If payment is needed, the server responds with status 402 and a machine-readable description of what it accepts, including the amount, the token, the blockchain network and the address to be paid.
- The client chooses an option, creates a payment payload signed with its private key, and resends the request with the payload in an HTTP header.
- The server checks the payload, either itself or through a facilitator service, and has the payment submitted to the blockchain.
- Once the payment is verified or settled, the server returns the resource with a response header describing the settled payment.
For USDC on EVM networks the reference design uses a signed transfer authorisation, so the payer signs a message rather than sending a transaction and does not need to hold the network's native coin for gas. The facilitator, which may be run by Coinbase or another party, submits the transfer on chain; it never takes custody of the funds, which move directly from payer to payee. Because each request carries its own payment, the server does not need to know who the client is, and the same client can pay many unrelated services from one wallet without opening an account with any of them. Prices can be set per request and changed at any time, since the 402 response states the current terms each time.
Uses
- Paid APIs. Data feeds, model inference and other services can charge per call instead of requiring an account and a subscription, a form of metered billing settled immediately.
- Agent purchases. An AI agent holding a funded agent wallet can buy access to tools and content on its own within limits set by its owner, a building block for agentic commerce.
- Content access. Publishers can sell single articles or files as micropayments without a paywall account system.
The protocol is designed to be chain-agnostic. Early implementations focused on Base, the Ethereum layer 2 network developed by Coinbase, with support for other networks such as Solana added by the project and third parties.
Comparison with other payment methods
Compared with a card-not-present transaction, an x402 payment needs no card details, checkout form or merchant account, and carries no interchange fee; the main cost is the blockchain network fee. It also lacks the consumer protections of cards, such as chargebacks, because confirmed stablecoin transfers are final. Bitcoin's Lightning Network has related schemes that pair HTTP 402 with Lightning invoices. Google's Agent Payments Protocol addresses the authorisation of agent purchases across payment methods and can work alongside x402 for stablecoin settlement.
Limitations and open questions
- Compliance. Sellers and facilitators must still handle sanctions screening, tax and, where relevant, licensing rules for accepting and converting stablecoins.
- Wallet funding. Clients need a funded stablecoin wallet and safe key management, which is a hurdle for ordinary users.
- Adoption. The protocol is young, and usage figures were still developing in 2025 and 2026. Coinbase transferred the protocol to the x402 Foundation, which the Linux Foundation announced in April 2026 and declared operational in July 2026.
External links
Ref 1240000536