Introduction
Lots of AI providers give you a free tier, but each one alone is too small for a coding agent. A few requests, you hit the rate limit, and Claude Code stops. In this post you set up OmniRoute as a central hub for free LLMs on your own machine, connect OpenRouter, Nvidia, Mistral and Groq to it, and point Claude Code at the result so that a session costs nothing.
🎬 Watch the full video here:
Why OmniRoute
OmniRoute is an open-source AI gateway under the MIT license, and it runs on your own PC. You connect your providers once, and it gives every tool one endpoint and one API key.
Two features make it work for Claude Code:
- Combos - a combo is a set of models you design yourself. If one model is out of quota or failing, OmniRoute moves on to the next one in the background.
- API format translation - Claude Code talks to OmniRoute in the Anthropic format, even when the model behind it is something completely different.
Prerequisites
You need two things before setting up OmniRoute. The first is Node.js, which you can check from the command line:
node -v
If that doesn't print a version, download the installer for your operating system from nodejs.org.
The second is Claude Code itself. If you don't have it yet, use the install command from the Claude Code setup page.
Install and run OmniRoute
OmniRoute is an npm package, so installing and starting it takes two commands:
npm install -g omniroute
omniroute
The output confirms that OmniRoute is running and shows the API base URL and the dashboard address. Open the dashboard and sign in. The default password is CHANGEME, which I left in place for this local demo. To set your own, run this and confirm the new password:
omniroute reset-password
The homepage has a quick start guide, a view of your connected providers with their status, and your recent requests with the model, the input and output tokens, and when each one happened.
Choosing free providers
Open Providers in the left-hand menu. There are about 370 AI providers listed, so turn on the free tier filter to avoid models you would pay for.
Based on my experience, these are the ones I can recommend: Antigravity CLI, Cerebras, Groq, Kiro AI, LLM7.io, Mistral, Nvidia and OpenRouter. In this post I connect four of them.
Connect OpenRouter
OpenRouter goes first because it's an aggregator: one API key gives you access to more than one AI provider at once.
- Register at openrouter.ai, open the API keys tab and click New key.
- Name the key
omniroute, then choose an expiration and a credit limit. I used no expiration for the demo and a $50 limit, which never gets touched because only free models are used. - In the OpenRouter section of OmniRoute, click Add connection, paste the key and check that it's valid.
- Name the connection, use the option to import only free models, save and enable the connection.
- Import the models. I got 17.
- Run Test all models.
The last step is the one that matters. An imported model isn't necessarily a working one, and only models with an OK response are usable from Claude Code. In my case, 8 of the 17 worked.
Connect Nvidia, Mistral and Groq
The pattern is the same for every other provider: create an API key on the provider's site, add a connection in OmniRoute, check the key, import only free models, save, enable and test.
- Nvidia - register on the Nvidia website and generate a key in its API keys section. I kept the default one-year expiration. 5 of 7 models worked.
-
Mistral - create the key at
admin.mistral.ai, notstudio.mistral.ai. Only one model was available for me. - Groq - create the key in the API keys tab of your Groq account. 5 of 5 models worked.
The OmniRoute homepage now shows four connected providers. Experiment with others too: Kiro AI, Antigravity CLI and Cerebras are all very good options.
Create the combo
A combo works like a fallback policy. It uses all the models you configure, and once one of them is out of use, OmniRoute switches to another automatically in the background.
Click Create combo, name it omniroute-combo and choose the free stack quick template. To add a model, select a provider, select one of its models and click Add step.
The model list shows everything that was imported, not what currently works, so run the provider's model test again and pick from those results. I added four OpenRouter models, all five Groq models, the one Mistral model and the working Nvidia models.
The last step is the routing strategy. I use round robin, a circular distribution where each request goes to the next model in rotation, which spreads the load equally across all of them. Priority and the other strategies are there too, each with a description, so pick what suits your use case. Then click through to save.
Now use Test combo. Most of my models came back green, but one OpenRouter model returned a 429 error from the provider. That doesn't break anything: OmniRoute skips that model and doesn't use it.
Point Claude Code at OmniRoute
Claude Code needs its own key, so create one in the API Keys section of OmniRoute. I named mine after Claude Code. Copy the value, then open your project. I used the MCP server project from Build Your First MCP Server in .NET, the same one that I used in Run Claude Code for FREE with Ollama.
In the root of the project, create a .claude folder with a settings.local.json file inside it. This makes Claude Code use OmniRoute in this project instead of your Claude subscription:
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "<your-omniroute-api-key>",
"ANTHROPIC_MODEL": "omniroute-combo",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "omniroute-combo",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "omniroute-combo",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "omniroute-combo"
}
}
The base URL is your local OmniRoute, and the auth token is the key you just created. All four model values are your combo name, so whichever model Claude Code asks for, the request goes through the combo.
Save the file, open a terminal in the project and start Claude Code:
claude
The startup screen shows omniroute-combo as the model, which confirms that the setup works.
Testing it on real tasks
The first test was on the existing codebase: generate a Markdown file with documentation based on the code. The result had an architecture diagram, the project structure and the data models, and it looks very decent.
The second test was to build something new: a tic-tac-toe game in pure HTML. One prompt and a few seconds later there was a .html file that runs in any modern browser. I opened it in the browser built into VS Code and played a round. It detects when someone wins, and undo and restart work as well. It's impressive what these free models can do through Claude Code.
Check what it cost
OmniRoute has an analytics section with the total tokens used, input tokens, output tokens and the estimated cost, along with highlights, performance and infrastructure data. For this whole experiment the estimated cost was 0.
OmniRoute pitfalls
- Imported doesn't mean working - about half of my OpenRouter models failed the test. Always run Test all models before relying on a model.
- The combo's model list isn't filtered - it shows every imported model, so retest the provider right before you add steps instead of picking by name.
-
Looking for the Mistral key in the wrong place - API keys are created at
admin.mistral.ai, notstudio.mistral.ai. - Using a different name in the settings file - the model values must match your combo name exactly, so check it in OmniRoute before pasting.
- Worrying about a 429 in the combo test - one failing model doesn't break the combo, because OmniRoute skips it and uses the others.
Key Takeaways
- A single free tier is too small for a coding agent, but OmniRoute puts many free providers behind one local endpoint and one API key.
- A combo combines models from different providers, and when one is out of quota or failing, OmniRoute moves to another automatically.
- Test models after importing them and before adding them to a combo, because many imported free models don't respond.
- A
.claude/settings.local.jsonfile with the base URL, the API key and your combo name is all it takes to point a project's Claude Code at OmniRoute. - The analytics section lets you confirm the result: the estimated cost of my session was 0.
Top comments (0)