What is x402?
x402 is an open payment protocol, originally developed by Coinbase, that enables instant, programmatic stablecoin payments directly over HTTP. It revives the long-reserved HTTP 402 Payment Required status code and gives it a concrete, blockchain-native meaning: if you want this resource, pay for it, right now, in this request. No accounts. No API keys. No checkout flows. Just HTTP. x402 picks up where HTTP left off. It makes payment a first-class citizen of the web, which is especially critical now that AI agents need to pay for resources programmatically.No Accounts
Clients donāt need to register, authenticate, or manage sessions. A wallet is the only credential.
HTTP-Native
Works with existing web infrastructure. Standard headers, status codes, and request-response.
Machine-Ready
AI agents can discover payment requirements and settle them autonomously.
Chain-Agnostic
Supports multiple networks through facilitators. EVM, Solana, and more, identified by CAIP-2 standards.
How it works
The x402 flow is a simple extension of HTTP. A client requests a resource, the server says āpay me,ā the client pays, and the server delivers.Step by step
Server responds with 402
If payment is required, the server returns
402 Payment Required with a JSON body describing what to pay: amount, token, network, and the recipient address.Client signs payment and resubmits
The client reads the requirements, constructs an ERC-3009 payment authorization, and signs it with their wallet. No tokens leave the wallet yet. Itās a signed intent, not a transfer. The client retries the same request with the signed payload in the
X-PAYMENT header.Facilitator verifies the payment
The server forwards the payment payload to the facilitatorās
/verify endpoint. The facilitator checks that the signature is valid, the amount is sufficient, and the payer has enough funds. If everything checks out, it returns valid. No money has moved yet.Server performs the task
Now that payment is verified, the server does the actual work (running inference, querying a database, generating a report, whatever the resource requires).
Facilitator settles the payment
After the task is complete, the server calls the facilitatorās
/settle endpoint. The facilitator submits the signed authorization on-chain, transferring tokens from the client to the seller. Once the blockchain confirms the transaction, the facilitator returns a settlement receipt.The three roles
Client (Buyer)
Client (Buyer)
The entity requesting a paid resource. Can be a human application, an AI agent, or any programmatic service with a wallet. The clientās only job is to read payment requirements from a
402 response, sign a payment, and resubmit.Resource Server (Seller)
Resource Server (Seller)
The service providing the paid resource (an API, a dataset, a tool). The server defines payment requirements (amount, token, network) and returns
402 for unpaid requests. It delegates verification and settlement to a facilitator.Facilitator
Facilitator
An intermediary service that verifies payment signatures and submits transactions on-chain. The facilitator never holds funds. it executes signed authorizations. It exposes two endpoints:
/verify (is this payment valid?) and /settle (submit it on-chain).Semantic operates a public facilitator at https://x402.semanticpay.io supporting USDā®0 on Plasma and Stable chains.x402 is an open standard
x402 is not proprietary to any single provider. Anyone can build a client, a resource server, or a facilitator. The protocol is defined by its HTTP semantics and payment payload format, not by a specific SDK or platform. Semantic operates the first USDā®-enabled x402 facilitator, bringing the worldās most liquid stablecoin to the protocol.For the full protocol specification and reference implementations, visit x402.org and the x402 GitHub repository.
