Key points
- Read the HTTP status first: 401, 402, 404, 429 and 5xx each point to a different cause.
- Free variants share capacity and carry tighter limits, so they fail first under load.
- Retries with backoff fix short outages, not daily quotas.
- For steady work, a paid pay-as-you-go endpoint costs less than the time lost to flaky tests.
Start with the status code
When you see openrouter free models not working in your own logs, the HTTP status tells you more than the error message. Print the status and body of the failed response before you change anything. Many client libraries hide it behind a generic exception, so turn on response logging or catch the error object and read its fields.
| Status | Usual meaning | First thing to try |
|---|---|---|
| 401 | Key missing, mistyped or revoked | Print the first 6 characters of the key your code actually sends |
| 402 | Not enough credit for the request | Check the balance in the dashboard |
| 404 | Model name not found | Copy the identifier from the model page again |
| 429 | Rate limit or temporary capacity limit | Slow down, add backoff, read the Retry-After header |
| 500 to 504 | Upstream provider failed or timed out | Retry later or switch the model |
The meanings above are the common conventions for OpenAI-style APIs. A given router can use its own wording, so compare with its error documentation when the text of the body says something different.
Also note whether the failure is constant or intermittent. A constant failure on every call usually means configuration: a wrong key, a wrong URL or a model name that no longer exists. An intermittent failure, where some calls pass and others do not, points to limits and upstream load. That single observation cuts the list of suspects roughly in half, and it costs nothing, because you only have to look at a hundred lines of your own log output.
Why free variants fail more often
Free variants are offered so you can test a model without paying. To keep that sustainable, they usually come with tighter request limits and sometimes a daily cap, and they draw on capacity that many other users share. Under load, a free variant is the first one to answer with a 429 or a timeout. A paid variant of the same model often keeps working at the same moment.
That has a practical effect on how you build. A test that passes at 10 in the morning and fails at 3 in the afternoon is not necessarily a bug in your code. It can be the shared pool. Check the router's documentation for the exact current limits instead of relying on numbers quoted in forum posts, since those change.
Signs that you hit a cap, not an outage
- The error repeats on every call after a certain number of requests, then clears at a predictable time.
- Other models on the same key still work.
- The response carries a retry hint or a message naming a limit.
If those match, backoff will not help, because the cap is per period. Reduce the number of calls, cache answers, or move that workload elsewhere.
Check the model name and the key
A surprising share of failures are plain naming problems. Model identifiers on a router include a vendor prefix and sometimes a suffix that marks the variant. If a model is retired or renamed, the old name returns a not-found error even though your code did not change. Open the model's page, copy the identifier and paste it into a one-line test.
curl -s -o /dev/null -w "%{http_code}\n" \
https://api.openrouteruncensored.top/v1/models \
-H "Authorization: Bearer $API_KEY"
That command prints only the status code of the models list. A 200 means the key works and the base URL is right. A 401 means the key is wrong. Run the same check against whichever endpoint you are debugging by changing the URL, and you separate key problems from model problems in a few seconds.
Also check that the environment variable holding your key is the one your process really sees. Containers, IDE run configurations and cron jobs often start with a different environment than your shell.
A retry pattern that handles short outages
For 429 and 5xx responses that clear within seconds, retry with exponential backoff and random jitter. Respect a Retry-After header when it is present. Stop after a small number of attempts, so one broken request cannot hold a worker forever.
import os, random, time
from openai import OpenAI, RateLimitError, APIStatusError
client = OpenAI(
base_url="https://api.openrouteruncensored.top/v1",
api_key=os.environ["API_KEY"],
)
def ask(prompt, attempts=5):
delay = 1.0
for n in range(attempts):
try:
r = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": prompt}],
)
return r.choices[0].message.content
except RateLimitError as e:
wait = float(e.response.headers.get("Retry-After", delay))
except APIStatusError as e:
if e.status_code < 500:
raise
wait = delay
time.sleep(wait + random.uniform(0, 0.5))
delay = min(delay * 2, 30)
raise RuntimeError("gave up after retries")
Notice that client errors other than 429 are raised at once. Retrying a 401 or a 404 only wastes time. The pattern works on any OpenAI-compatible endpoint, so you can keep it when you change providers.
A five-minute checklist
When the cause is still unclear, go through the same short list every time. It removes guesses and gives you something concrete to attach to a support message.
- Run the models-list call above and note the status.
- Send one tiny request with
max_tokensset to 5, so that size is not a factor. - Try a second model on the same key. If it works, the issue is tied to the first model.
- Wait two minutes and try again. If it now works, you were hitting a short capacity limit.
- Check the balance and the usage page for a cap reached earlier in the day.
- Save the request ID, status and body of the failing call.
Run the steps in this order. The early ones are cheap and rule out the largest groups of causes, so you rarely need the last ones. If you reach step six, you have a clean report for the service owner, and a report with a request ID gets an answer faster than a screenshot of an error toast.
Deciding whether to stay on free models
Free models are fine for a prototype, a classroom demo or a weekend experiment. They are a poor base for anything with users, a schedule or a deadline, because you cannot plan around limits that you do not control. The cost of debugging flaky behaviour also adds up. An hour of an engineer's time is worth more than a large amount of paid tokens.
If your use case needs a model that answers without content refusals for lawful adult use, such as fiction tools, roleplay or companion apps for adults, free tiers on routers are often a mismatch for another reason: the available models differ in how they are tuned, and you do not choose the provider behind a name. Our endpoint serves one open-weight model of that kind, run by an independent provider. It is not the official API of any vendor and not a router.
The pricing is plain pay as you go. Input costs $0.15 per 1M tokens and output $0.50 per 1M. Take a batch of 200 requests, each with 1,000 input and 500 output tokens. Input is 200,000 tokens, which costs $0.03. Output is 100,000 tokens, which costs $0.05. The whole batch is $0.08. Failed or refused requests are not charged. See the pricing page for top-ups, which start at $20.
Moving a failing job to a direct endpoint
You can test this without paying anything. After sign-up, the API key page offers a one-click trial of $0.50, valid for 7 days, with no card needed and one per person. Trial keys allow 2 concurrent requests and 60 requests per minute, which is enough to rerun a failing test. At 1,000 input and 500 output tokens per request, one call costs $0.0004, so $0.50 covers about 1,250 calls.
Create a key on the API key page, set the base URL to https://api.openrouteruncensored.top/v1, use the model ID uncensored and rerun the failing script. If it passes, your code is fine and the limit was upstream. The docs list the supported parameters, including streaming, tool calling and JSON mode.
A full key allows 8 concurrent requests and 300 requests per minute. If you exceed them you get HTTP 429 with the code rate_limited or concurrency, so you can tell which limit applied.
