What is x402? The HTTP status code becoming the payment layer for AI agents
x402 is an open protocol that turns HTTP 402 Payment Required into a real, machine-readable payment handshake. Here's how it works and why Coinbase, Stripe, and Adyen are backing it.
HTTP 402 Payment Required has sat dormant in the spec since 1997. In 2024 Coinbase revived it as x402 — an open protocol that lets any server demand a stablecoin payment for a single request, and any client (especially an autonomous AI agent) settle that payment and retry, all in one round trip.
The handshake in three steps
- Client calls GET /weather. Server responds 402 with a JSON body describing price, network, and destination wallet.
- Client signs a USDC transfer (typically on Base or Solana) for the exact amount and resends the request with an X-Payment header.
- Server verifies the on-chain transfer, returns 200 with the actual response, and logs the call.
Why agents need this
An autonomous agent can't sign up for a RapidAPI account, store an API key, or wait for a human to approve a Stripe charge. x402 collapses billing, auth, and access into a single HTTP exchange the agent can do on its own.
Who's behind it
x402 is a Linux Foundation project with Coinbase, Stripe, and Adyen as foundation members. The spec is open; implementations exist for Base, Solana, and other EVM chains.
Where to try it
Vend402 is an x402-native marketplace of paid endpoints. Open the playground, hit any API in our catalog, and you'll see the 402 → pay → 200 cycle in your network tab.
See x402 in your network tab.
Hit any endpoint in the Vend402 catalog from the playground — watch the 402 → pay → 200 cycle happen live.
Keep reading
- x402 vs Stripe vs RapidAPI: which billing model fits your API?Subscriptions, usage-based billing, and pay-per-call all sound similar. They aren't. A direct comparison of x402, Stripe metered billing, and the RapidAPI marketplace for API providers.
- How to monetize an API with x402 in under 10 minutesStep-by-step: take any HTTP endpoint you own, plug in x402 middleware, list it on a pay-per-call marketplace, and start collecting USDC per request.