Skip to Content

x402 Protocol

Overview

x402 turns an API or digital service into a paid resource. The buyer sees the price, pays, and receives access without leaving the request flow.

How x402 works

x402 is an open standard that embeds payment into HTTP. A service can charge for each request directly, with no checkout page, no subscription and no separate billing system. Payment is handled as a handshake between client and server: the server states its price in the response, the client pays, and the exchange finishes by delivering the resource.

When a request arrives without payment, the server replies with HTTP 402 Payment Required and the price. The client then signs a payment and repeats the request. The server validates that payment, settles it onchain and returns the response. Neither side needs an account, an API key or a prior contract. This suits agents, which discover a service and must pay for it at that same moment, and it suits API providers that want to sell to agents without a sales process.

Signet lets you offer x402 products without building any blockchain infrastructure yourself. The Signet Facilitator handles verification and settlement, and sellers are paid directly into a self-custody wallet address that they control.

The x402 flow

Figure 4. Sequence of an x402 payment.

StepWhat happens
1. The client requests a paid resourceA browser, script or agent calls the endpoint without any payment attached.
2. The server answers with a priceThe response is 402 Payment Required. It lists the schemes, networks and amounts that the server accepts in an accepts array.
3. The client pays and retriesThe client chooses one accepted option, signs a payment for it and repeats the request, with the signed payload in the PAYMENT-SIGNATURE header.
4. The facilitator verifies and settlesThe server hands the payment to a facilitator, which checks the signature and settles the transfer onchain.
5. The server returns the responseThe client receives 200 OK, the response body and a PAYMENT-RESPONSE header that carries the settlement receipt.

HTTP headers

HeaderSent byContent
PAYMENT-REQUIREDServerMachine-readable payment instructions: price, asset (for example USDC or USD8), recipient address and the accepted payment scheme.
PAYMENT-SIGNATUREClientThe signed payment payload, attached when the client retries the request.
PAYMENT-RESPONSEServerThe settlement receipt, returned together with the resource.

The x402 facilitator

The Signet x402 facilitator accepts payments in USDC and USD8 over the x402 protocol. It exposes two APIs:

EndpointPurpose
POST /verifyVerifies a payment made with a supported scheme and network.
POST /settleSettles a payment made with a supported scheme and network.

The request and response schemas are published in the Signet API reference.

Payment schemes

A scheme defines how the amount is set and how it is settled. A server can offer several schemes in accepts and let the client choose.

SchemeHow it chargesBest suited to
exactA fixed price for each request.Lookups, searches and most API calls.
uptoThe buyer authorizes a ceiling. The server settles the amount actually used, up to that ceiling.Inference, rendering and any work whose cost is known only after it is done.
batch-settlementThe buyer deposits once and pays with signed vouchers that are settled in batches.High-frequency payments such as per-token billing or streaming.

With batch settlement, each voucher is verified off-chain and only the aggregated result is settled onchain, which suits agents that make thousands of small payments within a single task.

The Signet CLI signs a payment with the agent’s session key, using the qday:erc4337 scheme. A 402 that offers no such option is refused before anything is signed. See what the CLI checks.

Flexible design

x402 defines the payment handshake without prescribing one payment rail. Sellers decide how payment messages travel, where payments settle, which assets they accept and how they charge.

  • Flexible assets. USDC is the asset that sellers accept most often. USD8 is the stablecoin of the QDay blockchain.
  • Flexible pricing. A seller can charge a fixed price, authorize a maximum and settle only what was used, or defer settlement and settle a batch of payments together.

The seller advertises the combinations it accepts, and the buyer picks a supported option. The Signet facilitator then verifies and settles the payment on the seller’s behalf.