What Is 402 Payment Required?
· 2 min read
402 Payment Required is an HTTP status code used by APIs to request payment before delivering data. It allows a server to send a price quote and wallet address in the response, enabling machine-to-machine commerce without accounts or invoices.
How it works
When an AI agent requests access to a paid API, the server responds with a 402 status code. This response contains a quote with the price, network, token and payout wallet address. The client signs a payment for that amount and repeats the original request with the signed payment in a header. The server settles the payment, usually through a facilitator, and returns the requested data.
For example, an AI agent requests a translation service. The server replies with a 402 code and a quote for 0.01 USDC on the Base network. The agent signs a payment for that amount to the quoted wallet and resends the request with it. The server settles the payment and returns the translated text. No account or API key is needed.
Why it matters
HTTP has reserved the 402 code since the 1990s; x402 gives it a standard format. That enables automated payments for AI agents without human intervention. Sellers can monetize access directly while buyers avoid complex billing infrastructure. However, a payment receipt only proves money changed hands; it does not guarantee that the endpoint delivered the promised data or remains secure.
Related terms
- x402: The protocol that defines the 402 Payment Required response format and payment proof mechanism.
- Payout Wallet: The public cryptocurrency address listed in the quote where buyers must send funds.
- Payment payload: The signed payment the client sends with its retry, which the server settles before answering.
- MPP: The Machine Payments Protocol, which also uses 402 responses to ask for payment.
- Trust Score: A metric evaluating an endpoint’s reliability, price stability, and wallet safety before payment.
Lumière PayCheck monitors these endpoints to verify quotes and detect risks like wallet changes or hijacks. It provides a score and verdict to help agents decide whether to proceed with a payment.
Check any x402 endpoint free at https://lumierepaycheck.org/check.
More from the blog
x402 Payout Wallet Changed: What It Means for Your API Payments
If an x402 endpoint's payout wallet changed, the address where the seller receives money is different from before. This could be a legitimate update or a…
OpenAI Alternatives on x402: How to Check an AI API Before Your Agent Pays
More AI model APIs now sell by the call over x402: text generation, image generation, embeddings, speech. No account, no API key, no monthly plan. Your…
We started grading MPP endpoints. Here's what 1,226 of them look like.
We checked every callable endpoint in the MPP catalog and read 30 days of MPP payments on Tempo: 581,000 real payments at a median of 1 cent, 98%…