---
title: "How to Install OmniRoute in Claude Code: Local Multi-Model Router Setup"
description: "Step-by-step guide to running OmniRoute with Claude Code: npm install -g omniroute, omniroute serve --tray, localhost:20128 Model Combos failover, omniroute launch, and settings.json setup. Includes a local router vs CodingPass comparison."
url: https://codingpass.ai/blog/omniroute-claude-code-local-model-router
language: en
updated: 2026-11-29
---
# OmniRoute for Claude Code: local multi-model routing

OmniRoute is a local proxy gateway on port 20128—not a Claude Code plugin. Install it with npm, wire up your API keys or Ollama models into Model Combos, and launch Claude Code without editing your base config.

[CodingPass team](https://codingpass.ai/about) Published Nov 29, 2026 Updated Nov 29, 2026 6 min read

Relying on a single model provider in Claude Code usually breaks down in two ways: hitting a 429 rate limit mid-session, or juggling separate keys across cloud APIs and local Ollama models. [OmniRoute](https://github.com/diegosouzapw/OmniRoute) is an open-source local AI gateway built to sit between your coding agents and those upstream providers, exposing standard Anthropic and OpenAI endpoints from your own machine.

**First, a quick clarification:** Despite common searches for an OmniRoute plugin in Claude Code, OmniRoute is a standalone local proxy gateway on port `20128` rather than a Claude Code plugin or MCP server. Point `ANTHROPIC_BASE_URL` to localhost and OmniRoute handles routing, failover, and credential switching behind the scenes—useful if you already hold multiple provider keys or mix local models with cloud APIs.

## Install and start OmniRoute

Check your Node.js version first. The global `omniroute` npm package requires **Node.js `>=22.22.2` and `<23`**, or **`>=24` and `<27`** (Node.js 23 is skipped). Verify your runtime and install the CLI globally:

```
node -v
npm install -g omniroute
```

Start the local gateway. On macOS, Windows, or desktop Linux, `--tray` runs the daemon in the background with a system tray icon for quick restarts and log checks:

```
omniroute serve --tray
```

On headless machines or if you prefer foreground logs, run `omniroute` directly. The server binds to port `20128` by default, and you can override it with the `OMNIROUTE_PORT` environment variable.

Open `http://localhost:20128/dashboard` in your browser to finish initial setup:

- **Default admin password**: `CHANGEME` (can be overridden before launch via `INITIAL_PASSWORD`)
- **First step**: sign in and change the password under **Settings → Security**
- **Local endpoints**: use `http://localhost:20128/v1` for OpenAI-compatible tools and `http://localhost:20128` for Anthropic-protocol tools like Claude Code

## Configure providers and Model Combos

In the dashboard, add the upstream accounts you already have under **Providers**. OmniRoute groups connectors into several buckets:

- **API key providers**: Anthropic, OpenAI, Google Gemini, DeepSeek, Groq, Mistral, Cerebras, and others
- **OAuth-linked accounts**: subscription-backed coding tools connected via OAuth
- **Local inference runtimes**: Ollama, LM Studio, vLLM, and llama.cpp running on your machine or LAN
- **Free-tier and keyless routes**: useful for lightweight completions or fallback tests

Once your providers are connected, create a **Model Combo** to define how requests flow when a primary model is busy or throttled:

- **Priority fallback**: send traffic to your primary model first and fail over automatically on 429 rate limits or quota exhaustion
- **Round-robin load balancing**: spread concurrent agent requests across multiple upstream keys
- **Cost-tiered routing**: route routine edits to cheaper or local models while keeping flagship models for harder tasks

Generate a local OmniRoute API key in the dashboard before wiring up Claude Code.

## Connect Claude Code to OmniRoute

You can connect Claude Code in two ways: a zero-edit session wrapper that leaves your config untouched, or a persistent `settings.json` entry.

### Option 1: Launch without editing config (`omniroute launch`)

If you want to test OmniRoute without modifying your existing Claude Code setup, use the built-in launcher:

```
omniroute launch
```

This injects the local OmniRoute environment variables into that single Claude Code session without writing to `~/.claude/settings.json`. If you maintain multiple routing profiles, generate Claude profiles once and pick one at launch:

```
omniroute setup-claude
omniroute launch --profile <profile-name>
```

### Option 2: Persistent setup in `~/.claude/settings.json`

To route every `claude` invocation through OmniRoute by default, edit your Claude Code settings file (`~/.claude/settings.json` on macOS and Linux, or `C:\Users\<YourUsername>\.claude\settings.json` on Windows):

```
{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:20128",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_OMNIROUTE_API_KEY",
    "ANTHROPIC_API_KEY": "",
    "ANTHROPIC_MODEL": "auto"
  }
}
```

Two details save debugging time:

- **Restart Claude Code after saving**: Claude Code reads `env` values only at startup, so active sessions will not pick up changes
- **Merge manually if you already have custom settings**: adding keys directly inside `env` preserves existing permissions and MCP entries

## Local router vs direct API vs CodingPass

OmniRoute solves local routing across keys and runtimes you already manage, but it does not supply model quota itself. You still maintain each vendor account, billing method, and spend limit. Here is how self-hosted local routing compares with calling a single vendor API directly or using a managed multi-model gateway like CodingPass:

| Dimension | OmniRoute (local router) | Direct provider API | CodingPass (managed gateway) |
| --- | --- | --- | --- |
| Setup and maintenance | Local Node.js runtime, background daemon, self-updated | Zero deployment, just set a key | Zero deployment, change one Base URL |
| Accounts and billing | Separate accounts, keys, and invoices per vendor | One invoice per vendor, new signup to switch | One account and one monthly bill across 25 models |
| Multi-model and failover | Built-in Model Combos with custom fallback and round-robin | No cross-vendor failover | Switch models by ID on one endpoint across Claude and frontier models |
| Local models (Ollama, etc.) | Native support alongside cloud APIs | Not supported | Cloud-hosted models; pair with local tools when needed |
| Cost predictability | Follows upstream pay-as-you-go billing | Pay-as-you-go; long contexts can spike bills | Fixed monthly allowance from $10 (Go) or $30 (Plus), no surprise charges |

If you would rather not maintain a local daemon or juggle four billing dashboards, pointing Claude Code directly at CodingPass keeps the setup to two lines. Go starts at $10 a month for roughly 2,050 Claude Sonnet requests, and the same allowance covers all 25 models on the [Models](https://codingpass.ai/models) page. Check the [Claude Code setup guide](https://codingpass.ai/tools/claude-code) and [Pricing](https://codingpass.ai/pricing) for the exact numbers. You can also combine both: register CodingPass as one upstream provider inside OmniRoute so local Ollama handles offline drafts while CodingPass covers cloud models on a fixed monthly budget.

## Which setup fits your workflow

| Workload / scenario | Recommended choice | Reason or tradeoff |
| --- | --- | --- |
| Already holding 3+ provider keys plus local Ollama models | OmniRoute | Model Combos unify local and cloud models under one localhost endpoint; you own daemon upkeep and vendor bills |
| Daily Claude Code work with a fixed monthly budget | CodingPass | One Base URL covers Claude and frontier models with no overage surprises; see the [Claude Code setup guide](https://codingpass.ai/tools/claude-code) |
| Need local Ollama fallback plus predictable cloud spend | OmniRoute + CodingPass | OmniRoute handles local routing rules while CodingPass supplies cloud models on one monthly bill |
| Single-vendor production pipeline with an existing enterprise commit | Direct provider API | Shortest network hop and zero proxy layer, at the cost of manual switching between vendors |

If you also run other terminal coding agents alongside Claude Code, the same endpoint approach works in our [OpenCode setup guide](https://codingpass.ai/tools/opencode) and [Codex setup guide](https://codingpass.ai/tools/codex).

## FAQ

### Is OmniRoute a Claude Code plugin or MCP server?

No. OmniRoute is a standalone open-source local proxy gateway running on port `20128` that speaks both Anthropic and OpenAI protocols. You connect Claude Code by pointing `ANTHROPIC_BASE_URL` to `http://localhost:20128` rather than installing a plugin inside Claude Code.

### Does `omniroute launch` overwrite `~/.claude/settings.json`?

No. `omniroute launch` injects the proxy environment variables into the current shell session without modifying files on disk. If you want a permanent setup, add `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` manually inside the `env` block of `~/.claude/settings.json`.

### Can I use CodingPass inside OmniRoute?

Yes. CodingPass exposes standard Anthropic and OpenAI-compatible endpoints, so you can add it as an upstream provider in OmniRoute and include it in a Model Combo. If you do not need local Ollama routing, pointing Claude Code directly to CodingPass removes the extra local hop.

Written by CodingPass team

We run CodingPass and test each guide against the latest stable release of the tool before we publish it. Spotted something out of date? Write to [support@codingpass.ai](mailto:support@codingpass.ai).

## Related reading.

Tools

### [Claude Code setup guide](https://codingpass.ai/tools/claude-code)

Change one Base URL and key to run Claude and other frontier models in Claude Code.

Models

### [All models](https://codingpass.ai/models)

Every model ID, its minimum tier, and monthly allowances on Go, Plus, and Pro.

Pricing

### [Plans and pricing](https://codingpass.ai/pricing)

Monthly prices, allowances, and usage rules across Go, Plus, Pro, and Team Pass.
