How x402 uses HTTP’s ‘Payment Required’ response to handle API payments

Coinbase introduced x402 in May 2025 to give applications and AI agents a common way to pay for APIs, data and other digital resources. The open-source protocol uses the HTTP 402 Payment Required response so a server can quote its terms and a client can authorize payment without a custom billing integration for each provider.

As of December 5, 2026, at 00:22:22 UTC+8, the x402 Foundation, which operates under the Linux Foundation, had adopted the protocol. Participants reported at that time included AWS, Circle, Cloudflare and the Solana Foundation.

How a paid request works

  1. Request the resource. An application or agent sends an ordinary HTTP request to the server.
  2. Read the terms. The server returns 402 Payment Required. Its PAYMENT-REQUIRED header specifies the payment model, amount, accepted asset, blockchain network and recipient.
  3. Authorize payment. The client checks the terms against its budget and permissions. A protected wallet signer then generates a signed payment payload, such as a stablecoin transfer authorization.
  4. Retry the request. The client sends the request again, this time carrying the signed payload in the PAYMENT-SIGNATURE header.
  5. Verify and settle. The server validates the payload, optionally using a facilitator. It grants access once settlement is confirmed.

The protocol standardizes how software exchanges payment terms and authorizations, not which payment method it must use. Stablecoins such as USDC are common but not required.

For example, an agent troubleshooting a bug could pay for a single use of a remote testing service without a human setting up an account, arranging a subscription or funding a prepaid balance. For providers, the same exchange can support micropayments for individual API queries or pieces of digital content.

Further reading