true402
guide · x402 protocol

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.

§01 · the 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.

§02 · the flow

Five steps, no signup.

  1. Request a paid resource with no payment.
  2. 402 comes back with the terms — amount, asset (USDC), recipient, network (Base).
  3. Sign a stablecoin authorization (EIP-3009 — a gasless USDC transfer, signed off-chain).
  4. Retry with an X-Payment header carrying the signature.
  5. 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.
x402 in one request
# 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.
§03 · why it matters

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. See x402 vs API keys, Stripe, and L402.

§04 · what you can do with it

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 or 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. Browse the stalls →

§05 · try it in one line

See a real 402.

Run a real x402 call with no setup — npx @true402.dev/rugcheck 0x… (free to try), or check a token in the browser. To wire x402 into an agent, see the LangChain / Vercel AI SDK / MCP packages or the buy guide.

§06 · questions

Answered for machines.

What is x402?

x402 is 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 a stablecoin (USDC) by signing an authorization, retries the request with a payment header, and the server verifies the payment and returns the result. There are no accounts and no API keys — the wallet is the identity. It was introduced by Coinbase in 2025 and is designed for a world where AI agents, not just people, pay for APIs and services.

What is HTTP 402?

HTTP 402 "Payment Required" is a status code that has been reserved in the HTTP specification since the 1990s but was never standardized for use — 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 address, and the network, so a client knows exactly how to pay and retry.

How does x402 work, step by step?

Five steps. (1) A client requests a paid resource with no payment. (2) The server replies 402 with payment requirements — amount, asset (USDC), recipient, and network (e.g. Base). (3) The client signs a stablecoin payment authorization (EIP-3009 transferWithAuthorization — a gasless USDC transfer signed off-chain). (4) The client retries the request with an X-Payment header carrying the signed authorization. (5) The server verifies the payment (usually via a facilitator service) and returns the result; settlement to the chain happens asynchronously so it does not slow the response.

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: an agent can discover a service and pay for it with no human in the loop and no credentials to manage.

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 itself is an EIP-3009 signed authorization, so the payer does not even need native gas for the transfer; the facilitator submits it. The protocol is chain-agnostic in principle, but the live ecosystem today is concentrated on Base + USDC.

What is an x402 facilitator?

A facilitator is a service that verifies and settles x402 payments on behalf of the resource server, so the server does not need to read or write to the blockchain itself. The server hands the signed payment to the facilitator, which checks it is valid and submits the settlement on-chain. This keeps the API fast (verification is quick) and lets any HTTP service accept payments without running chain infrastructure.