Free LLM API errors · OpenRouter · checked 2026-11-13
OpenRouter 429 free-models-per-min: the fix
HTTP 429 · Rate limit exceeded: free-models-per-minYou sent more than 20 requests in a minute to :free models. Unlike the daily limit, this one clears on its own within the minute.
Our own router has received this error from OpenRouter in production.
Why it happens
- Free models allow 20 requests per minute, whether or not you have bought credits.
- Parallel calls (batch jobs, agents running tools in parallel) hit it first.
How to fix it
- Retry after a pause. On a 429, OpenRouter may send a Retry-After header with the seconds to wait; free-model errors also carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.
- Without Retry-After, back off exponentially with a little random jitter and a maximum number of tries.
- Cap your own concurrency so you stay under 20 a minute instead of finding the limit by error.
Retry a 429 with Retry-After and backoff (Python, OpenAI SDK)
import random, time
from openai import OpenAI, RateLimitError
client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key="sk-or-...")
def chat(messages, model="<model-id>:free", tries=5):
for attempt in range(tries):
try:
return client.chat.completions.create(model=model, messages=messages)
except RateLimitError as e:
wait = e.response.headers.get("retry-after")
delay = float(wait) if wait else min(60, 2 ** attempt) + random.random()
time.sleep(delay)
raise RuntimeError("still rate limited after retries")Questions
- Does buying OpenRouter credits raise the free per-minute limit?
- No. Credits raise the daily free limit (50 to 1,000); free models stay at 20 requests per minute.
- How long should I wait after free-models-per-min?
- Use the Retry-After header if it is there. If not, start at a second or two and double on each retry; the limit is per minute.
Sources
Read on 2026-11-13. Providers change limits and messages often; the linked pages are what applies.
Limits and fine print of OpenRouter's free tier: OpenRouter free API. Tired of handling these by hand? ZeroLimitAI is one OpenAI-compatible endpoint that moves to the next free model when one of these comes back, and can run on your own Groq or OpenRouter key.