What is x402? HTTP 402 payments for APIs and AI agents
Updated 2026-10-21
x402 is an open payment protocol that lets any HTTP API charge for a request, in stablecoins, with no account or API key. It revives the long-unused HTTP status code 402 Payment Required: the server answers an unpaid request with a price, the client pays, and the server returns the response. It was created by Coinbase and is now governed by the x402 Foundation under the Linux Foundation.
Because the whole exchange happens over plain HTTP, an AI agent can discover a paid API, pay a fraction of a cent for one call and use the result, without a human signing up, entering a card or managing keys.
HTTP 402 status code
HTTP 402 Payment Required is a status code reserved in the HTTP specification for digital payment. Most of the web never used it. x402 gives it a concrete flow: the server returns 402 with machine-readable payment requirements (price, network, token, pay-to address); the client pays in a stablecoin (usually USDC) and retries the same request with proof of payment. Until that payment is attached, the resource stays unpaid—there is no API key or account step in the protocol itself. Full write-up: HTTP 402 status code explained.
Related reading: x402 trust checks for agents, x402 alternatives hub, and the USDC payments APIs list.
How an x402 payment works
- The client (a script, app or AI agent) calls an endpoint, e.g.
GET /report. - The server replies
402 Payment Requiredwith its payment requirements: price, network (for example Base or Solana), token (usually USDC) and the address to pay. In x402 v2 these travel in thePAYMENT-REQUIREDheader. - The client signs a payment for exactly that amount (on EVM chains, a USDC transfer authorization) and retries the request with the signed payment attached (
PAYMENT-SIGNATUREin v2). - The server, usually through a facilitator, verifies the payment and settles it on-chain, then returns the data with a
PAYMENT-RESPONSEheader containing the settlement result.
A facilitator is a service that checks and settles payments so the API owner doesn’t have to run blockchain infrastructure. Several companies run hosted facilitators and there are independent ones too, each with its own pricing (see the x402 facilitator docs).
Which networks and tokens does x402 use?
Most x402 APIs charge USDC. In our directory, 535 listings use x402: 514 accept payment on Base and 173 on Solana, with smaller numbers on Polygon, Arbitrum and other chains. The x402 docs say live facilitators support networks including Base, Solana, Polygon and Avalanche.
Why it matters for AI agents
- No sign-up. An agent doesn’t need an account or stored API key for every service it uses.
- Pay per call. Prices of $0.001 to $0.01 per request are common in our listings, which makes one-off use practical. See pay-per-call AI APIs.
- Discoverable. Services that declare discovery metadata can be picked up by x402 directories and indexers, and agents can query those indexes for paid endpoints.
Some x402 services
Five x402 listings from our directory, A to Z by name (not a ranking). Full comparison: best x402 APIs.
| Tool | Protocol | Networks | Tokens | Price / call | Verified |
|---|---|---|---|---|---|
| 0x Swap API | x402 | Base, Solana | USDC | $0.01 | 2026-10-22 |
| 1gateway | x402 | Base, Solana | USDC | $0.002–$0.004 | 2026-10-23 |
| 2s | x402 | Base, Solana | USDC | $0.0025–$0.045 | 2026-10-22 |
| 3Route | x402 | Base, Solana, Etherlink | USDC | $0.001 | 2026-10-22 |
| 402atlas | x402 | Base | USDC | $0.1 | 2026-11-12 |
x402 vs other agent payment protocols
x402 is a payment rail for single HTTP requests. Other efforts such as Google’s AP2, OpenAI and Stripe’s ACP, Stripe and Tempo’s MPP, and Lightning’s L402 cover overlapping ground. We compare them in AI agent payment protocols compared.
Want to charge for your own API?
Read how to accept USDC for your API, then submit it to YourAITools for free.
Sources
Liked this guide? Get new crypto-payable AI tools weekly
One short email a week with the x402 and pay-per-call tools we added and re-verified. No spam, unsubscribe any time.