What is x402?
x402 is an open payment protocol that uses the HTTP 402 Payment Required status code, so clients such as AI agents can pay for an API call or content per request, often in stablecoins.
Also called: HTTP 402 payments
How it works
HTTP has had a 402 Payment Required status code for a long time, but few systems used it. x402 gives it a defined flow. A client asks for a resource. The server answers with 402 and the payment requirements, such as the price, the asset and where to pay. The client then sends the request again with a signed payment attached.
A service called a facilitator can verify the payment and settle it, so the server does not need to run its own payment system. When the payment is valid, the server returns the resource. Payments are often made in stablecoins, which suit small amounts and machine-to-machine use.
Why it matters
x402 is one of the building blocks of agentic commerce. An AI agent can pay for a single data lookup, an API call or an article without an account, a subscription or a human at checkout. This makes new pay-per-use models possible for APIs and content sites.
What risk teams should think about
A valid payment shows that funds moved. It does not show who is behind the agent or whether the agent acts for a real customer. Teams that sell or buy through x402 should think about the questions below.
- Agent identity: which agent sent the request, and can its claim be checked with methods such as Web Bot Auth?
- Spend limits: caps per request, per day and per vendor, so a confused or compromised agent cannot drain a wallet.
- Abuse: scraping at scale with many cheap payments, stolen funds used to buy access, or prompt injection that tricks an agent into paying a hostile server.
- Accountability: who is the person or business behind the agent, for disputes, sanctions rules and fraud reviews.
Example
A hypothetical research agent needs a company record from a paid data API. It gets a 402 answer with a small price, signs a stablecoin payment from a wallet with a daily limit, and retries. The API checks the payment through a facilitator and returns the record. The API owner also checks the agent's signature to see which operator runs it.
Related terms
- Agentic commerceAgentic commerce is shopping and payment where an AI agent finds, compares or buys goods and services on behalf of a person or business.
- AI agentAn AI agent is software that uses a language model to plan and take actions toward a goal, such as browsing sites, calling APIs or filling in forms, with little or no human input at each step.
- Know your agent (KYA)Know your agent (KYA) is the practice of identifying an AI agent, the organization that runs it and the person it acts for, before letting it access accounts or make transactions.
- Agent verificationAgent verification is the check that a request claiming to come from a named AI agent or crawler really comes from that agent, and not from a script that copies its name.
- StablecoinA stablecoin is a crypto token designed to keep a steady value, usually one unit of a fiat currency such as the US dollar, by holding reserves or using an algorithm.