Definition
HTTP 402 Payment Required is an HTTP status code that the HTTP standard reserves for future use without defining how it works. Newer payment protocols, including x402 and the Machine Payments Protocol (MPP), and Cloudflare's pay per crawl use it to tell a client, often an AI agent or crawler, that it must pay before the server returns a resource.
Why it matters
Status 402 is how a website can say "pay first" in the same language browsers and bots already use. That makes it a natural fit for AI agents and crawlers, which fetch pages and data automatically and can't fill in a checkout form.
If you sell access by the request, such as an API call, a report or a crawl of your content, 402 is the signal several new payment schemes use. If you sell physical goods through a cart, you are more likely to meet agents through checkout standards such as UCP or ACP.
How it works
The HTTP standard itself says very little. RFC 9110 states: "The 402 (Payment Required) status code is reserved for future use." MDN adds: "No standard use convention exists and different systems use it in different contexts."
So each scheme that uses 402 defines its own details:
- x402. Stripe's documentation says: "When a client requests a paid resource, your server returns an HTTP
402response with payment details." The client pays, in Stripe's implementation with the USDC stablecoin, then retries with authorization. The details travel in apayment-requiredheader. - MPP. Stripe's MPP documentation describes the same pattern: the server returns 402 with payment details, and "The agent authorizes the payment, retries the request, and gets access to the paid resource along with a receipt." MPP accepts cards as well as stablecoins.
- Pay per crawl. Cloudflare's documentation says an AI crawler either presents "payment intent via request headers" for normal access, or receives "an
HTTP 402 Payment Requiredresponse with pricing." At the time of writing, Cloudflare says pay per crawl is in closed beta.
Each scheme sets its own headers and steps, so supporting one does not mean supporting the others.
Example
An agent requests a paid data file from a server that uses x402. The server replies:
HTTP/1.1 402 Payment Required
payment-required: eyJ4NDAyVmVyc2lvbiI6MiwiZXJyb3IiO...
The encoded header carries the price and where to pay. The agent pays, repeats the request with its payment credential, and gets the file. For a fuller explanation, read what is x402?
Sources
- RFC 9110: HTTP Semantics, section 15.5.3 · checked 17 Nov 2026
- MDN: 402 Payment Required · checked 17 Nov 2026
- Stripe Docs: x402 · checked 17 Nov 2026
- Stripe Docs: MPP · checked 17 Nov 2026
- Cloudflare Docs: What is pay per crawl · checked 17 Nov 2026