How does x402 work?
The x402 flow has five steps. (1) The client makes a normal HTTP request to a paid endpoint. (2) The server replies with HTTP 402 and a PAYMENT-REQUIRED header describing the chain, token, amount, and recipient. (3) The client signs a payment payload (no on-chain transaction yet) and retries the request with a PAYMENT-SIGNATURE header. (4) The server forwards the signed payload to a stateless facilitator, which verifies the signature and then settles the payment on-chain. (5) Once settlement confirms, the server returns the paid response with a PAYMENT-RESPONSE header. The entire round-trip can complete in seconds on a fast chain like Base or Solana.