What is x402?
x402 turns the web's oldest unused status code — HTTP 402, “Payment Required” — into a working payment rail for software and AI agents. It lets one program pay another per request, in stablecoins, with no account, no API key, and no human in the loop. Vevang's agents are built on it; here's exactly how it works.
The one-sentence version
When you request a paid resource without paying, the server answers HTTP 402 with the price and payment details. You pay — in USDC on the Base network — and retry the exact same request. This time it returns the result. That whole round trip is x402.
Why the 402 status code
Every web developer knows 404 (not found) and 403 (forbidden). 402 — “Payment Required” — was reserved in the original HTTP specification decades ago and left unused, waiting for a native way to pay for a request. x402 finally fills it.
An x402 response carries a machine-readable payment challenge: the amount, the asset (USDC), the network (Base, chain eip155:8453), and the address to pay. Because it rides on plain HTTP, any client that can make a request can pay — including autonomous AI agents, which is the entire point.
How a payment actually flows
First, the agent makes a normal request — say, a POST to an endpoint. Unpaid, it gets back a 402 with the payment terms.
The agent's wallet then signs an authorization to transfer the USDC using EIP-3009, which makes the payment gasless — the agent needs only USDC, not ETH for gas. A facilitator submits the transfer on-chain, the server confirms settlement, and returns the result.
The agent never created an account, never held an API key, and never waited on a human. It discovered the price at request time and paid it.
x402 vs. API keys and subscriptions
The old way to sell an API is a key and a monthly plan: sign up, get billed, manage quotas. That works for humans with credit cards. It breaks for agents, which spin up, do one job, and need to pay a few cents to a service they discovered a second ago.
x402 is pay-per-call by default — no signup, no minimum, no subscription. A service can charge $0.01 for a single call and get paid instantly. That unlocks a long tail of micro-transactions between programs that subscriptions could never serve.
x402 in practice — a live example
Vevang runs four agents entirely on x402. The AI Web Extractor charges $0.01 to turn a URL into clean markdown; the AI Output Verifier charges $1 to check another agent's work; the AI Video Producer charges $12 and up for a finished video. Each is a real endpoint that returns a 402 challenge and settles in USDC on Base.
They even pay each other: before the Video Producer ships a render, it can pay the Verifier $1 over x402 to confirm the file is valid — one agent buying a service from another, autonomously, settled on-chain.
Frequently asked
Vevang's agents settle in USDC on Base (an Ethereum layer-2), chain ID eip155:8453. The protocol itself is network-agnostic.
No — human-facing products usually wrap it with a normal card checkout. x402 is how agents and developers pay programmatically.
For the payer, yes on Vevang's endpoints: EIP-3009 lets the agent authorize a USDC transfer without holding ETH for gas; a facilitator submits it on-chain.
Four autonomous AI agents you can hire by the job or call over x402 — earning, verifying, and paying each other on-chain today.
Meet the agents