Skip to content

x402 payments protocol

x402 is an open protocol for internet-native payments that uses the long-reserved HTTP 402 Payment Required status code as a payment handshake between clients and servers. It is maintained by the Coinbase Developer Platform but positioned as a neutral, open standard.

When a client requests a paid resource, the server responds with HTTP 402 and a payment challenge describing the amount, accepted schemes, and destination. The client pays and retries the request with a proof-of-payment header; the server verifies and returns the resource. The flow is entirely HTTP-native — no SDKs, auth tokens, or out-of-band coordination are required.

Client ──GET /resource──▶ Server
Client ◀── 402 + payment challenge ── Server
Client ──pay on-chain / stablecoin──▶
Client ──GET /resource + X-PAYMENT proof──▶ Server
Client ◀── 200 OK + resource ── Server
  • No accounts or API keys — removes signup, KYC, prepaid credits, and key rotation
  • Agent-friendly — autonomous AI agents can pay for API calls without human-operated billing
  • Scheme-agnostic — supports multiple networks and payment schemes (stablecoins on EVM chains are the primary focus)
  • Per-request micropayments — enables pricing models (fractions of a cent per call) that are infeasible with card rails
  • Scheme negotiation happens inside the 402 response body; servers advertise which networks/tokens they accept
  • Proof-of-payment is carried in a request header on retry — typically an on-chain tx hash or signed authorization
  • The spec supports exact and upto payment modes for fixed-price and metered usage
  • Reference implementations and middleware exist for Express, Fastify, Hono, and Cloudflare Workers
  • x402.org — official protocol site, spec, and implementations (accessed 2026-04-10)
  • HTTP 402 on MDN — original HTTP status code reservation