Skip to content
GuidesOctober 16, 2026

Run Claude Code on free models in two lines

Install the anyr CLI, then run anyr claude. Claude Code works on AnyRouter's free models with no card. Exact commands, the manual setup, which models to try, and the limits.

The two lines

Install the anyr CLI, then launch Claude Code through it on the free router:

curl -fsSL https://anyrouter.dev/setup.sh | bash
anyr claude --model anyrouter/free

The first run opens a browser to sign you in, creates a key and saves it. Later runs go straight into Claude Code. If Claude Code is not installed yet, add --install and anyr installs it first. You need an AnyRouter account but no card.

anyrouter/free picks one of the free models that is healthy right now and falls back to the next if it fails. The same two lines are on the /claude-code page, and the signed-in version, with your own key filled in, is at /welcome#claude-code.

Keep background calls free too

Claude Code sends some calls to a small background model, and to subagents. anyr claude points those at Claude Haiku by default, and that model is only available through your own provider key (BYOK). On a Free account without one, those calls can fail with 404 model_unavailable even while your main model is free. Pin all the aliases to the free router to avoid that:

anyr claude --model anyrouter/free \
  --haiku anyrouter/free --sonnet anyrouter/free \
  --opus anyrouter/free --fable anyrouter/free

anyr claude --dry-run prints the command and environment it would use, with the key redacted, so you can check the aliases before you start.

Without the CLI

Claude Code reads two environment variables. Create a key in the dashboard (every key starts with sk-ar-), then:

export ANTHROPIC_BASE_URL="https://anyrouter.dev/api"
export ANTHROPIC_API_KEY="sk-ar-your-key"
claude --model anyrouter/free

Leave /v1 off the base URL: Claude Code adds /v1/messages itself. Full reference: docs.anyrouter.dev/cli/claude-code.

Which free models to try

We have not ranked free models for coding, and any ranking would go stale in a week. What we can say is which ones anyrouter/free may route to and have at least 128K of context, since Claude Code's own prompt and tool list use a good part of a small window. This table is generated from the catalog when the page is built.

ModelIdContext
Glyph Clusterstealth/glyph-cluster256K
Step 5 Previewstepfun/step-5-preview1M
Dots3-Note Previewdots-studio/dots-3-note-preview512K
Inkling Smallthinkingmachines/inkling-small1M
LFM 2.5 2.6Bliquid/lfm-2.5-2.6b128K
Nemotron 3.5 Lightning 30B A3Bnvidia/nemotron-3.5-lightning-30b-a3b131K
Laguna S 2.1poolside/laguna-s-2.1262K
Inklingthinkingmachines/inkling1M
Laguna XS 2.1poolside/laguna-xs-2.1262K
DeepSeek-V4-Flashdeepseek/deepseek-v4-flash128K
Qwen3-8Bqwen/qwen3-8b128K
Nemotron-3 Super 120Bnvidia/nemotron-3-super-120b-a12b262K
Nemotron 3 Ultra 550Bnvidia/nemotron-3-ultra-550b-a55b1M
Gemma 4 31Bgoogle/gemma-4-31b262K
GPT-OSS 20Bopenai/gpt-oss-20b131K

Pass any id to --model to pin it. The full, current list is at /free. To see only models that speak the Messages API Claude Code uses, filter the model list.

Limits, stated plainly

  • Cost: free models bill $0 per token and do not touch your credit balance. Paid models return 402 until you add credits or a plan.
  • Rate: no daily cap. Free models share 2,400 requests per minute per API key on every plan.
  • Sign-in: a request with no key gets a 401. Signing up is free.
  • Quality: these are not Claude. Hard multi-file work is where a free model is most likely to stall or go wrong, so review diffs as you would for any agent.
  • Availability: free capacity comes from upstream providers and changes. anyrouter/free falls back automatically, but a pinned model can be busy or gone.
  • Settings: if a privacy setting such as Zero Data Retention rules out every free model, you get 400 no_eligible_models. Pin a model that meets it.
  • Long runs: for slow models, export API_TIMEOUT_MS=3000000 raises Claude Code's timeout. The anyr launcher already sets it.

Check it worked

Run any prompt, then open your request logs. The call shows up a few seconds after the stream closes, with the model that answered, token counts and cost. Free calls show $0.

Coming from OpenRouter? The same two-line swap works for any OpenAI-compatible client. See AnyRouter vs OpenRouter for a sourced comparison and the migration steps.

Free models in Claude Code: two lines, no card.

Open the setup page

FAQ

Can I run Claude Code on free models?

Yes. Install the anyr CLI with the setup script, then run anyr claude --model anyrouter/free. Free models bill $0 per token, and you need an AnyRouter account but no card.

Are the free models as good as Claude?

No. They are other labs' models, and quality varies by model. Expect them to handle everyday edits and questions better than large multi-file refactors. Try two or three on your own repository.

Do free models have a daily limit on AnyRouter?

There is no daily cap. Free models share a limit of 2,400 requests per minute per API key. If a model is busy, anyrouter/free falls back to another free model.

Route your first request in 2 minutes

Start free with your own keys, or top up and pay per token. Get $4/mo in credits and free models on Go — $2/mo, or free when you donate a provider key.

Start free