The 402 response
A 402 response carries aPaymentRequirements payload. In x402 version 1, the server returns it as a JSON body. In version 2, it arrives as a base64-encoded payment-required response header.
The payload contains an accepts array with one or more payment options. The client selects the option that matches its configured scheme and network, then constructs a signed payment from those terms.
Payment requirements fields
tokens are identified by their contract address in theasset field.
identifies the blockchain network in the network field.
Why the scheme is the server’s choice
The resource server decides which payment schemes it accepts, at what price, and on which networks. It publishes those terms in the 402 response. The client decides which of the offered options it can fulfill. Neither side is forced into a specific payment method. Theaccepts array lists options; the client picks what it can fulfill.
A server can list multiple entries in accepts to support different schemes or networks simultaneously. A client that supports both 4mica-credit and exact selects whichever it prefers.
Builder guidance
When you configure your 402 response:- Set
schemeto4mica-creditfor 4Mica guarantee-backed payments. - Use the CAIP-2 format for
network:eip155:8453for Base,eip155:1for Ethereum mainnet. - Set
maxAmountRequiredin token base units. For USDC (6 decimals), $1.00 is"1000000". - Set
payToto the wallet address that should receive payment after netting and settlement. - Set
maxTimeoutSecondsto the time you are willing to wait between the client signing and your call to/settle. 300 seconds is a reasonable default for most API flows.