HTTP 4xx status code
402 Payment Required
402 Payment Required is one of the odder corners of the web. It is an official HTTP status code, sitting in the client-error range alongside familiar codes like 403 and 404, and its meaning is simple enough: the server will not fulfil the request until it is paid for. What makes it strange is that for almost the entire history of the web, nobody used it.
The reason is in the specification itself. HTTP reserves 402 for future use and never says how payment should actually work, what the client should send, or how the server should respond once paid. Without those details agreed, there was no interoperable way to build on it, so it sat idle while the paid web was built on other things: subscriptions, API keys, and checkout pages that have nothing to do with the status code.
That is starting to change, and the reason is machines paying machines. As more services charge per request, and as AI agents begin calling paid APIs on their own without a human at the keyboard, there is real demand for a standard signal that means “this costs money, pay and retry.” A status code is the obvious place to put that signal, and 402 is the one that was reserved for exactly this. Recent proposals for pay-per-request access and agent-to-agent payments have started to fill in the missing details, pairing 402 with headers and payment tokens so that an agent can be charged, settle the cost, and continue without stopping to ask a person.
Whether 402 becomes the standard or just one option among several is still being worked out. But after decades as the web’s most famous unused status code, it is finally finding the job it was reserved for.
Frequently asked
What does HTTP 402 Payment Required mean?
It is a client-error status code that signals payment is needed before the request can be fulfilled. The specification reserves it for future use, so exactly how a client should pay has never been standardised, which is why it was rarely used.
Is HTTP 402 actually used?
For most of the web's history, almost never. A few APIs return it when an account runs out of credit or hits a paid quota. Interest has grown recently as pay-per-request APIs and AI agent payments look for a standard way to say a request costs money.
Why does 402 matter for AI agents?
Autonomous agents increasingly call paid services on their own. A standard code that means "this costs money, pay and retry" lets an agent handle payment automatically, and 402 is the natural fit, which is why proposals for agent and machine payments have revived it.