OpenRouter 402 Payment Required: what it means and how to fix it
OpenRouter returns 402 when your balance, a key's credit limit or the in-flight budget cannot cover a request. A negative balance blocks :free models too.
Checked against the official docs on
The short answer
A 402 from OpenRouter means your account or API key has insufficient credits for the request. It is not a rate limit, so sending the same request again does not help, with one exception: a 402 whose error.metadata.limit_source is openrouter_in_flight_budget comes with a Retry-After header and clears once your running requests settle. OpenRouter also documents that a negative credit balance can return 402 on :free models: add credits to bring the balance above zero and they work again.
The error response
The 402 body OpenRouter documents, here for the in-flight budget case. Every error shares the shape error.code, error.message and an optional metadata; a 402 that carries limit_source also carries remedy_hint.
{
"error": {
"code": 402,
"message": "This request would exceed your available credits given your current in-flight requests. Retry after in-flight requests settle, or add credits.",
"metadata": {
"reason": "in_flight_budget_exhausted",
"limit_source": "openrouter_in_flight_budget",
"remedy_hint": "Retry after your in-flight requests settle (see the Retry-After header). Adding credits at https://openrouter.ai/settings/credits raises your in-flight budget, up to a capped ceiling."
}
}
}
Causes
- Your account balance cannot cover the request (
limit_source: openrouter_credits). If the balance is negative, OpenRouter says you may see 402 errors including for free models. - The API key has its own credit limit and it is spent (
limit_source: openrouter_key_limit).limit_remainingon the key reaches zero until the limit resets. - Your in-flight spending budget is full (
reason: in_flight_budget_exhausted,limit_source: openrouter_in_flight_budget). OpenRouter holds the estimated cost of running paid requests against a share of your balance; this is transient and can happen with no request still running, while recent costs settle. It never applies to requests to free models. - A single paid request is estimated to cost more than your whole in-flight budget (
reason: weight_exceeds_budget,limit_source: openrouter_credits). Retrying will not help.
Find which one you hit
- Read
error.metadata.limit_sourcein the body and branch on it. OpenRouter says to branch onlimit_source, not on theremedy_hinttext, which is meant for people reading logs. - Check for a
Retry-Afterheader. OpenRouter sends it on a 402 only for the in-flight budget case: a 402 without it is not a wait-and-retry case. - Call
GET /api/v1/keyto seelimit,limit_remaining,limit_resetand usage for the key, before requests start failing.
curl https://openrouter.ai/api/v1/key \
-H "Authorization: Bearer $OPENROUTER_API_KEY"
How to fix it
- Add credits to bring the account balance above zero. This also unblocks
:freemodels stopped by a negative balance. - Raise the key's credit limit, or wait for it to reset as
limit_resetsays. - For the in-flight budget, wait for
Retry-Afterand retry yourself: OpenRouter notes that the OpenAI, Anthropic, Vercel AI and OpenRouter SDKs do not retry a 402 on their own. - Lower
max_tokensor the prompt size so the request's estimated cost fits your balance and in-flight budget. - A spent org guardrail or workspace budget is a different error: OpenRouter answers 403, not 402, with the figures and
resets_atinerror.metadata.
What a failover router changes
A 402 describes the account, not one model. Retrying it, or moving to another :free model on the same OpenRouter account, will not help while the balance is negative. A router that has other providers configured can still answer by sending the request elsewhere.
Ficelle reads an OpenRouter 402 as a payment demand on a model it was told is free (billing_or_paid). Its anti-false-free guard quarantines that model and cools it for 24 hours by default. On a routing profile, the request moves to the next free candidate, on OpenRouter or another provider. Every candidate is a free model, so the failover never lands on a paid one.
A request that names one concrete model id instead of a routing profile has no failover in Ficelle: the error comes back to the client.
The general method, by failure class, is in the guide to LLM fallback that reads the error first.
Questions
Why does OpenRouter return 402 on a free model?
OpenRouter documents that a negative credit balance can return 402 errors including for free models. Adding credits to bring the balance above zero lets you use them again.
Should I retry an OpenRouter 402?
Only when it carries a Retry-After header, which OpenRouter sends for the in-flight budget case (limit_source openrouter_in_flight_budget). Any other 402 fails the same way until you add credits, raise the key limit or shrink the request.
What is the difference between an OpenRouter 402 and a 429?
A 402 means the account or key has insufficient credits. A 429 means a rate limit was hit, either an OpenRouter limit such as the free-model caps or the upstream provider being at capacity. A 429 is transient; a 402 is usually not.
How do I check my OpenRouter credits before a request fails?
Call GET https://openrouter.ai/api/v1/key with your key. It returns the key limit, limit_remaining, limit_reset and usage, so you can see a cap coming before requests start failing.
Sources
Official documentation and the published Ficelle code this page rests on, read on 11 November 2026:
- OpenRouter docs: Limits
- OpenRouter docs: Errors and debugging
- OpenRouter docs: Authentication
- Ficelle v0.3.13: failures.py (classify_failure, cooldown policy)
- Ficelle v0.3.13: router.py (default cooldown_seconds)
- Ficelle v0.3.13: cooldowns.py (escalation, provider retry delay)
- Ficelle v0.3.13: chat_completion.py (failover and Retry-After)