OceanAltOceanAlt

x402

A machine-payment interaction built on the HTTP 402 status code: the server answers an unpaid request with a 402 and a quote (amount, payee, one-time nonce); the client signs a payment authorization and retries the same request carrying that credential; the server verifies and releases the resource. The point is that no account and no API key are required — the payment is the identity. We implement the full round-trip in 200Lab, and you can run it yourself.

In plainer words

x402 is an open protocol that lets an AI agent pay for a single API call straight from its wallet. The name comes from an old HTTP status code — 402 Payment Required — which sat unused for decades; x402 picked it up. How it works is simple: an agent calls an endpoint, the server says "this costs money" (returns a 402 with the amount, payee, and a one-time number). The agent signs and pays from its wallet, retries the request with proof of payment, and the server hands over the result. What makes it special: no account, no API key. The payment is the identity — whoever paid gets access. That suits agents, which can't register, fill forms, and wait for approval the way people do. x402 is driven by Coinbase and has run real volume on mainnet since 2025. It's one of the main foundations for machines spending on their own.

Also known asHTTP 402 · Payment Required

RELATED TERMS

  • FacilitatorA third party that verifies payment credentials and settles
  • NonceA unique value carried by each payment, consumed once before

This definition is citable at a stable URL: https://oceanalt.com/en/glossary/x402

← Back to the glossary