Skip to content
Aevum Builder Challenge #1 · $1,500 in USDT prizes · Build Nov 16 – Dec 11Join →

What Is x402? How the HTTP 402 Payment Protocol Works

x402 lets a server charge per request over HTTP 402. How the payment flow works, the four payment schemes, facilitators, fees, and whether there's a token.

Industry Trend
"What Is x402?": a glass form in light, how the HTTP 402 payment protocol works

x402 is an open payment standard for charging per request over plain HTTP, with no account or API key. The server answers 402 Payment Required with a price, the client signs a stablecoin payment and sends the request again, and the server returns the result. Coinbase created it, and the Linux Foundation's x402 Foundation now hosts it.

Because the whole exchange is ordinary HTTP plus a signature, software can pay without a person filling in a form. The x402 docs list AI agents that pay for API access on their own among the things you can build, next to pay-per-request APIs and paywalled content.

Who Made x402, and Who Runs It Now

  • May 6, 2025. Coinbase announced x402 as an open standard that uses HTTP's original 402 status code for stablecoin payments. In the launch thread, the payment traveled in an X-PAYMENT header, and a server could settle it itself or hand settlement to a service called a facilitator.
  • September 23, 2025. Cloudflare said it was partnering with Coinbase to create an x402 Foundation, and added x402 payments to its Agents SDK and MCP servers.
  • December 11, 2025. Version 2 arrived, with version 2.0.0 of the @x402/core SDK published to npm that day. V2 moved all payment data into HTTP headers, dropped the old X- headers, switched to standard network IDs such as eip155:84532, and kept the reference SDKs backward-compatible with V1.
  • April 2, 2026. The Linux Foundation announced it was launching the x402 Foundation, with Coinbase contributing the protocol. It listed 22 organizations with initial intent and support, among them Visa, Mastercard, Stripe, Google, AWS, Shopify, Circle and Cloudflare.
  • July 14, 2026. The Linux Foundation announced the operational launch: Coinbase's contribution of the protocol was complete, and 40 organizations had joined as members.

The code now lives in the x402-foundation/x402 repository under the Apache-2.0 license. The FAQ is direct about the Coinbase question: Coinbase created the standard, but x402 is not a Coinbase product, and you don't need any Coinbase products to use it.

Some guides date the launch to late 2025, and some say facilitators first appeared in V2. The May 2025 announcement and launch thread show both were there from the start. The 402 status code itself is far older, and our guide to HTTP 402 covers its history.

How an x402 Payment Works

Three parties take part. The client, usually the buyer, asks for something and signs the payment. The server, the seller, states the price, checks the payment and serves the result. A facilitator can verify and settle payments for the server so it never has to talk to a blockchain itself.

Here is the flow as the facilitator docs lay it out:

  1. The client requests a resource, such as an API endpoint.
  2. The server answers 402 with a PAYMENT-REQUIRED header listing what it accepts: payment scheme, price, network and the address to pay.
  3. The client picks one option, signs a payment payload and sends the same request again with a PAYMENT-SIGNATURE header.
  4. The server checks the payload itself, or posts it to the facilitator's /verify endpoint.
  5. If the payment is valid, the server does the work.
  6. The server settles the payment on-chain, directly or through the facilitator's /settle endpoint. The facilitator submits the transaction and waits for confirmation.
  7. The server returns 200 with the result and a PAYMENT-RESPONSE header describing the settlement. If settlement failed, it returns 402 with error details.

Notice that step 5 comes before step 6. For the fixed-price, metered and batch schemes described below, the default is to verify the signature, serve the response and charge afterward. A fixed-price server can opt into settling first, which the docs call the "upfront" flow, and the refundable scheme takes the money into escrow before serving.

At least one guide describes the client sending the transaction to the blockchain. In x402 the client only signs; the server or its facilitator submits the payment.

HeaderSent byCarries
PAYMENT-REQUIREDServerWhat it accepts and the price
PAYMENT-SIGNATUREClientThe signed payment
PAYMENT-RESPONSEServerThe settlement result

Each header holds Base64-encoded JSON (HTTP 402 in the x402 docs). To see what a real one decodes to, we captured and decoded a live challenge in our HTTP 402 guide.

The Four Payment Schemes

A scheme sets the payment rules for a resource: how much the buyer authorizes and when the seller collects. As of November 2026, the docs define four of them.

SchemeFitsWhen the money moves
exactA fixed price: one API call, a file, a pageSettled per request, typically right away
uptoOne request metered as it runs, such as LLM tokens or compute timeBuyer signs a maximum; the seller settles the actual amount
batch-settlementMany small calls from the same buyerBuyer deposits once; the seller redeems on-chain later in batches
auth-capturePurchases that may need a refundHeld in escrow, then captured, voided or refunded after delivery

Three of the four are recent. The specs for upto, batch-settlement and auth-capture were added to the repository in March, April and May 2026.

batch-settlement is built for micropayments. On EVM chains the buyer deposits funds into on-chain escrow once, then signs an off-chain voucher with each request, and the seller claims many vouchers in one transaction later. Idle channels can be refunded. auth-capture builds on Base's commerce-payments escrow contracts; it works on EVM chains, and as of November 2026 it is in the TypeScript and Go SDKs but not yet in Python.

Refunds depend on the scheme. An exact payment is a push payment that cannot be reversed once executed, so a refund means the seller sends a new transfer back.

Cloudflare proposed a "deferred" scheme in 2025, with crawlers billed once a day as the example. It is not among today's four. The pull request that added batch-settlement in April 2026, opened by one of the authors of Cloudflare's proposal, says the scheme was designed to unify the deferred-settlement proposals, and it includes a Cloudflare network binding.

Our recommendation is to choose by when you know the price. A price fixed before you respond fits exact. A bill that grows during one request fits upto. Thousands of calls from the same buyer fit batch-settlement, and a sale you might fail to deliver fits auth-capture.

What a Facilitator Does, and What It Costs

The docs call a facilitator "optional but recommended." A server can verify signatures and settle on-chain by itself; with a facilitator, it does not need its own connection to the blockchain.

It does not hold money. The facilitator acts on payloads the buyer signed, and the FAQ notes that a facilitator that tampered with a payment would fail the signature check and could not settle it. Anyone can run one. The docs list 19 production facilitators and say the list is not exhaustive.

The public facilitator at x402.org is for testing. On November 11, 2026, its own list of supported networks covered Base Sepolia, Solana Devnet and the Algorand, Aptos, Stellar, Hedera and XRPL testnets, and the FAQ says it does not support Base mainnet.

The protocol itself charges nothing; the docs say the standard has "0 fees built in." Gas is the next layer, and on EVM chains the standard transfer methods (EIP-3009, or Permit2 for other ERC-20 tokens) are gasless for the payer, because the facilitator sponsors it. Permit2 also needs a one-time approval, which the docs say can be made gasless through two sponsoring extensions.

Facilitator fees vary by provider. Coinbase's CDP Facilitator is free for the first 1,000 on-chain transactions each month, then $0.001 per on-chain transaction. Verification is always free, and with batch-settlement one on-chain transaction can process thousands of payments. It also screens every payment against OFAC and KYT checks.

At least one guide puts facilitator fees at 0.1 to 1% of the payment. Coinbase's facilitator prices per on-chain transaction instead, and several facilitators on the docs' list advertise no fee at all.

Is There an x402 Token?

As of November 11, 2026, we found no token belonging to the x402 protocol. Its docs describe Apache-2.0 software, payments use existing tokens such as USDC, and the Linux Foundation announcement is about contributing a protocol.

Tokens marketed around x402 are third-party projects. Developers began launching x402-themed tokens in 2025, and CoinGecko added an "x402 tokens" category that year. So if you are asking "Can I buy x402 on Coinbase?", we know of no protocol token to buy, and nothing trading under that name appears in the standard's docs. We don't cover token prices.

How to Implement x402

The reference SDKs are in TypeScript, Python and Go. Server middleware exists for Express, Hono, Next.js, Fastify, Gin, net/http, Echo, FastAPI and Flask; client support covers fetch, Axios, Go's net/http, httpx and requests (SDK features).

On the seller side, a route gets a price and a payment address. This is trimmed from the seller quickstart:

import { paymentMiddleware, x402ResourceServer } from "@x402/express";
import { ExactEvmScheme } from "@x402/evm/exact/server";
import { HTTPFacilitatorClient } from "@x402/core/server";

// Create facilitator client (testnet)
const facilitatorClient = new HTTPFacilitatorClient({
  url: "https://x402.org/facilitator"
});

app.use(
  paymentMiddleware(
    {
      "GET /weather": {
        accepts: [
          {
            scheme: "exact",
            price: "$0.001",
            network: "eip155:84532", // Base Sepolia
            payTo: evmAddress,
          },
        ],
        description: "Weather data",
        mimeType: "application/json",
      },
    },
    new x402ResourceServer(facilitatorClient)
      .register("eip155:84532", new ExactEvmScheme()),
  ),
);

On the buyer side, the buyer quickstart wraps fetch, so a 402 is read, paid and retried without extra code:

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));

const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const response = await fetchWithPayment("https://api.example.com/paid-endpoint", {
  method: "GET",
});

A few things to get right along the way:

  • USDC is the most common asset, but sellers can accept any ERC-20 token on EVM networks or SPL token on Solana.
  • For mainnet, change the network ID (Base mainnet is eip155:8453) and move off the public facilitator to a production one, or settle yourself.
  • Older V1 servers use the X-PAYMENT header and names like base-sepolia. The reference SDKs still read V1, and the migration guide maps the changes.
  • Once a client has sent PAYMENT-SIGNATURE, a timeout does not mean the payment failed. The client and server docs say to treat the outcome as unknown and never pay a second time automatically; a settlement_pending status is not a failure.
  • To be found by agents, look at the Bazaar, x402's discovery layer. Facilitators that support it list the services registered through them, and any facilitator can run its own.

Limits to Know Before You Build

  • Payment and delivery are separate steps. In a GitHub issue in March 2026, a developer pointed out that a server could settle and return nothing, with "no escrow, no conditional release, no dispute mechanism at protocol level." auth-capture, added two months later with escrow and refunds, is the scheme meant for that risk.
  • x402 has no native on-ramp or off-ramp to bank money; the FAQ says facilitators or gateways can add one.
  • Usage figures are company claims. The V2 announcement says x402 processed over 100 million payments in its first months. As of November 2026, Coinbase's facilitator page says it has processed more than 100 million transactions and $28 million in payment volume across Base and Solana.
  • Discovery is young: the docs describe the Bazaar as "in early development."

What a Chain Needs to Support x402, and Where QDay Fits

The networks page separates two things. Protocol support is wide: any EVM chain by its eip155 ID, plus Solana, TON, Algorand, Stellar, Aptos, Hedera, NEAR, XRPL and others. Production support needs more: a working way to settle on that network, through a hosted facilitator, your own facilitator, or settling on your own server.

The docs' checklist for a new EVM network is short. Know which token you will accept and whether it supports EIP-3009 or needs Permit2. Have a production settlement path. Decide whether to price in explicit token amounts or contribute a default asset so dollar prices like "$0.001" work. Running your own facilitator takes an RPC endpoint for the network and a wallet holding the native token to sponsor gas.

QDay Aevum is EVM-compatible, with chain ID 44005, so at the protocol level x402 would address it as eip155:44005. QDay's roadmap covers the settlement side: an x402 facilitator and x402 payments on QDay are both coming soon. Aevum Testnet is live today, QDay's signatures have a path to post-quantum ML-DSA, and mainnet is planned for 2027. For the wider picture of agent payments, read how AI agents pay.

Get the next post in your inbox

Testnet releases, developer updates and research from QDay.

EssentialNeeded for the site to work. Always on.
Always on
AnalyticsGoogle Analytics, to understand how the site is used.
AdvertisingGoogle Ads and other ad tags, to measure and personalise our campaigns.