Originally published at true402.dev/guides/what-is-x402.
x402 is how software pays software — money over HTTP, using a status code that sat unused for 25 years. No accounts, no API keys, no monthly plans. A request gets a price; the client pays; the result comes back. Here's the whole idea.
The 402 finally means something
HTTP reserved a status code — 402 Payment Required — back in the 1990s, then left it blank for decades because the web had no native way to pay. x402 fills that blank: a server answers an unpaid request with 402 and machine-readable payment terms, the client pays, and the request succeeds. It's a payment layer built into the request itself, introduced by Coinbase in 2025 as an open standard, now stewarded by the x402 Foundation.
Five steps, no signup
- Request a paid resource with no payment.
- 402 comes back with the terms — amount, asset (USDC), recipient, network (e.g. Base).
- Sign a stablecoin authorization (EIP-3009 — a gasless USDC transfer, signed off-chain).
-
Retry with an
X-Paymentheader carrying the signature. - Verify & serve — the server checks the payment (via a facilitator) and returns the result; settlement to chain happens async, so it doesn't slow the response.
Here's what that looks like against a real endpoint:
# Ask a paid endpoint with NO payment → the server tells you the price:
curl -i -X POST https://true402.dev/api/v1/base/token-report \
-H 'content-type: application/json' -d '{"token":"0x…"}'
# HTTP/2 402 Payment Required
# payment-required: { "amount":"5000", "asset":"USDC", "network":"eip155:8453", "payTo":"0x…" }
#
# → sign that USDC authorization with your wallet, retry with an X-Payment header, get the result.
# No account. No API key. The wallet is the identity.
Built for agents, not forms
Every API today assumes a human: sign up, get a key, add a card, manage a plan. An autonomous AI agent can't do any of that. x402 removes all of it — the wallet is the account, and payment is one signed message per call. An agent can discover a service and pay for it with no human in the loop, no credentials to store, no subscription to cancel.
That's why x402 matters now: agents are starting to transact, and they need a payment rail that's machine-native. (For a side-by-side with the alternatives, see x402 vs API keys, Stripe, and L402.)
Pay for things. Sell things.
As a buyer: pay per call for data, tools, and inference — no account.
As a seller: gate any HTTP endpoint behind a 402 and get paid in USDC with no merchant account and no chargebacks.
Agent-to-agent: agents pay each other for sub-tasks, composing services on the fly.
true402 is a live x402 marketplace doing exactly this — on-chain safety checks, DeFi signals, web tools, and LLM inference, all pay-per-call.
Try it in one line
Run a real x402 call with no setup — npx @true402.dev/rugcheck 0x… (free to try), or check a token in the browser.
FAQ
What is x402?
An open protocol that lets software pay for things over HTTP using the 402 "Payment Required" status code. A server responds to an unpaid request with HTTP 402 and machine-readable payment terms; the client pays with USDC by signing an authorization, retries with a payment header, and the server verifies and serves. No accounts, no API keys — the wallet is the identity.
What is HTTP 402?
A status code reserved in the HTTP specification since the 1990s but never standardized — it sat dormant for decades waiting for a native web payment mechanism. x402 finally gives it a concrete meaning: a 402 response carries the price, the asset, the recipient, and the network, so a client knows exactly how to pay and retry.
Do I need an account or API key to use x402?
No — that is the point. There is no signup, no API key to provision or rotate, and no monthly plan. A client pays per call by signing with its wallet, and the wallet address is the identity. This is what makes x402 a natural fit for autonomous AI agents.
What chains and tokens does x402 use?
x402 settles in stablecoins — most commonly USDC — over EVM chains, with Base as the primary network (low fees, fast finality). The payment is an EIP-3009 signed authorization, so the payer doesn't need native gas; the facilitator submits it.
What is an x402 facilitator?
A service that verifies and settles x402 payments on behalf of the resource server, so the server never touches the blockchain itself. The server hands the signed payment to the facilitator, which checks it and submits the settlement on-chain — keeping the API fast while staying chain-backed.
Top comments (0)