How x402 payment works: the 402 is the quote
The x402 loop in four steps: send the request, read the 402, sign that exact amount as an EIP-3009 authorization, send it again. Quoting is free; the price is per network.
The loop
1. Send the request with no X-PAYMENT header. 2. The answer is HTTP 402 with an accepts array — each entry is ONE network’s own offer: maxAmountRequired in USDC atomic units, the asset contract, and the payTo address. 3. Sign that entry’s amount as an EIP-3009 transfer authorization (an EIP-712 signature any USDC-holding wallet can produce). 4. Send the SAME request again with the signature in X-PAYMENT. The answer carries the work and the settlement.
The 402 is not an error
HTTP 402 here is the quote. A request with no payment header is priced and stopped — never fulfilled and never charged — so quoting is free and repeatable. Agents can shop across networks by reading each accepts entry.
The price is per network: each chain’s entry carries its own amount, because settling costs a different amount on each chain. What another chain’s gas is doing never moves the price on yours.
Why agents like it
No account creation, no key exchange, no card. A wallet holding USDC is a complete customer identity: request, read, sign, resend. Payment and authentication are the same act.
FAQ
Is the 402 response an error?
No — it is the machine-readable quote. It carries the exact amount, asset and destination for each network, and nothing was charged to produce it.
What do I sign?
An EIP-3009 TransferWithAuthorization for the quoted amount — an EIP-712 typed signature over the USDC contract’s domain, produced by any wallet key.
Can I get quotes without ever paying?
Yes. Quoting is free and repeatable by design; a request without X-PAYMENT is priced and stopped.