查看中文版 →

Deutsche Version ansehen →

Открыть русскую версию →

Ver versión en español →

Log in
Blog · Setup guides

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.

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 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 -vnpm 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-claudeomniroute 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:

DimensionOmniRoute (local router)Direct provider APICodingPass (managed gateway)
Setup and maintenanceLocal Node.js runtime, background daemon, self-updatedZero deployment, just set a keyZero deployment, change one Base URL
Accounts and billingSeparate accounts, keys, and invoices per vendorOne invoice per vendor, new signup to switchOne account and one monthly bill across 25 models
Multi-model and failoverBuilt-in Model Combos with custom fallback and round-robinNo cross-vendor failoverSwitch models by ID on one endpoint across Claude and frontier models
Local models (Ollama, etc.)Native support alongside cloud APIsNot supportedCloud-hosted models; pair with local tools when needed
Cost predictabilityFollows upstream pay-as-you-go billingPay-as-you-go; long contexts can spike billsFixed 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 page. Check the Claude Code setup guide and 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 / scenarioRecommended choiceReason or tradeoff
Already holding 3+ provider keys plus local Ollama modelsOmniRouteModel 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 budgetCodingPassOne Base URL covers Claude and frontier models with no overage surprises; see the Claude Code setup guide
Need local Ollama fallback plus predictable cloud spendOmniRoute + CodingPassOmniRoute handles local routing rules while CodingPass supplies cloud models on one monthly bill
Single-vendor production pipeline with an existing enterprise commitDirect provider APIShortest 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 and Codex setup guide.

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.

Boarding

Skip the local proxy, point one Base URL and code.

CodingPass puts models behind a single Base URL. Go starts at a month for roughly Claude Sonnet requests, with Plus at . No surprise charges, cancel anytime.

  • Request ID on every response
  • Full refund if you've used 5% or less
  • No surprise charges
Choose GoClaude Code setup guide

$10/mo until you cancel.