What is x402?

There is a status code in the HTTP spec that has sat unused for decades: 402 Payment Required. It turns out to be exactly what machine payments needed. Here is how a dormant status code became the rail for agent commerce.

← All posts

A status code reserved for the future

When the web's creators wrote the HTTP specification, they included a status code, 402 Payment Required, and marked it as reserved for future use. For most of the web's history it stayed that way: a placeholder for a payments layer that never quite arrived, because the web settled on card forms and accounts instead. x402 is the effort to finally use 402 for what it was named for, now that fast digital money exists to back it.

The core idea

x402 defines a simple exchange. A client requests a resource. If that resource costs money, the server responds with 402 Payment Required and a small, machine-readable description of the payment it wants: how much, in what asset, and to what address. The client pays, then repeats the request with proof of payment attached. The server verifies the proof and returns the resource. That is the whole protocol: request, 402, pay, retry, deliver.

// 1. Client asks for a paid resource
GET /v1/premium-data

// 2. Server says: pay first
HTTP/1.1 402 Payment Required
{ "amount": "0.02", "asset": "USDT", "payTo": "0xabc..." }

// 3. Client pays on-chain, then retries with proof
GET /v1/premium-data
X-Payment: 0x9f3c...   // payment reference

// 4. Server verifies and returns the data
HTTP/1.1 200 OK

Why it fits machines so well

The reason x402 matters is that the entire flow is just HTTP and an on-chain payment. There is no redirect to a checkout page, no card form, no account to create, no session to manage. A program can do all of it in a few lines. That is exactly what an autonomous agent needs. It can call an API, get a 402, pay a couple of cents, and continue, without a human anywhere in the loop. Read how that looks in practice in how to let an AI agent pay for an API with x402.

Why stablecoins are the natural money for it

For x402 to work, the payment has to settle fast, cost little, and be worth a predictable amount. Stablecoins fit all three. USDT and USDC settle in seconds on BNB Smart Chain, cost a few cents in gas, and hold a dollar peg so a two-cent charge is really two cents. A slow or expensive or volatile payment would break the model; stablecoins make it practical.

What it unlocks

  • Pay-per-call APIs. Meter any endpoint and charge for a single request, no subscription required.
  • Agent-to-service commerce. Agents buy data, compute, and tools as they need them.
  • Micropayments that finally work. Amounts too small for card fees become viable when the fee is a few cents.
  • No accounts for one-off use. A caller can pay for a single use without signing up.

x402 turns the web's oldest unused status code into a payment handshake that machines can speak natively.

Where Sendbase fits

Sendbase supports x402 pay-per-call in USDT and USDC, and pairs it with spend-capped, self-custodial agent wallets so an agent can pay 402 challenges within limits you set. If you sell an API, you can put x402 in front of it so agents can pay you directly. If you build agents, you can give them wallets that handle 402s automatically. See the x402 payments page and the developer API.

The takeaway

x402 is not a new invention so much as a long-reserved idea whose moment arrived. With agents that can act and stablecoins that can settle instantly, 402 Payment Required finally does its job. If machine payments are anywhere in your roadmap, this is the standard to understand.

Build on x402

Open a free, self-custodial account and let agents pay your API per call, or give your agent a wallet.