Free 4 min read

OpenRouter Not Working?

OpenRouter API 401, model routing error, credits exhausted (402), provider error surfaced through routing, or streaming failing? Check live status and fix it fast.

OpenRouter live status

OpenRouter — live status

Updated every 5 minutes. Full history at prismix.dev/service/openrouter.

Full status →

OpenRouter routes to multiple providers

If a specific provider (Anthropic, OpenAI, etc.) is degraded, only their models are affected. Other providers' models continue to work. Check which provider the failing model uses at openrouter.ai/models.

What's wrong? Diagnose fast

🔑

API 401 — invalid key

OpenRouter keys start with sk-or-. Generate at openrouter.ai/keys. Header: Authorization: Bearer sk-or-YOUR_KEY. Optional recommended headers: HTTP-Referer (your site) and X-Title (your app name) for usage tracking.

🔍

Model not found (404)

Use provider/model-name format: openai/gpt-4o, anthropic/claude-3-5-sonnet, meta-llama/llama-3.3-70b-instruct. Browse exact IDs at openrouter.ai/models. Add :free for free-only routing. Add :nitro for fastest provider routing.

💸

Credits exhausted (402)

Check balance at openrouter.ai/credits. Free: $1 initial one-time credit. Add more at openrouter.ai/credits (Stripe or crypto). Each call costs model price + 5% OpenRouter fee. Request log: openrouter.ai/activity.

Provider error in response

Check error.metadata.provider_name (which provider failed) and error.metadata.raw (original error). Provider 529 = overloaded. Fix: add route=fallback parameter to try other providers, or use :nitro model suffix. Switch to a different model from another provider.

📡

Streaming fails / cuts off

Stream: true works the same as OpenAI. If stream cuts off: some proxies buffer SSE. Test with direct cURL. For long-running streams, some providers have different timeout limits than the default. Use transforms=[] to disable OpenRouter post-processing on the stream.

📊

Wrong model was used

OpenRouter may route to a different variant than expected. Check x-openrouter-model response header to see the actual model used. Add provider preference: route=lowest-cost or route=nitro. Specify providers[] array to restrict routing to specific providers.

OpenRouter API quick reference

curl (OpenAI-compatible)

curl -X POST "https://openrouter.ai/api/v1/chat/completions" \
  -H "Authorization: Bearer sk-or-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "HTTP-Referer: https://your-site.com" \
  -H "X-Title: Your App Name" \
  -d '{
    "model": "anthropic/claude-3-5-sonnet",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
# Check x-openrouter-model header in response for actual model used

Python (OpenAI SDK drop-in)

from openai import OpenAI

client = OpenAI(
    api_key="sk-or-YOUR_KEY",
    base_url="https://openrouter.ai/api/v1",
    default_headers={
        "HTTP-Referer": "https://your-site.com",
        "X-Title": "Your App Name",
    },
)

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
)

Provider routing with fallback

{
  "model": "meta-llama/llama-3.3-70b-instruct",
  "messages": [...],
  "route": "fallback",        // try other providers if primary is down
  "providers": {
    "order": ["Together", "Fireworks"],  // prefer these providers
    "allow_fallbacks": true
  }
}

OpenRouter model suffixes

Suffix Example Effect
(none) openai/gpt-4o Default routing — lowest latency available
:free meta-llama/llama-3.3-70b-instruct:free Only route to free providers — $0 cost
:nitro openai/gpt-4o:nitro Fastest provider routing (may cost more)
:floor anthropic/claude-3-5-sonnet:floor Cheapest provider routing
:online openai/gpt-4o:online Adds live web search to response

Step-by-step fix

  1. 1

    Check live OpenRouter status

    Visit prismix.dev/service/openrouter. Remember: only the specific provider's models are affected when a provider (not OpenRouter itself) is degraded.

  2. 2

    Fix API 401 errors

    Your key must start with sk-or-. Generate at openrouter.ai/keys. Header: Authorization: Bearer sk-or-YOUR_KEY. OpenAI SDK: set base_url="https://openrouter.ai/api/v1". Add HTTP-Referer and X-Title headers for proper usage tracking in your dashboard.

  3. 3

    Fix model not found

    Use the exact provider/model-name format from openrouter.ai/models. Common models: openai/gpt-4o, anthropic/claude-3-5-sonnet, meta-llama/llama-3.3-70b-instruct. For free usage: append :free suffix.

  4. 4

    Fix credits exhausted (402)

    Check your balance at openrouter.ai/credits. Each call costs the model's base price plus OpenRouter's 5% fee. Add credits via Stripe or crypto. View your request history and costs at openrouter.ai/activity. To use completely free models: use the :free model suffix.

  5. 5

    Fix provider-specific errors

    Provider errors are surfaced in the response: error.metadata.provider_name shows which provider failed, error.metadata.raw shows the raw error. Fix: add "route": "fallback" to your request body to automatically try alternative providers.

🔔

Get alerted when OpenRouter goes down

Star OpenRouter on Prismix and get emailed the moment status changes. Free, no credit card.

Frequently asked questions

Why is OpenRouter not working?

OpenRouter issues: (1) 401 (key must start sk-or-, generate at openrouter.ai/keys); (2) model 404 (use provider/model-name format from openrouter.ai/models); (3) credits 402 (check openrouter.ai/credits, add via Stripe/crypto); (4) provider error surfaced through routing (check error.metadata.provider_name, add "route": "fallback"); (5) outage (check prismix.dev/service/openrouter).

Is OpenRouter down right now?

Check prismix.dev/service/openrouter for live status. If a specific provider (Anthropic, OpenAI, etc.) is down, only that provider's models are affected — other models still work. OpenRouter's own infrastructure going down is less common.

OpenRouter API 401 — how to fix?

OpenRouter keys start with sk-or-. Generate at openrouter.ai/keys. Header: Authorization: Bearer sk-or-YOUR_KEY. OpenAI SDK: api_key="sk-or-YOUR_KEY", base_url="https://openrouter.ai/api/v1". Optional: add HTTP-Referer and X-Title headers for usage tracking in your OpenRouter dashboard.

What are OpenRouter free models?

OpenRouter has many free models with the :free suffix: meta-llama/llama-3.3-70b-instruct:free, mistralai/mistral-7b-instruct:free, google/gemma-2-9b-it:free. Free models have rate limits (20 requests/min). Browse all free models at openrouter.ai/models (filter by "Free"). The $1 initial credit lets you test paid models too.

OpenRouter vs direct provider API — when to use which?

Use OpenRouter when you want: (1) single API key for GPT-4, Claude, LLaMA, and Gemini; (2) automatic failover when a provider is down (route: fallback); (3) cost comparison across providers; (4) free tier models via :free suffix. Use direct provider API when: (1) you need provider-specific features not in OpenRouter; (2) latency is critical (OpenRouter adds 20-50ms); (3) you want full rate limits without the routing overhead.

Related AI inference APIs