HomeAPIs › OpenRouter

OpenRouter API — pricing, fees & how to get a key

OpenRouter is a single API key for hundreds of models — OpenAI, Anthropic, Google, Meta's Llama, Mistral, DeepSeek and many more — behind one OpenAI-compatible endpoint. You switch models by changing a string, compare prices in one place, and add automatic fallbacks if a provider is down. Here's how its pricing really works and how to get your key.

How OpenRouter pricing works

What you payHow muchNotes
Model token usagepass-throughSame per-token price as the source provider
Markup on usage$0No surcharge on tokens themselves
Credit top-up fee ~5%Charged when you add credits
Free models$0Rate-limited, rotating selection
⚠️ Reference details, June 2026 — OpenRouter adjusts its fee structure and model catalog often. Confirm on openrouter.ai/docs before budgeting. Per-model prices match the upstream provider's live rates.

→ Once you've picked a model, estimate the token bill on the AI API cost calculator — the per-token cost is the same whether you call the model directly or via OpenRouter.

Are there free models?

Yes — OpenRouter exposes a rotating set of free models (typically open-weight models hosted by partners) with rate limits, usable on the same key. They're ideal for prototyping before you commit credits. For dedicated free tiers from individual providers, see Gemini, Mistral and Groq.

How to get an OpenRouter API key (step by step)

1. Sign up at openrouter.ai.
2. Add credits under Settings → Credits (a small fee applies on top-up).
3. Open the Keys page, create a key and copy it once.
4. Call the OpenAI-compatible endpoint and pick a model by slug, e.g. openai/gpt-4o, anthropic/claude-sonnet or a :free model.

Test it with a simple request:

# quick test (replace $OPENROUTER_API_KEY)
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}'

When OpenRouter is worth it

Use it when you want to compare or swap models without rewriting code, add provider fallbacks for reliability, or access a model that's awkward to sign up for directly. The trade-off is the ~5% top-up fee and adding a third party between you and the provider. For a single high-volume model in production, going direct can shave that fee — but for experimentation and multi-model apps, one key across everything usually pays for itself in saved time.

Alternatives

Go direct to a provider to avoid the top-up fee: OpenAI, Anthropic, Gemini, DeepSeek, Mistral or Groq for fast open models. Compare the big three head-to-head on the OpenAI vs Claude vs Gemini pricing page.

FAQ

Does OpenRouter add a markup on tokens?

No — token usage is pass-through at the provider's price. OpenRouter earns from a small fee (~5%) when you top up credits, not from usage.

Are there really free models?

Yes — a rotating, rate-limited selection of free models is available on the same key, good for prototyping.

How do I get an OpenRouter API key?

Sign up at openrouter.ai, add credits, open the Keys page, create a key and copy it. The API is OpenAI-compatible.

Should I use OpenRouter or go direct?

Use OpenRouter for multi-model flexibility and fallbacks; go direct for a single high-volume model to avoid the top-up fee.

Not affiliated with OpenRouter. Prices are reference estimates — always verify on the official pricing page.