Skip to content
UCP
Menu

Settlement layer · Payments

x402: paying between machines via the HTTP 402 code

x402 is the payment protocol Coinbase launched on May 6, 2025. It revives a forgotten HTTP code, 402 Payment Required, to let AI agents, apps and APIs settle in stablecoins directly over HTTP. Here is how it works and where it sits in the agentic commerce stack.

Editorial team · Updated : June 2026 · Primary query : x402

In one sentence: x402 turns the HTTP 402 "Payment Required" code, dormant since the early web, into a stablecoin payment rail between machines. It is a settlement layer built for agents and services, not a checkout protocol for consumer products.

Update — June 2026: Coinbase for Agents

On June 11, 2026, Coinbase launched Coinbase for Agents, a platform that lets AI assistants like ChatGPT and Claude connect to a user's Coinbase account to trade crypto, access data and, eventually, make payments and purchases autonomously. It pairs the x402 protocol with user-defined spending controls — the same guardrail logic found in AP2 on the UCP side. See our agentic payments briefing for June 2026.

Source: CoinDesk, "Coinbase launches AI agent accounts", June 11, 2026.

What Coinbase launched on May 6, 2025

Coinbase released x402 as an open standard that embeds payment directly into the HTTP exchange. The idea: a client (human, script or AI agent) that hits a paid resource gets a 402 response describing the expected payment, attaches a signed stablecoin payment, and receives the resource, all without a separate wallet interface or dedicated authentication mechanism. The protocol launched alongside collaborators including AWS, Anthropic, Circle (the issuer of USDC) and NEAR.

Why revive the 402 code

The 402 Payment Required code has been part of the HTTP spec from the start, but stayed dormant for lack of a web-native payment method. Traditional rails (cards, transfers, subscriptions) are slow, costly, geographically and authentication-bound, and ill-suited to micropayments. With stablecoins like USDC and L2 networks like Base, where on-chain fees have dropped to around one cent, automatic micropayments become practical again. x402 builds on that shift.

How x402 works

The flow is deliberately minimal and stays inside HTTP:

  • The client (agent or app) requests a resource from an x402-enabled server.
  • The server replies with a 402 Payment Required status, including payment details (amount, accepted tokens).
  • The client retries the request with a signed payment in an HTTP header (X-PAYMENT).
  • A payment facilitator (for example Coinbase's x402 Facilitator service) verifies and settles the payment on-chain.
  • The server returns the requested resource, with an X-PAYMENT-RESPONSE header confirming the transaction.

Because it extends native HTTP behavior, x402 works with nearly any client (browsers, SDKs, AI agents, mobile apps) without reworking the client/server flow.

What it unlocks

x402 targets uses that legacy rails make hard: per-call paid APIs, on-demand feature unlocks, services billed on real usage, and above all economic autonomy for agents. An agent can provision compute and pay per inference, buy market data per request, or access a paid resource with no prepaid API key and no human in the loop. Coinbase and its partners demonstrated this across compute infrastructure, real-time data and agent-to-agent interactions.

Where x402 sits in agentic commerce

x402 is a machine-to-machine settlement layer. It differs from the commerce layers (Google's UCP, OpenAI and Stripe's ACP), which orchestrate the buying journey at a merchant, and from the authorization layer (Google's AP2), which proves the user's payment mandate. For a consumer-product purchase, UCP and ACP lead; x402 comes into its own for payments between agents and digital services. Its ecosystem has grown since launch, including an x402 Foundation backed by Cloudflare and Coinbase, and an integration by Stripe.

Should you care as a merchant?

If you sell products to consumers, x402 is not your immediate priority: focus on exposing your catalog to agent surfaces via UCP and agentic checkout. x402 becomes relevant if you provide APIs or digital services that other agents may consume and pay for per use.

Frequently asked questions

Is x402 tied to a single blockchain?

No, it is designed to be chain-agnostic. Early demonstrations use USDC and L2 networks like Base, where fees are very low.

Do you need a complex crypto wallet?

The point of x402 is to avoid that: payment runs through standard HTTP headers and a facilitator handles verification and settlement, with no dedicated wallet interface on the integration side.

Does x402 replace credit cards?

Not for consumer commerce. It addresses machine-to-machine payments and micropayments, where cards are ill-suited (fees, latency, prepayment).

Sources

Further reading