EN ▾
Get API key

OpenRouter Rate Limit Exceeded: What It Means and Fixes

A 429 response means a limit was hit, but not which one. This article separates the kinds of limit, shows how to read the signals and gives a client pattern that keeps throughput steady.

Updated

A funnel feeding cubes into eight lanes with a neat waiting queue, showing request throttling

Key points

  • A 429 can come from requests per minute, concurrency, a daily cap or upstream load.
  • Headers and the error code tell you which limit applied; log them.
  • Cap concurrency on your side with a semaphore and add jittered backoff.
  • Throughput equals concurrency divided by request duration, so long requests lower it.

What the error says and what it hides

The message openrouter rate limit exceeded tells you that the service refused a request because of a limit. It does not tell you which limit, and that matters because each one has a different fix. Treat the HTTP 429 status as a category, then use the body, the headers and your own counters to narrow it down.

The same status code is used for several situations that look identical in a log line:

  • You sent more requests in a minute than your key allows.
  • You had too many requests in flight at the same time.
  • A free or low-credit tier reached a daily or periodic cap.
  • The provider behind the model is under heavy load and is shedding traffic.

The first two are yours to control. The last two you can only work around. For the exact current limits on OpenRouter, read its documentation, because they depend on the model and on your account state and they change over time.

Requests per minute versus concurrency

These two limits are often confused. A requests-per-minute limit counts how many calls you start in a window. A concurrency limit counts how many are running at the same moment. You can break one without breaking the other.

A burst of 50 quick calls started within a second can exceed a per-minute limit while staying far below any plausible daily total. A single script that opens 20 long streaming responses at once can exceed a concurrency limit while sending only 20 requests in the minute. Long outputs make the second case more likely, because each response holds its slot until it finishes.

A simple throughput formula

Throughput in requests per minute is roughly concurrency times 60, divided by the average seconds per request. Suppose requests take 10 seconds each and you may run 8 at once. Then 8 times 60 divided by 10 gives 48 requests per minute. The ceiling here is concurrency, not the per-minute limit. If you shorten requests by lowering max_tokens or trimming prompts, you raise throughput without asking for more capacity. The 10 seconds is an assumption for the arithmetic, not a measured figure.

Reading the signals in a response

Always capture three things when a request is refused: the status, the error body and the headers. Look for a retry hint, usually a Retry-After header, and for any fields that name the limit. Keep a request ID too, so you can quote it if you contact support.

curl -i https://api.openrouteruncensored.top/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","messages":[{"role":"user","content":"ping"}],"max_tokens":5}'

The -i flag prints the headers with the body. On our endpoint the headers include X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency. When a limit is hit, the body carries the error code rate_limited for requests per minute or concurrency for too many at once. A temporary overload also returns 429 with Retry-After: 5. Because the codes differ, your client can pick the right response: slow the start rate for the first, reduce parallel workers for the second, and wait the stated time for the third.

Build a client that stays under the limit

Backoff alone is a reaction. A better design prevents most 429s by limiting concurrency before a request leaves your process. In Python with asyncio, a semaphore is enough for the concurrency side, and a small delay between starts handles the per-minute side.

import asyncio, os, random
from openai import AsyncOpenAI, RateLimitError

client = AsyncOpenAI(
    base_url="https://api.openrouteruncensored.top/v1",
    api_key=os.environ["API_KEY"],
)
gate = asyncio.Semaphore(6)   # stay under the limit of 8

async def one(prompt):
    async with gate:
        for attempt in range(5):
            try:
                r = await client.chat.completions.create(
                    model="uncensored",
                    messages=[{"role": "user", "content": prompt}],
                    max_tokens=300,
                )
                return r.choices[0].message.content
            except RateLimitError as e:
                hint = e.response.headers.get("Retry-After")
                wait = float(hint) if hint else 2 ** attempt
                await asyncio.sleep(wait + random.random())
        return None

async def main(prompts):
    return await asyncio.gather(*(one(p) for p in prompts))

The semaphore is set to 6, below the limit of 8, to leave room for a second process or a manual test. The sleep inside the semaphore block is deliberate: a worker that is waiting out a 429 should not let a new request start in its place, since that would recreate the pressure.

For streaming, remember that the slot is held until the stream ends. A client that stops reading but never closes the response keeps its slot busy. Close streams in a finally block.

Queues for batch jobs

For batch work, such as classifying a few thousand records or generating drafts overnight, a queue gives you more control than a burst of parallel calls. Put the jobs in a list, start a fixed number of workers and let each worker take the next item when it finishes. The worker count is your concurrency limit, and it stays constant no matter how many items you have.

Record the result of each item as soon as it arrives, in a file or a database row, and mark failures with the status code. When a run stops halfway, you can resume from the first item without a result instead of paying for the whole batch again. Because failed requests are not charged on our endpoint, resuming costs only the items that remain.

Two settings help batches in particular. A fixed seed makes reruns of the same prompt easier to compare, since the parameter is passed through. And max_tokens keeps one runaway answer from holding a slot for minutes. Choose a value a little above the longest answer you expect, then check the finish reason in the response to see whether any answer was cut off.

Limits on our endpoint, with a worked example

Here are the limits you can plan around on our service. A full key allows 8 concurrent requests and 300 requests per minute, which is 5 per second on average. A trial key allows 2 concurrent requests and 60 requests per minute. The maximum request body is 8 MB. The context window is 100,000 tokens, shared between prompt and completion.

Take a job of 2,000 requests, each with 1,500 input tokens and 500 output tokens. Input totals 3,000,000 tokens, which at $0.15 per 1M costs $0.45. Output totals 1,000,000 tokens, which at $0.50 per 1M costs $0.50. The job costs $0.95. At the 300 requests per minute ceiling, 2,000 requests need at least 7 minutes of start time, since 2,000 divided by 300 is 6.67. Whether you actually reach that rate depends on concurrency: if each call takes 10 seconds, 8 slots give 48 per minute and the job takes about 42 minutes. That is the case where raising speed means shortening outputs, not asking for a higher limit.

Requests that fail or are refused are not charged, so retries after a 429 do not add to the bill. Credit never expires, and top-ups are any whole amount from $20 to $500 with bonuses of 5% from $50, 10% from $100 and 15% from $200. Details are on the pricing page, and parameters are in the docs.

When to change plan, model or provider

If you meet limits only during bursts, add a queue and smooth the load. If you meet them all day, you need either shorter requests, fewer requests through caching, or more capacity from somewhere. Do a quick count before you decide: average requests per minute, average duration and the share of calls that end in 429.

A router adds one more factor, which is the state of the upstream providers. Your own limits may be fine while a provider is saturated. In that case switching the model name or provider preference may help, and a direct endpoint with its own pool is another option. Ours serves a single open-weight model tuned to answer without content refusals for lawful adult use, from an independent provider, text only, and with a hard rule against sexual content involving minors.

To test your own client against it, claim the one-click $0.50 trial on the API key page. It is valid for 7 days, needs no card, and works with the 2 concurrent and 60 per minute trial limits, which is a good way to confirm your backoff code behaves before you scale up.

Questions and answers

What does HTTP 429 mean?

It means you sent too many requests or hit another limit. The error body and headers show which one, and a Retry-After header says how long to wait.

How is a concurrency limit different from a per-minute limit?

A per-minute limit counts requests started in a window. A concurrency limit counts requests running at the same time, so long or streamed responses hit it sooner.

Should I just retry immediately?

No. Immediate retries add load and usually fail again. Wait for the Retry-After value or use exponential backoff with random jitter.

Do retries cost me tokens on your endpoint?

Requests that return 429 or other failures are not charged, so retrying them does not add cost.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key