SAVE THIS

Run Claude Code on Models You Don't Pay For

A community tool sits between Claude Code and any model you pick, so your coding agent can run on open-source models through free tiers or your own machine. Setup takes about ten minutes, and the catch is worth reading first.

A community tool sits between Claude Code and any model you choose, so your coding agent can run on open-source models through free tiers or your own machine. Setup takes about ten minutes. The catch is real, and it is worth reading before you cancel anything.

Your coding agent runs on a meter. Every seat, every token, every month, and the bill grows the moment the work does.

A developer on GitHub got tired of that and built a small piece of software that sits in the middle. Claude Code still thinks it is talking to Claude. It is actually talking to whatever model you pointed it at.

More than 36,000 people have starred the project. The whole idea fits in one line: keep the tool, swap the engine underneath it.

What Is Claude Code Router?

Claude Code Router is a local gateway that runs on your machine and forwards your coding agent's requests to the provider and model you chose. Claude Code talks to the gateway instead of to Anthropic directly. The gateway passes the request along, gets the answer, and hands it back in the format Claude Code expects.

No, it is not a jailbreak. It is a router. You keep the same terminal, the same commands, and the same agent behavior. What changes is the model doing the work and the price attached to it.

It is open source, MIT licensed, and it installs with npm. At the time of writing it sits above 36,000 stars on GitHub, which tells you a lot of people are already running it in the open.

The Providers, And What Each One Costs You

The tool ships presets for the big providers and lets you add a custom endpoint for anything else. That last part matters, because it is how you wire in the free options.

PathWhat you connectCost
Hosted free tierOpenRouter or NVIDIA NIM free API keyFree, with rate limits
Hosted paidDeepSeek, Kimi, GLM, Mistral, and othersCents per million tokens
Fully localOllama on your own GPUFree, and nothing leaves your machine

Presets cover OpenAI, Gemini, OpenRouter, DeepSeek, Moonshot and Kimi, Mistral, and Z.AI, plus a custom-endpoint option for anything that speaks the same protocol. That custom slot is where NVIDIA NIM and a local Ollama server plug in.

Setup: Three Steps To Your First Run

You need Node.js 22 or newer. After that it is three moves.

Copy the install command

Copy this.

npm install -g @musistudio/claude-code-router
ccr ui

The first line installs it. The second opens a control panel in your browser at 127.0.0.1:3458. The gateway itself runs on 127.0.0.1:3456.

Second, add a provider. In the panel, go to Providers, then Add Provider. Pick a preset or a custom endpoint. Paste your API key. Choose which models it is allowed to use. Save.

Third, point Claude Code at the gateway and start working. The agent behaves the way it always has, except the requests now flow through the model you picked.

Done. Your coding agent is running on a model you chose, at a price you chose.

If you want it free and hosted

Grab a free API key from OpenRouter or NVIDIA NIM. Add it as a provider. Point your everyday work at one of the free open models like DeepSeek or a Kimi variant. On a heavy day you will hit rate limits. On a light day you may never notice them. This is the fastest way to prove the idea works before you spend a cent.

If you want it free and private

Install Ollama and pull a capable open model. Add Ollama to the router as a custom endpoint. Now every request stays on your machine. No outbound API calls, no keys, no code leaving the building. This is the only path that is free with no asterisk. It trades the monthly bill for a decent GPU and a bit of patience.

Route The Cheap Work To The Cheap Model

Here is the part most people skip over, and it is the one that actually saves money.

You do not have to run everything on one model. The router can send different kinds of work to different models. Put the hard reasoning on a stronger model. Send the routine background calls to a cheap one, or to your local machine. Keep the long-context jobs wherever they hold up best.

Most of what a coding agent does across a day is cheap, repetitive work. Reading files, summarizing a diff, renaming things, drafting a commit message. You were paying a premium rate for all of it. With routing in place, you pay the premium only where it earns its keep and let the rest run near zero.

In practice this means you set it once and forget it. Pick a strong model for the main coding, a cheaper one for the background chatter, and the router decides which is which on every call. You are not babysitting a config all day. You are letting the routing rules spend your money the way you would if you had time to think about each request.

Why A Business Owner Should Care

This is not just a trick for hobbyists coding at night. It changes a line on your P&L.

If you run an agency or a dev shop, every AI seat scales with headcount, and every feature request quietly adds to the token bill. Routing turns a fixed subscription into usage you control, and turns part of that usage into nothing.

If your team handles sensitive code that should never leave the network, a local Ollama route keeps the whole thing in-house. Your compliance answer stops being "we trust the vendor's terms" and becomes "it never left our machines."

If you are still deciding whether an agent-driven workflow is worth it, this lets you test one without signing up for a plan first. If it earns its place, keep it. If it does not, you spent an afternoon and learned something.

There is a bigger reason to care than the monthly saving. The day your workflow only runs on one company's model, that company sets your price and you have no answer. A router breaks that. If a provider raises its rates or changes its terms, you point the same setup at a different model and keep working. The cost saving is the headline. The independence is the part that pays off later.

We run our own agent stack across more than one engine on purpose, Claude and Codex both, for this exact reason. Being able to swap the model without rewriting the work is worth more over a year than any single vendor's discount.

Honest: The Limits You Should Know

Read this part before you touch a subscription.

  1. Free is not always free. Only the local Ollama route is truly free, and it needs real hardware. The hosted free tiers come with rate limits that bite on a busy day.
  2. The models are close, not equal. Open models have closed most of the gap on everyday coding. On the longest, hardest agentic tasks the frontier models still pull ahead. The "80 to 90 percent as good" number from the video is a fair feel, not a benchmark to bet the business on. Test it on your own work before you trust it with client work.
  3. Your code goes where you send it. A free hosted key means your code passes through that provider's servers. Read their terms. If that is a problem, use the local route.
  4. It is a community tool, not an official product. You are pointing one company's client software at other companies' models. It works well and thousands rely on it, but nobody owes you support, and an update to Claude Code can break the router until it catches up.
  5. Someone has to own it. This is one more moving part in your stack. Fine for a team with a technical person in it. A stretch if nobody in the building is comfortable in a terminal.

The One Thing To Do This Week

If you only do one thing: install it, wire up a single free provider, and run one real task you would normally run on your paid plan. Not your whole workflow. One task.

Watch two things. Did it finish the job, and did the quality hold. That five-minute test tells you more than any spec sheet. If it holds, you found a lever on your costs. If it does not, you are out ten minutes and you know exactly where the paid model still earns its price.

This guide is one system.
The map tells you which comes first.

The guides show you the systems. The map shows you which one your business needs first.

Get your free map →
Take this with you Open the repo → Download as PDF ↓

Prefer to browse with company? The free community has the full skill library.