Skip to main content

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

1

Client requests a resource

The client sends a standard HTTP request.
2

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.
{
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact",
    "network": "eip155:9745",
    "maxAmountRequired": "1000000",
    "asset": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
    "resource": "https://api.example.com/data",
    "payTo": "0x1234...abcd"
  }]
}
3

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.
4

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.
5

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).
6

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.
7

Server delivers the resource

The server returns 200 OK with the requested resource in the body and a settlement receipt in the X-PAYMENT-RESPONSE header. From the client’s perspective, this is a single request-response cycle.
The key insight: verify before doing work, settle after. The server never spends resources on unverified requests, and the client’s funds only move after the task is complete.

The three roles

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.
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.
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.

Next steps

Last modified on February 13, 2026