The short answer
HTTP 402 Payment Required is the status code a server returns when a request is valid but cannot be served until it is paid for. The HTTP standard defines it and still marks it "reserved for future use". Services that charge per request, such as paid tools for AI agents, use it to say "this call needs funds" in a way software can act on, without a person reading an error page.
Reserved for thirty years
When HTTP/1.1 was written in the 1990s, its authors expected the web to need a way to ask for payment, so they reserved a status for it: 402 Payment Required. The idea was digital cash, small amounts paid per page. That never arrived. Payments went to checkout forms, subscriptions and API keys billed monthly, and 402 stayed in the standard with the same note it carries today in RFC 9110: reserved for future use.
The reason it went unused is that payments on the web were designed for people. A person can read a pricing page, type a card number and click a button. A status code is for software, and until recently software did not spend money on its own.
Why AI agents need it
An AI agent is software that decides, at run time, which tools to call. When those tools cost money, the agent needs three things a checkout page cannot give it:
- A machine-readable "no": an answer it can recognise as "out of funds", distinct from "bad request" or "server down".
- Nothing charged for the refusal, so hitting the limit does not cost money too.
- The amount it was short, so it can tell a person exactly what is needed.
That is what 402 is for. A 404 says the thing does not exist and a 503 says try later; a 402 says this would work, and payment is what is missing.
What a 402 looks like
On Nexus402, a paid MCP tool call that the wallet or the key's spend cap cannot cover is refused like this:
HTTP/1.1 402 Payment Required
X-Nexus-Error: Budget_Exhausted
{"error":{"code":"Budget_Exhausted","required":"0.05","currency":"USD"}}
The status says payment is required, the header names the reason, and the body says how much the call needed. The amount is a string, not a JSON number, so no client rounds it. Nothing was charged, and the tool was never contacted.
What an agent should do with a 402
- Stop calling that tool. The same request will get the same answer until something changes.
- Tell a person, with the amount from the body: "This needs $0.05 and the budget is spent."
- Resume when funded: after a top-up, or, for a key's rolling cap, once older spend ages past 24 hours.
An agent that retries a 402 in a loop wastes turns; one that reports it is doing exactly what a budget is for.
How Nexus402 uses it
Nexus402 is named after this status code. It puts one key in front of a catalogue of paid MCP tools, and returns 402 whenever a call would spend money that is not there:
- when the pre-funded wallet cannot cover the tool's price, since there is no automatic top-up and no card on file to draw on;
- when the call would pass the key's rolling 24-hour spend cap, if it has one.
Finding tools is free: initialize, tools/list and ping are never billed, so an agent can always see what exists and what it costs. And a 402, like a 400, 401, 422, 429 or 503, is never charged. See pricing for what a call costs when it is paid.