Skip to main content
Watch: I Built an AI App Without Leaving Databricks

OpenRouter error

OpenRouter 429 rate_limit_exceeded: what it means and how to fix it

Error message
429 rate_limit_exceeded

Retry? 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

  1. Fix 1.

    Retry with exponential backoff and honor the Retry-After header when present.

    Snippet
    const 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
      }
    }
  2. Fix 2.

    On free variants, purchase at least 10 credits to raise the daily limit, or switch to the paid variant of the model.

  3. 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 errors

HTTP 429 at other providers

Compare 429 across providers

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.