Skip to content
trending

Guides

OpenRouter Guide: One API Key for 460+ AI Models

OpenRouter gives you one API key and balance for 460+ AI models from OpenAI, Anthropic, Google, DeepSeek and more. 5.5% fee, 17 free models, same token prices.

By 10 min read
OpenRouter Guide: One API Key for 460+ AI Models

👁 124 reads

OpenRouter is an intermediary that gives you one API key and one balance for over 460 AI models: OpenAI, Anthropic, Google, DeepSeek, Mistral, Kimi and dozens of open models. Model prices are the same as at the providers, and OpenRouter earns a 5.5% commission on top-ups. You write code using the OpenAI library, changing only the address. We tested all the scripts from our AI API from scratch course on OpenRouter, so below we describe it from practice: how to start, how much it costs, which models are free, what about privacy and how to control provider selection.

Status as of October 4, 2026

  • Models: 466 in the API catalog, including 17 free (with :free suffix).
  • Fees: model prices without markup, 5.5% commission on card top-ups (minimum $0.80), 5% on crypto.
  • Free models: 20 requests per minute, 50 daily; after purchasing at least $10 in credits, 1000 daily.
  • Owner: since August 2026, Stripe (transaction over $7 billion, we covered it here).

What OpenRouter Is and How It Works

OpenRouter doesn’t train or run models itself. It accepts your request in OpenAI format (Chat Completions), checks which providers support the chosen model, and forwards the request to one of them. For closed models there’s usually one provider (Claude is handled by Anthropic, plus Google Vertex and Amazon Bedrock), for open models there can be dozens. On October 4, the gpt-oss-120b model was hosted by 23 providers, and GLM-5.3 by as many as 41.

What you get:

  • One key and one balance instead of five accounts with separate cards, limits and invoices.
  • Change model with one string: openai/gpt-6.1-sol to anthropic/claude-sonnet-5.5 without changing code.
  • Automatic failover when a provider has an outage.
  • Cost in every response: usage.cost field in dollars, which makes tracking very easy.

What you don’t get: a direct contract with OpenAI or Anthropic, some provider-specific features (e.g. some server tools), and the highest limits you get after years of paying at the source.

How to Start: Account, Key, Limit

  1. Log in to openrouter.ai with a Google, GitHub or email account.
  2. In Settings → Keys, create a key (sk-or-v1-...) and immediately set a Credit limit, e.g. $2 with monthly renewal. The limit can renew daily, weekly or monthly.
  3. If you want paid models, top up your account in Settings → Credits. At $10 you’ll pay $10.80 (5.5% is $0.55, but a minimum of $0.80 applies), at $20 - $21.10.
  4. Save the key in a .env file (instructions in the article API Key: how to get it and how not to burn it).
  5. Run your first script.
"""First request to an AI model through OpenRouter (openai SDK)."""
import os
from dotenv import load_dotenv
from openai import OpenAI

load_dotenv()  # loads variables from .env file in current directory

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key=os.environ["OPENROUTER_API_KEY"],
)

response = client.chat.completions.create(
    model=os.getenv("MODEL", "openai/gpt-6-luna"),
    messages=[
        {"role": "system", "content": "You answer in Polish, briefly and concretely."},
        {"role": "user", "content": "Explain in two sentences what an API is."},
    ],
)

print(response.choices[0].message.content)
print("---")
print("model:", response.model)
print("input tokens:", response.usage.prompt_tokens)
print("output tokens:", response.usage.completion_tokens)
details = response.usage.completion_tokens_details
if details and details.reasoning_tokens:
    print("  including reasoning tokens:", details.reasoning_tokens)
cost = getattr(response.usage, "cost", None)  # OpenRouter adds cost in USD
if cost is not None:
    print(f"cost: {cost:.6f} USD")
API to zestaw reguł i narzędzi, dzięki którym różne programy mogą się ze sobą komunikować. Określa, jak wysyłać żądania i odbierać dane lub funkcje od innego systemu.
---
model: openai/gpt-6-luna
input tokens: 40
output tokens: 58
cost: 0.000033 USD

A full code walkthrough, streaming and error handling is in the article First request to AI API in Python, and the curl version in What is an API. Note: we tested this in Polish.

Prices and Fees

Item Amount Notes
Model prices same as provider, no markup for open models each provider has its own rate
Card top-up (Stripe) 5.5%, minimum $0.80 non-refundable commission
Crypto top-up 5% non-refundable
Bring your own keys (BYOK) no fee up to monthly threshold, then 5% of model price FAQ from Oct 4 states $25,000 monthly threshold
Refund of unused credits only within 24 hours of purchase no commission
Credit validity may expire after one year per terms of service
Discount for data collection consent 1% disabled by default

Rates for popular models and a monthly cost calculator can be found in the article AI Tokens: what they are and how much they cost. Watch out for one trap: for open models, the model card shows one price, but the request may go to a provider charging several times more. We checked this on 15 models in the article The price on OpenRouter is not the price you pay.

Our Test: Same Model, Four Providers

To show how provider selection works, we sent the same question to the gpt-oss-120b model four times, each time with a different provider field setting:

"""OpenRouter: same model at different providers. Who handled the request, how long it took and how much it cost."""
import os, time
from dotenv import load_dotenv
from openai import OpenAI

load_dotenv()
client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=os.environ["OPENROUTER_API_KEY"])
MODEL = "openai/gpt-oss-120b"   # open model, on Oct 4, 2026 hosted by 23 providers
QUESTION = [{"role": "user", "content": "Write 3 sentences in Polish about what OpenRouter is."}]

variants = {
    "default": {},
    "cheapest (sort=price)": {"provider": {"sort": "price"}},
    "fastest (sort=throughput)": {"provider": {"sort": "throughput"}},
    "no data storage (data_collection=deny, zdr)": {"provider": {"data_collection": "deny", "zdr": True}},
}

for name, extra in variants.items():
    start = time.time()
    r = client.chat.completions.create(model=MODEL, messages=QUESTION, max_tokens=200, extra_body=extra)
    elapsed = time.time() - start
    provider = getattr(r, "provider", "?")  # OpenRouter adds provider name to response
    print(f"{name:46} provider: {provider:12} {elapsed:4.1f} s  "
          f"{r.usage.completion_tokens:3} tokens  {r.usage.cost:.6f} USD")
default                                        provider: SambaNova     1.0 s  178 tokens  0.000181 USD
cheapest (sort=price)                          provider: CoreWeave     6.2 s  175 tokens  0.000032 USD
fastest (sort=throughput)                      provider: Cerebras      0.4 s  200 tokens  0.000180 USD
no data storage (data_collection=deny, zdr)    provider: Crusoe        0.8 s  152 tokens  0.000042 USD

Results from October 4:

  • Default went to SambaNova: fast (1.0 s), but at $0.000181.
  • Sorting by price chose CoreWeave: 5.6 times cheaper, but the response took 6.2 s.
  • Sorting by throughput chose Cerebras: 0.4 s, same price as default.
  • No data storage (providers that don’t store requests) went to Crusoe: 0.8 s and only 30% more expensive than the cheapest variant.

For a single request, these are fractions of a cent. For an automation sending 10,000 requests daily, the difference between the default variant and sorting by price is tens of dollars monthly. That’s why in production code I always set the provider field consciously. Shortcuts also work in the model name: :floor sorts by price, :nitro by speed (e.g. openai/gpt-oss-120b:nitro).

Free Models

Models with the :free suffix cost $0 and don’t require a top-up. You can fetch the list without a key, and our script immediately tests one of them:

"""List of free models on OpenRouter (model list doesn't require a key) and test of one of them."""
import os, sys, json, urllib.request
from dotenv import load_dotenv
from openai import OpenAI

with urllib.request.urlopen("https://openrouter.ai/api/v1/models") as f:
    models = json.load(f)["data"]

free = [m for m in models if m["id"].endswith(":free")]
print(f"Total models: {len(models)}, free: {len(free)}n")
for m in sorted(free, key=lambda m: -m["context_length"]):
    print(f"{m['id']:52} context {m['context_length']:>9}")

load_dotenv()
client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=os.environ["OPENROUTER_API_KEY"])
model = sys.argv[1] if len(sys.argv) > 1 else "google/gemma-4-31b-it:free"
r = client.chat.completions.create(model=model, messages=[{"role": "user", "content": "Write one sentence in Polish about autumn."}])
print(f"n{model}: {r.choices[0].message.content.strip()}")
print(f"cost: {r.usage.cost} USD")
Total models: 466, free: 17

thinkingmachines/inkling-small:free                  context   1048576
thinkingmachines/inkling:free                        context   1048576
nvidia/nemotron-3.5-lightning:free                   context   1000000
nvidia/nemotron-3-ultra-550b-a55b:free               context   1000000
dots-studio/dots-3-note-preview:free                 context    512000
apodex/apodex-1.1-mini:free                          context    262144
inclusionai/ling-3.0-flash-sante:free                context    262144
qwen/qwen3.8-27b:free                                context    262144
poolside/laguna-s-2.1:free                           context    262144
poolside/laguna-xs-2.1:free                          context    262144
google/gemma-4-26b-a4b-it:free                       context    262144
google/gemma-4-31b-it:free                           context    262144
nvidia/nemotron-3-super-120b-a12b:free               context    262144
cohere/north-mini-code:free                          context    256000
nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free   context    256000
nvidia/nemotron-3.5-content-safety:free              context    128000
liquid/lfm-2.5-2.6b:free                             context     65536

google/gemma-4-31b-it:free: Jesień to czas, kiedy liście mienią się złotem i czerwienią, a powietrze staje się rześkie i chłodne.
cost: 0 USD

Limitations of free models:

  • Limits: 20 requests per minute and 50 daily combined for all free models; after purchasing at least $10 in credits (ever), 1000 daily.
  • Availability: free variants can be overloaded (error 429) and disappear from the catalog without notice. The list from October 4 may not be current in a month.
  • Privacy: some free endpoints only work after enabling consent to train on your data in privacy settings. We don’t use free models for client data.
  • Polish: Gemma 4 31B responded with correct Polish, but smaller free models (e.g. 2.6B) handle Polish poorly.

Privacy and Data

According to the FAQ, OpenRouter by default doesn’t store request or response content, even on errors, and only stores metadata (time, model, token count). However, the content goes to the model provider and their policies determine what happens to it. You have three tools:

  1. Account privacy settings - whether you allow providers that may train on data.
  2. "data_collection": "deny" in the provider field - only providers that don’t store data.
  3. "zdr": true - only endpoints with zero data retention (ZDR).

For personal and business data you still need a data processing agreement. OpenRouter is an additional entity in the chain, so for GDPR check whether its terms are sufficient for you, or go directly to the provider.

Useful Features in Code

Fallback model list: when the first doesn’t respond, OpenRouter automatically tries the next. We verified the syntax (the request went through and was handled by the first model in the list), but didn’t simulate an outage:

r = client.chat.completions.create(
    model="anthropic/claude-haiku-4.5",
    messages=[{"role": "user", "content": "Say OK."}],
    extra_body={"models": ["anthropic/claude-haiku-4.5", "openai/gpt-6-luna", "google/gemini-3.8-flash"]},
)
print(r.model)  # which model actually responded

Other fields we use:

  • "provider": {"require_parameters": true} - only providers that support all request parameters. Without this, OpenRouter silently ignores unsupported ones, e.g. temperature in GPT-6 (we checked in the article on API parameters).
  • "provider": {"order": ["Cerebras"], "allow_fallbacks": false} - only the specified provider.
  • "provider": {"max_price": {"completion": 1.0}} - upper limit on the rate per million output tokens.
  • Tilde aliases, e.g. ~anthropic/claude-sonnet-latest or ~openai/gpt-sol-latest - always the newest version from the family. Convenient, but in production I prefer a fixed name so the model doesn’t change without my knowledge.

OpenRouter vs. Direct Provider

OpenRouter Direct (OpenAI, Anthropic, Google)
Number of models 466 on one key only that company’s models
Token price same same
Additional cost 5.5% on top-up none
Free start 17 free models, 50 requests daily Google: free Gemini tier; Anthropic: small starting credits; OpenAI: none
Request limits high, balance-dependent grow with payment history
New provider features sometimes delayed from day one
Contract and invoice with OpenRouter with provider

Our rule: OpenRouter for learning, prototypes and comparing models; direct with the provider when production depends on one model and every percent of cost matters, or when you need a contract. An alternative with subscription instead of tokens is Poe, and locally, with no token fees at all, Ollama.

Frequently Asked Questions

Is OpenRouter free?

The account and key are free, and 17 models with the :free suffix too (50 requests daily). For other models you pay from your topped-up balance, plus a 5.5% commission on top-ups.

Is OpenRouter safe?

It’s a large, legitimate company (since August 2026 part of Stripe) and according to the FAQ doesn’t store request content by default. The risk lies more with the model providers who receive the content, and in your key leaking. Set a limit on your key and choose providers without data retention.

Is OpenRouter more expensive than OpenAI API?

Token prices are the same. You pay an additional 5.5% on top-ups, so at $100 about $5.50.

How do I check my balance via API?

A GET request to https://openrouter.ai/api/v1/key with the key in the header returns usage and limit for that key, and /api/v1/credits returns the whole account status.

Can I pay in my local currency?

No, billing is in dollars. Your card will convert the amount at your bank’s exchange rate.

What does error 402 mean in OpenRouter?

Insufficient funds in the account or the key’s limit exhausted. Top up your balance or raise the Credit limit in key settings.

Google · Your sourcesQuantslant higher in your Google - one clickAdd to preferred sources →

Sources and Verification Date

Verified and tested on October 4, 2026 on Windows 11, Python 3.13.15, openai 3.24.0. Cost of tests from this article: below $0.001.

Kinetyra

// read next

More on this from QUANTSLANT

Piotr Olszewski

Editor and publisher · Quantslant

I edit and publish Quantslant. AI tools help with research, drafts and translation; choosing topics, running the tests, checking facts and the decision to publish are mine, and so is the responsibility for what appears here.

read nextAI API Parameters Explained: Temperature, System Prompt & TokensguidesAI API Parameters Explained: Temperature, System Prompt & TokensSystem prompt sets the rules, temperature controls randomness, context window limits what the model sees, and max tokens caps response length. Real tests included.

Most read

  1. 1Best AI Video Generator Apps for Your Phone (2026)
  2. 2Claude Opus 5.5 Motion Graphics: 60s Showreel from One Prompt
  3. 3Wan 2.2 on RTX 4090: timings, VRAM and four test clips
// site map

This page in other languages1

Quantslant in numbers 1,427posts in archive26news from the last 7 days18video models in the observatory
🎬 AI Video Benchmarks: Higgsfield DoP vs OpenAI Sora • Higgsfield vs Runway Gen-3 • AI Video Credit Calculator
× ‹ enlarge ›