OpenRouter error
OpenRouter 429 rate_limit_exceeded: what it means and how to fix it
429 rate_limit_exceededRetry? YesLast verified 3 documented fixes2 sources
What it means
A request- or token-level rate limit was hit. It can come from OpenRouter (free-model limits of 20 requests per minute and 50 or 1000 requests per day, or DDoS protection) or from the upstream provider, in which case error.metadata.provider_code carries the provider's code. If hit after streaming starts, it arrives as an SSE event with finish_reason error instead of HTTP 429.
Causes
- Free model variant (:free) per-minute or per-day request cap
- Cloudflare DDoS protection blocking requests that dramatically exceed reasonable usage
- Upstream provider rate limiting or at capacity
How to fix it
- Fix 1.
Retry with exponential backoff and honor the Retry-After header when present.
Snippetconst res = await fetch('https://openrouter.ai/api/v1/chat/completions', { ... }); if (res.status === 429 || res.status === 503 || res.status === 402) { const retryAfter = Number(res.headers.get('Retry-After')); if (Number.isFinite(retryAfter) && retryAfter > 0) { await new Promise((r) => setTimeout(r, retryAfter * 1000)); // retry the request } } - Fix 2.
On free variants, purchase at least 10 credits to raise the daily limit, or switch to the paid variant of the model.
- Fix 3.
For provider-side limits, add fallback models or relax provider routing preferences so more providers are eligible.
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 429 at other providers
Compare 429 across providers429 ThrottlingExceptionRetry? YesAmazon Bedrock429 ModelNotReadyExceptionRetry? YesAmazon Bedrock429 rate_limit_errorRetry? YesAnthropic API429 rate_limit_error (enforced_spend_limit_reached)Retry? NoAnthropic API429 Too Many Requests (Rate limit is exceeded)Retry? YesAzure OpenAI429 Too Many Requests (System is experiencing high demand)Retry? YesAzure OpenAI429 Too Many Requests (temporary rate limit adjustment)Retry? YesAzure OpenAI429 Too Many Requests (token budget exceeded by request parameters)Retry? Not statedAzure OpenAI429 Too Many RequestsRetry? YesCohere API429 - Rate Limit ReachedRetry? Not statedDeepSeek API429 rate_limit_exceededRetry? YesGemini API429 quota_exceededRetry? YesGemini API
FAQ
What does the OpenRouter error "429 rate_limit_exceeded" mean?
A request- or token-level rate limit was hit. It can come from OpenRouter (free-model limits of 20 requests per minute and 50 or 1000 requests per day, or DDoS protection) or from the upstream provider, in which case error.metadata.provider_code carries the provider's code. If hit after streaming starts, it arrives as an SSE event with finish_reason error instead of HTTP 429.
How do I fix OpenRouter "429 rate_limit_exceeded"?
There are 3 documented fixes. Start with the first: Retry with exponential backoff and honor the Retry-After header when present.
Should I retry OpenRouter "429 rate_limit_exceeded"?
Yes. The official docs treat this error as retryable.
Which other AI APIs return HTTP 429?
Per their official error docs: Amazon Bedrock (429 ThrottlingException; 429 ModelNotReadyException), Anthropic API (429 rate_limit_error; 429 rate_limit_error (enforced_spend_limit_reached)), Azure OpenAI (429 Too Many Requests (Rate limit is exceeded); 429 Too Many Requests (System is experiencing high demand); 429 Too Many Requests (temporary rate limit adjustment); 429 Too Many Requests (token budget exceeded by request parameters)), Cohere API (429 Too Many Requests), DeepSeek API (429 - Rate Limit Reached), Gemini API (429 rate_limit_exceeded; 429 quota_exceeded; 429 too_many_requests; 429 RESOURCE_EXHAUSTED), Groq API (429 Too Many Requests), Mistral API (429 Too many requests), OpenAI API (429 credit_balance_exhausted; 429 Rate limit reached for requests; 429 rate_limit_error slow_down; 429 organization_spend_limit_exceeded; 429 project_spend_limit_exceeded; 429 organization_usage_limit_exceeded), Vertex AI (429 RESOURCE_EXHAUSTED; 429 Resource exhausted, please try again later; 429 Too many requests. Exceeded the Provisioned Throughput), xAI API (429 Too Many Requests).
Sources
Last verified against 2 sources: OpenRouter's official docs and official SDK repositories.
Newsletter
Know when the APIs change
One email per week. New model releases, API changes, what broke, and how developers are working around it.