What is x402 Pricing Negotiation?
x402 pricing negotiation is the process by which a resource server communicates its accepted payment terms — including amounts, tokens, networks, and schemes — and a client selects the option matching its capabilities and preferences.
WHY IT MATTERS
Unlike traditional payment systems where pricing is displayed on a webpage for humans, x402 pricing negotiation is entirely machine-readable and happens within a single HTTP round-trip.
When a server returns 402 Payment Required, the PAYMENT-REQUIRED header contains an array of PaymentRequirement objects. Each specifies:
- scheme — the payment logic (e.g.
exactfor fixed-amount, potentiallyuptofor usage-based, ordeferredfor batch settlement) - network — which blockchain (e.g.
base,base-sepolia,ethereum) - maxAmountRequired — the price in the token's smallest unit
- resource — the URL being purchased
- description — human-readable explanation of what's being purchased
- extra — scheme-specific metadata
A server might offer the same resource at different prices on different networks (cheaper on L2s), or accept multiple stablecoins. The client evaluates its wallet balances, supported networks, and spending policies to select the optimal option.
This negotiation model mirrors HTTP content negotiation (Accept headers) — the server offers options, the client picks. No accounts, no shopping carts, no checkout pages. Future schemes like upto would enable dynamic pricing where the final cost depends on resources consumed during the request (e.g. tokens generated by an LLM).
HOW POLICYLAYER USES THIS
PolicyLayer evaluates every payment requirement an agent encounters against configured policies. If a server requests payment to an unknown recipient, exceeds per-request limits, or uses a disallowed currency, the payment is blocked before the agent signs anything — even if the agent's own logic would have accepted the terms.