Run Any OpenRouter Model in Any Coding Agent in 60 Seconds
OpenRouter's 60-second walkthrough: plugging any model into a coding agent. Source: OpenRouter (YouTube)
OpenRouter in 30 Seconds
  • What it is: one API key and one endpoint for 400+ models, including Claude, GPT, Gemini, DeepSeek and Kimi.
  • Is it free? Partly. Models ending in :free cost $0. You get 50 requests a day with no credits, or 1,000 a day once you have bought at least $10, both capped at 20 per minute.
  • No markup on paid models. You pay the provider’s list price. OpenRouter makes its money from a 5.5% fee when you buy credits.
  • Works with Claude Code. Point ANTHROPIC_BASE_URL at https://openrouter.ai/api and you are done.

Most people land on OpenRouter for one of two reasons: they want free model access for a side project, or they want Claude Code without an Anthropic subscription. This guide covers both, with the current free model list, the limits that actually apply, and the fine print on fees 🔀

How OpenRouter Works

OpenRouter sits between your code and the model providers. Instead of separate accounts, bills and rate limits at Anthropic, OpenAI and Google, you keep one balance and switch models by changing a single string.

OpenRouter diagram: Claude Code, Cursor or your own code connect to one OpenRouter endpoint, which forwards requests to providers such as Anthropic, OpenAI, Google, DeepSeek, Moonshot and NVIDIA. Model prices match the provider, credit purchases carry a 5.5% fee, and your own keys are free up to $25,000 a month.
OpenRouter forwards each request to a provider that serves the model. Source: OpenRouter pricing page

The API is OpenAI compatible, so anything built on the OpenAI SDK (Cursor, Cline, LangChain and most agent frameworks) switches over by changing the base URL. If a provider goes down or rate-limits you, the request fails over to another host of the same model. For Claude, that means Anthropic itself, Amazon Bedrock or Google Vertex.

Is OpenRouter safe? By default it does not store your prompts or completions, only metadata such as token counts and latency. Logging is opt-in, and so is letting OpenRouter use your data (in exchange for a 1% discount). The individual providers have their own policies, which is where the free models need a closer look.

Advertisement

Is OpenRouter Free?

Signing up is free and needs no card. Free usage is real, but metered by a daily cap that depends only on how much you have ever bought in credits:

OpenRouter free model limits: 50 requests per day if you never bought credits, 1,000 requests per day after buying at least $10. Both tiers are limited to 20 requests per minute.
The $10 is not consumed. It only raises the daily cap 20x. Source: OpenRouter limits docs

That $10 top-up is the single most useful thing to know. You do not have to spend it: it sits in your balance while the free-model cap jumps from 50 to 1,000 requests a day. Three catches:

  1. Extra accounts or keys do not help. OpenRouter enforces capacity globally, not per key.
  2. A negative balance blocks free models too. Overspend on a paid model and you get 402 errors everywhere until you top up.
  3. Some free providers may train on your prompts. Your privacy settings have separate switches for paid and free models. Opting out of training can remove some free endpoints, so keep confidential data off free models.

The daily counter resets at midnight UTC. When you hit it, requests return 429 Rate limit exceeded.

OpenRouter Free Models List

As of October 28, 2026, OpenRouter lists 16 free text models. The list churns: some models are free for a few weeks during a launch, and the site flags the ones about to go with a “Going away” date.

OpenRouter models page with the price filter set to free, listing HeyGen Voice Turbo, Recursive Flint and NVIDIA Nemotron 3.5 Embed models at $0 per million input and output tokens.
Drag the prompt pricing slider to FREE and only $0 models remain. Source: openrouter.ai/models

The ones worth knowing:

Model IDContextBest for
nvidia/nemotron-3-ultra-550b-a55b:free1MLargest free model, general use
google/gemma-4-31b-it:free262KChat, summaries, multilingual text
thinkingmachines/inkling:free1MLong document reading
poolside/laguna-s-2.1:free262KCoding
cohere/north-mini-code:free256KLight coding tasks
nvidia/nemotron-3.5-lightning:free1MFast, short replies

If you do not want to pick, use openrouter/free as the model name. It routes each request to a random free model that supports what you asked for (vision, tool calling, structured output) and reports the one it used in the response’s model field.

OpenRouter Free Models Router page: openrouter/free covers 26 models, led by Dots3-Note Preview, MiniMax M3, Nemotron 3.5 Lightning, Nemotron 3 Ultra and MiniMax M2.7.
openrouter/free draws from 26 free models, speech and embedding models included. Source: OpenRouter

One trap: if you list fallbacks in a models array and the free model is busy, OpenRouter moves to the next entry and bills it if it is a paid model. To stay at $0, list only :free models or use openrouter/free on its own.

How to Get an OpenRouter API Key

  1. Sign up at openrouter.ai with Google, GitHub, MetaMask or email.
  2. Open openrouter.ai/settings/keys .
  3. Click Create API Key, name it, and optionally set a credit limit (say $5 a month) on that key.
  4. Copy the sk-or-v1-... key straight away and store it somewhere safe.

Keep it in an environment variable, never in source. Keys pushed to a public GitHub repo get scraped within minutes. If one leaks, delete it on the same page and create a new one.

Your first request with the official OpenAI SDK (pip install openai):

import os
from openai import OpenAI

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

resp = client.chat.completions.create(
    model="openrouter/free",  # or "google/gemma-4-31b-it:free"
    messages=[{"role": "user", "content": "Explain PWM on an Arduino in two sentences."}],
)

print(resp.choices[0].message.content)
print("Answered by:", resp.model)

Switching to a paid model is a one-line change, for example anthropic/claude-sonnet-5.5 or openai/gpt-6.1-terra. To check your remaining free requests, send a GET to https://openrouter.ai/api/v1/key with your key. The free_model_daily_requests object shows used, limit and remaining for the current UTC day.

How to Use OpenRouter with Claude Code

OpenRouter exposes an Anthropic-compatible endpoint, so Claude Code talks to it directly with no local proxy. Add this to ~/.bashrc or ~/.zshrc:

export OPENROUTER_API_KEY="sk-or-v1-..."
export ANTHROPIC_BASE_URL="https://openrouter.ai/api"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_API_KEY=""   # must be explicitly empty

On Windows, or to scope it to one project, put the same values in .claude/settings.local.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://openrouter.ai/api",
    "ANTHROPIC_AUTH_TOKEN": "sk-or-v1-...",
    "ANTHROPIC_API_KEY": ""
  }
}

Then:

  1. If you ever logged in with an Anthropic account, run /logout once. A cached login next to a gateway token causes confusing “model not found” errors.
  2. Quit and relaunch claude.
  3. Run /status. You should see Anthropic base URL: https://openrouter.ai/api and ANTHROPIC_AUTH_TOKEN as the auth source.

The empty ANTHROPIC_API_KEY matters: if it holds a value, Claude Code treats it as a direct Anthropic credential. Values in a project .env file are not read by the native installer.

You can remap each model class with ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL and CLAUDE_CODE_SUBAGENT_MODEL. Fable is not offered in /model through OpenRouter unless you set ANTHROPIC_DEFAULT_FABLE_MODEL. And /fast only takes effect when the Opus variable is pinned to a concrete ID such as anthropic/claude-opus-5, not the -latest alias.

OpenRouter is upfront that Claude Code is only guaranteed to work with Anthropic as the provider. Free models can be wired in, but they tend to break on tool calls and long contexts. For a free or local setup that holds up better, see our guide to running Claude Code with Ollama, Kimi and GLM .

OpenRouter Pricing vs Going Direct

There is no markup on tokens. Claude Sonnet 5.5 costs $2 per million input tokens and $10 per million output tokens on OpenRouter, the same as Anthropic’s list price. The cost sits elsewhere:

WhatFee
Buying credits by card (Standard)5.5%
Business plan8%
Bring your own provider keys (BYOK)Free up to $25,000 of usage a month, then 5%
:free models$0

So $20 of credits carries roughly $1.10 in fees. That buys you one bill, one key and automatic failover across providers. If you only ever use one model at volume, going direct is cheaper. To compare model costs for your own token counts, try our LLM cost calculator .

Two more rules: unused credits are refundable only within 24 hours of purchase (fees excluded, crypto never), and OpenRouter reserves the right to expire credits a year after purchase. Payment is by card, AliPay or crypto.

What Is OpenRouter Fusion?

Fusion is OpenRouter’s multi-model deliberation feature. Call openrouter/fusion and a panel of models (three by default, up to eight, each with web search) answers your prompt in parallel. An analyst model then compares the answers, flagging consensus, contradictions and blind spots, and your model writes the final reply from that analysis. OpenRouter’s own estimate is roughly 4 to 5 times the cost of a single completion, so save it for research questions where a wrong answer is expensive.

Frequently Asked Questions (FAQ)

Is OpenRouter free?

Signing up is free, and models ending in :free cost $0 per request. With no credits purchased you get 50 free-model requests a day; after buying at least $10 of credits you get 1,000 a day. Both tiers are limited to 20 requests per minute. Paid models such as Claude, GPT and Gemini need credits.

What are the OpenRouter free model rate limits?

20 requests per minute, plus a daily cap of 50 requests if you have never bought credits or 1,000 requests once you have bought at least $10. The counter resets at midnight UTC, and going over returns a 429 error. Creating extra accounts or keys does not raise the limit.

How do I get a free OpenRouter API key?

Sign up at openrouter.ai with Google, GitHub, MetaMask or email, open openrouter.ai/settings/keys and click Create API Key. The key starts with sk-or-v1 and works immediately on free models without adding credits. Store it in an environment variable and set a per-key credit limit if you share it.

How do I use OpenRouter with Claude Code?

Set ANTHROPIC_BASE_URL to https://openrouter.ai/api , set ANTHROPIC_AUTH_TOKEN to your OpenRouter key, and set ANTHROPIC_API_KEY to an empty string. Run /logout once if you previously signed in with an Anthropic account, relaunch Claude Code, and confirm with /status. OpenRouter only guarantees compatibility with Anthropic as the provider.

Is OpenRouter more expensive than using the API directly?

Token prices match the provider’s list price with no markup. The extra cost is a 5.5% fee when you buy credits by card, about $1.10 on $20. Bringing your own provider keys is free up to $25,000 of usage a month. For a single model at high volume, buying direct is cheaper.