OpenRouter error
OpenRouter 402 weight_exceeds_budget: what it means and how to fix it
402 weight_exceeds_budgetRetry? NoLast verified 1 documented fix1 source
What it means
This single request's estimated cost is larger than your whole in-flight budget. metadata.limit_source is openrouter_credits. Retrying will not help.
Causes
- Large prompt or high max_tokens making one request's estimated cost exceed the in-flight budget
How to fix it
- Fix 1.
Lower max_tokens or the prompt size, or add credits.
More OpenRouter errors
All 32 OpenRouter errors400 invalid_requestRetry? Not stated400 invalid_promptRetry? Not stated400 context_length_exceededRetry? Not stated400 max_tokens_exceededRetry? Not stated400 token_limit_exceededRetry? Not stated400 string_too_longRetry? Not stated400 invalid_imageRetry? Not stated400 image_too_largeRetry? Not stated
HTTP 402 at other providers
FAQ
What does the OpenRouter error "402 weight_exceeds_budget" mean?
This single request's estimated cost is larger than your whole in-flight budget. metadata.limit_source is openrouter_credits. Retrying will not help.
How do I fix OpenRouter "402 weight_exceeds_budget"?
Lower max_tokens or the prompt size, or add credits.
Should I retry OpenRouter "402 weight_exceeds_budget"?
No. The official docs treat this error as not retryable: fix the cause before sending the request again.
Which other AI APIs return HTTP 402?
Per their official error docs: Anthropic API (402 billing_error), Cohere API (402 Payment Required), DeepSeek API (402 - Insufficient Balance), Gemini API (402 payment_required; 402 RESOURCE_EXHAUSTED), Mistral API (402 Payment required).
Sources
Last verified against 1 source: OpenRouter's official docs and official SDK repositories.
- openrouter.aihttps://openrouter.ai/docs/api_reference/limits
Newsletter
Know when the APIs change
One email per week. New model releases, API changes, what broke, and how developers are working around it.