Best Claude Code routers and model routers in 2026, ranked
Tyler J. CagleUpdated 21 min read
Auto, the Mac app for all your coding agents, is the best Claude Code router for a developer who already pays for AI subscriptions: it uses those plans first, applies your own rules, then picks a model for each request and shows its model, what it cost and why. Ranked for that reader, as checked on November 23, 2026, the six routers are Auto, Weave Router, the open-source claude-code-router, OpenRouter, LiteLLM and Portkey. The order changes if you are not on a Mac, run a team on API keys or need prompts kept in your own infrastructure, and for simple cases Claude Code's opusplan and Codex profiles need nothing installed. Auto wrote this ranking, so it states its criteria and links each tool's own pages.
What are the best model routers for coding agents in 2026?
Auto ranks first of the six routers below for a solo developer or small team that wants the AI subscriptions it already pays for to last longer, and Weave Router ranks second. Auto wrote this ranking, so here are the criteria, in order of weight: the router uses the plans you already pay for before paid models; it picks a model for each request so you don't; what it adds to the $100 worked example in the pricing section; it runs on more setups; and it documents or benchmarks how it picks. Prices and features were checked on November 23, 2026, except Portkey's prices, last read on October 22, 2026.
| Rank | Tool | Best for | One-line verdict |
|---|---|---|---|
| 1 | Auto | Solo developers and small teams on AI subscriptions | Uses your plans first and picks a model for each request, and shows why; Mac only, in beta, with no published benchmarks. |
| 2 | Weave Router | Plan-first routing on any operating system | Also uses flat-rate plans first and publishes its benchmark method, but its plan support covers the Claude plan in Claude Code and the ChatGPT plan for listed models in Codex. |
| 3 | claude-code-router | A local, open-source setup with rules you write | Open source (MIT) with no fee listed, imports your sign-ins and runs on macOS, Windows and Linux, but it routes only by your ordered rules or scripts. |
| 4 | OpenRouter | One bill across 600+ models | Bills inference at list price, and its Auto Code router for coding agents adds no fee, but it charges OpenRouter credits and doesn't use your plans. |
| 5 | LiteLLM | A self-hosted gateway for teams on API keys | Open-source gateway with virtual keys, spend tracking and budgets, but you run it and its auto router is still in beta. |
| 6 | Portkey | Hosted budgets, rate limits and logs | Developer is free and Production is $49 a month, but its Codex guide uses API keys and its Claude Code support centers on Max plan and OAuth. |
What is claude-code-router, and is it the same as a Claude Code router?
claude-code-router is one open-source project, musistudio/claude-code-router under the MIT license, while a Claude Code router is any tool that sits behind Claude Code and picks the model for each request. Claude Code sends its requests wherever ANTHROPIC_BASE_URL points (docs), so every router on this list attaches that way or edits Claude Code's settings for you.
As of November 23, 2026, claude-code-router (version 3.1.6) ships a desktop app for macOS, Windows and Linux, imports your Claude Code sign-in or Codex auth file as a provider, and routes by the rules or scripts you write (README). Auto is a separate Mac app: turn Claude Code on in Auto, then pick Auto with /model or start with claude --model auto-claude-route, and it judges how hard each request is from the text you typed. Claude Code Router vs Auto compares the two, and Claude Code Router alternatives covers the other local options.
Which router is best for each use case?
Auto is the best pick for a solo developer juggling several paid subscriptions, and with Pro it keeps requests going from monthly usage when a connected plan hits its limit. Other jobs have other winners, as the table shows.
| Use case | Best pick | Why |
|---|---|---|
| A solo developer with several paid subscriptions | Auto, then Weave Router | Both use flat-rate plans before paid models. Auto Free is $0, and Pro includes usage each month, with paid models at provider price + 10%. |
| Switching when a plan hits its limit | Auto Pro | Pro continues from its monthly usage until the plan resets, then asks you to top up. Claude Code's own --fallback-model doesn't switch on rate-limit or billing errors. OpenRouter avoids plan limits by billing credits instead. |
| Routing by task complexity | Auto, then Weave Router | AutoRouter works out how hard each task is and only considers models that clear the quality bar. Weave Router scores every request with a cluster scorer. OpenRouter's Auto Code picks a model and reasoning effort for each request, tuned for coding agents, and LiteLLM's auto router (beta) uses complexity tiers you map to models. |
| A startup or team that wants to avoid overspending | LiteLLM or Portkey for API keys; Auto Enterprise for Macs | LiteLLM adds virtual keys, spend tracking and budgets. Portkey offers hosted budgets, rate limits and logs. Auto Enterprise, priced by seats, adds team budgets, allowed models and spend by team, project or ticket. |
| Not on a Mac | claude-code-router, then Weave Router | claude-code-router ships for macOS, Windows and Linux, and Weave Router installs with npx @weave-os/router. |
| Prompts kept in your own infrastructure | Self-hosted LiteLLM | Self-hosted LiteLLM keeps data in your infrastructure, and claude-code-router listens on 127.0.0.1. |
| One bill without plans | OpenRouter | Inference bills at list price across 600+ models, plus a 5.5% fee on credit purchases (Standard). |
What does each router do well, and where does it fall short?
Each router wins one job and gives something up for it. The list gives one strength and one limit per tool, in ranked order.
- Auto. Strength: it uses your plans first, applies your plain-English rules, then a model that clears the quality bar, and shows each request's model, cost and reason (how AutoRouter picks a model). Limit: it needs macOS 14 or later, is in beta, passes requests through its servers, sometimes misjudges how hard a task is and has no published benchmarks yet (does model routing make your results worse?).
- Weave Router. Strength: it uses flat-rate plans first, scores every request and publishes its benchmark methodology; hosted, purchased credits add 5.5% ($0.80 minimum) and requests on your own keys carry a 5% platform fee, about $105 to $106 on the $100 example, and self-hosting is Apache-2.0 from router-v0.2.24 (Weave). Limit: its page doesn't say how requests on your plans count toward the hosted fee.
- claude-code-router. Strength: it is open source (MIT), runs on macOS, Windows and Linux, and also supports OpenCode, Kilo Code, Grok CLI, Kimi CLI and Pi (README). Limit: you write and maintain the rules or scripts it routes by.
- OpenRouter. Strength: one balance of credits across 600+ models, and Auto Code, a router tuned for coding agents that adds no fee, with published routing benchmarks (docs); about $106 on the $100 example (pricing). Limit: usage bills OpenRouter credits, not the plans you already pay for.
- LiteLLM. Strength: an open-source (MIT) gateway with virtual keys, spend tracking and budgets, and self-hosting keeps data in your infrastructure (docs). Limit: you run it, its auto router is in beta and Enterprise features need a license key.
- Portkey. Strength: hosted budgets, rate limits and logs, plus configs with conditions, weights and fallbacks (conditional routing). Limit: Production is $49 a month, so the $100 example costs $149 (pricing).
Which is better: OpenRouter, LiteLLM or Portkey?
Pick OpenRouter for one prepaid bill and no infrastructure, LiteLLM for open-source budgets on a gateway you host, and Portkey for hosted budgets, rate limits and logs over provider keys you already have. The three overlap less than the ranking suggests: OpenRouter sells model access, while LiteLLM and Portkey sit in front of keys you hold. Auto wrote this post, so each verdict below links the tool's own page, and the figures are the ones in the pricing section plus those cited in each verdict.
| Tool | Pick it for | What you pay | What you run |
|---|---|---|---|
| OpenRouter | One prepaid balance across 600+ models, with failover | 0% markup on provider prices; 5.5% fee on credit purchases, $0.80 minimum | Nothing; you never hold a provider key |
| LiteLLM | Virtual keys and budgets per key, user and team, with data kept in your infrastructure | Open source (MIT) with no license fee; Enterprise features need a custom-priced license | A proxy you host; keys and budgets need PostgreSQL |
| Portkey | Hosted budgets, rate limits, guardrails and logs over your own keys | Developer free; Production from about $49 a month | Nothing hosted; the gateway can also be self-hosted |
How does OpenRouter compare to Portkey for routing between models?
Pick OpenRouter when you want model access and failover with no infrastructure, and Portkey when you need a governance layer over provider accounts you already run. That is the verdict in OpenRouter's own comparison, a vendor page updated September 24, 2026. OpenRouter routes from one credit balance and never gives you a provider key; Portkey sits in front of the keys you already have. On price, OpenRouter charges a 5.5% fee on credit purchases with a $0.80 minimum and 0% markup on provider prices, while Portkey Developer is free and Production is $49 a month for 100K logs. The same page notes Portkey can use OpenRouter as an upstream provider, so the choice is not exclusive. Auto vs OpenRouter and Auto vs Portkey cover each one against Auto.
How does OpenRouter compare to LiteLLM for managing spending across Claude and ChatGPT?
Pick OpenRouter to keep all spending in one prepaid credit balance, and LiteLLM to cap spending per key, user and team on a gateway you host. OpenRouter bills its own credits, so it does not draw on your Claude or ChatGPT plans, while LiteLLM documents routing Claude Code signed in with a Claude plan. LiteLLM's budgets and virtual keys are open source and need PostgreSQL, and its Enterprise features, such as SSO, audit logs and team-level roles, need a custom-priced license (API7's comparison, undated vendor page). On the $100 worked example above, OpenRouter costs about $106 and LiteLLM costs your machine and time. LiteLLM alternatives for gateways and coding agents and Auto vs LiteLLM cover the self-hosted route in more depth.
Is Portkey or LiteLLM better for a startup with several AI coding subscriptions?
LiteLLM fits a startup with an engineer to run it, and Portkey fits one that wants hosted budgets and logs with no servers to operate. LiteLLM is open source (MIT) with budgets and virtual keys at no license fee. Portkey Production is from about $49 a month, and its more granular budgets are an Enterprise feature (API7's comparison). Both are gateways built around API keys: Portkey's Codex guide uses API keys and its Claude Code support centers on Max plan and OAuth, so neither is a ready answer for making several subscriptions last longer. Auto, the Mac app for all your coding agents, uses the AI subscriptions you already pay for first, and Auto Pro includes usage each month, with 10% on paid models outside your plans.
How does LiteLLM compare to Portkey for routing between Cursor and Codex?
Both document a Cursor setup, and the difference is where the gateway runs: LiteLLM gives Cursor a virtual key and a proxy you host, and Portkey gives it a Portkey API key and its hosted endpoint. LiteLLM's Cursor guide points Cursor's Override OpenAI Base URL at your proxy's /cursor path, and because Cursor sends those requests from its own servers, the proxy must be reachable from the internet. Portkey's Cursor guide sets the base URL to https://api.portkey.ai/v1 and sends chat through a custom model. Watch Cursor's own limits: LiteLLM's page notes newer Cursor builds no longer show the override on every plan, and with its Azure fallback on, Cursor refuses Composer and Cursor Grok. For Codex, which accepts custom providers, Portkey's guide uses API keys. Checked on November 23, 2026.
If most of your spend is API keys, choose among the three above. If most of it is subscriptions you already pay for, OpenRouter alternatives for coding agents and LiteLLM alternatives for gateways and coding agents show where Auto fits.
What does a model router do for Claude Code and Codex?
A model router sits between your coding agent and providers and picks the model for each request. Claude Code sends requests wherever ANTHROPIC_BASE_URL points (docs), and Codex accepts custom providers under [model_providers.<id>] (docs). Codex model providers and config.toml, explained walks through that table.
Which routers use your ChatGPT or Claude plan?
Auto and Weave Router use the plans you already pay for before paid models; claude-code-router, LiteLLM and Portkey document passing a plan sign-in through; OpenRouter bills its own credits.
- Auto uses the AI subscriptions you already pay for first, in every coding agent you use, and gives those plans the work that needs them so they last longer. A subscription isn't required: Auto Pro gives every model, with usage included each month.
- Weave Router keeps Claude Code's sign-in for your Claude plan and Codex's ChatGPT sign-in for the OpenAI models it lists (install docs), and says it uses those flat-rate plans first (Weave).
- claude-code-router can import your local Claude Code sign-in or Codex auth file as a provider, or use API keys (docs).
- LiteLLM documents routing Claude Code signed in with a Claude Pro, Max, Team or Enterprise plan through its gateway (tutorial).
- Portkey lists Max plan and OAuth support for Claude Code (docs); its Codex guide uses API keys (docs).
- OpenRouter has guides for Claude Code and Codex; usage bills your OpenRouter credits.
How do the routers compare?
They differ most in how they choose a model, as of November 23, 2026:
| Tool | Uses your plans | Runs as |
|---|---|---|
| Auto | Yes, first | Mac app, macOS 14+, beta |
| claude-code-router | Imports Claude Code and Codex sign-ins | Local gateway: desktop app, CLI or Docker |
| Weave Router | Claude plan in Claude Code; ChatGPT plan for listed models in Codex | Hosted, or self-hosted |
| OpenRouter | No, bills OpenRouter credits | Hosted API |
| LiteLLM | Claude plans pass through | Self-hosted gateway |
| Portkey | Claude Max via Anthropic Direct | Hosted, or self-hosted gateway |
| Tool | Price (November 23, 2026) | How it picks the model |
|---|---|---|
| Auto | Free $0; Pro includes usage each month; paid models at provider price + 10%; Enterprise priced by seats | Your rules first, then a model that clears the quality bar for the request |
| claude-code-router | Open source (MIT), no fee listed | Your ordered rules or scripts |
| Weave Router | Hosted: credits plus 5.5%, or 5% on your own keys; Apache-2.0 to self-host | Scores every request with a cluster scorer |
| OpenRouter | List price; 5.5% fee on credit purchases (Standard) | Auto Code: a model and reasoning effort per request, tuned for coding |
| LiteLLM | Open source (MIT); Enterprise features need a license key | Auto router (beta): complexity tiers you map to models |
| Portkey | Developer free; Production $49/month (as of October 22) | Configs: conditions, weights, fallbacks |
| Built-in pickers | Your plan | You choose; opusplan switches by mode |
Auto applies your rules first, written in plain English, such as "Use Claude Opus 5.5 for UI work." Otherwise it only considers models that clear the quality bar for the request, and price decides between those. In the landing page's examples, a change across six files goes to Claude Opus 5.5 on the Claude plan, and a commit message goes to a low-cost open model without touching the plan. How AutoRouter picks a model covers the full order.
Every Auto request shows its model, what it cost and why, and you can rate a pick or choose a model yourself. Auto sometimes misjudges how hard a task is and has no published benchmarks of its own routing yet, though it builds teams a free benchmark of their own work, while Weave Router publishes its benchmark methodology. Does model routing make your results worse? looks at that risk.
The others document their methods: Weave Router, OpenRouter's Auto Router, LiteLLM's auto router, claude-code-router and Portkey's conditional routing. For one tool at a time, see Auto vs OpenRouter, Auto vs LiteLLM, Claude Code Router vs Auto and Auto vs Vercel AI Gateway; the comparisons page lists them all. Leaving one of them? OpenRouter alternatives for coding agents, LiteLLM alternatives for gateways and coding agents and Claude Code Router alternatives compare the options for each, and Not Diamond alternatives for model routing covers routers that recommend a model through an API.
What does each router cost?
Every option pays providers for work your plans don't cover. As a worked example at prices checked on November 23, 2026 (Portkey's on October 22), say that work comes to $100 at provider list prices in a month.
- Auto Pro: $100 plus 10% is $110. The first $20 comes from the usage included with Pro and $90 from credits, plus the Pro subscription.
- OpenRouter Standard: $100 plus the 5.5% fee on the credits you buy, so roughly $106 (pricing).
- Weave Router hosted: $100 plus the 5% platform fee on your own keys, so $105, or about $106 on Weave credits; its page doesn't say how requests on your plans count (Weave).
- Portkey: $100 to providers on your keys, plus $0 on Developer or $49 a month on Production (pricing).
- claude-code-router, LiteLLM or self-hosted Weave Router: $100 to providers on your keys, plus the machine and your time.
That 10% on paid models is how Auto earns. Price only decides between models that already clear the quality bar, your plans come first, and Auto earns nothing on plans.
An illustrative example week on Auto's landing page (November 6, 2026) has 30% hard, 45% medium and 25% quick tasks at Claude Opus, Sonnet and Haiku 5.5 list prices, with cached input at a tenth of the input price. Pro sends 85% of quick and 75% of medium tasks to open models, which its included usage pays for. In that example, Free does 1.8× the work of using a frontier model for everything, and Pro does 2.6×.
What do Claude Code and Codex do without a router?
Both apps let you pick and save models yourself, and Claude Code also switches models in plan mode and on server errors. What is an LLM router? explains the kinds of router these tools are built on.
- Claude Code:
/modeltakes aliases such asopusandsonnet;opusplanuses Opus in plan mode and Sonnet for execution;--fallback-modeltries up to three models when the main one is overloaded or unavailable (docs); and subagents can set their ownmodel(docs). - Codex:
/modelchooses the active model and, when available, reasoning effort (docs); a profile in~/.codex/<name>.config.tomlholds a model for one kind of work (docs).
# Claude Code: Opus while planning, Sonnet while executing
/model opusplan
# Claude Code: try Sonnet, then Haiku, if the main model is overloaded
claude --fallback-model sonnet,haiku
# Codex: start with ~/.codex/deep-review.config.toml
codex --profile deep-review
These cost nothing extra and keep you on your plan, but you do the routing. Auto adds a pick for every request and models from every provider in the same picker.
When is something other than Auto the better choice?
Choose another tool if you're not on a Mac, need prompts kept in your infrastructure, run a team on API keys, or use another coding agent.
- Not on a Mac: Auto needs macOS 14 or later. claude-code-router ships for macOS, Windows and Linux (README), Weave Router installs with
npx @weave-os/router(README), and LiteLLM runs in Docker (docs). - Prompts in your own infrastructure: requests to Auto pass through its servers on their way to each provider. Self-hosted LiteLLM keeps data in your infrastructure (docs), self-hosted Weave Router sends prompts straight to your provider (README), and claude-code-router listens on
127.0.0.1(README). - A team on API keys: LiteLLM adds virtual keys, spend tracking and budgets (docs), and Portkey offers hosted budgets, rate limits and logs (docs). For teams on Macs, Auto Enterprise, priced by seats, adds MDM rollout, allowed models, team budgets, zero data retention, spend by team, project or ticket, and SSO, SCIM and an audit log.
- One bill without plans: OpenRouter bills inference at list price across 600+ models as of November 23, 2026, and its Auto Router adds no fee (docs).
- Other coding agents: claude-code-router also supports OpenCode, Kilo Code, Grok CLI, Kimi CLI and Pi (README), and LiteLLM covers Claude Desktop (tutorial). Auto works with Codex, the Claude Code CLI, Cursor, Claude Desktop, T3, OpenCode, Pi and Terminal.
To try Auto, download it, sign in to your plans, allow Accessibility and click Enable for each app. Then choose AutoRouter as the model in a new session: from the model menu in Codex, or with /model in Claude Code.
For a local daemon and shared model aliases, see OpenLLM vs Auto. For a closer look at a standalone model router, read Not Diamond vs Auto. If your only goal is to use GPT in Claude Code, see claude-code-proxy vs Auto.
Questions
What is the best model router for a solo developer with several AI subscriptions?
Auto, the Mac app for all your coding agents, is the best fit in this ranking because it uses the plans you already pay for first and picks a model for each request. Weave Router is the closest alternative and runs on more operating systems, and claude-code-router suits you if you would rather write the rules yourself.
Does Claude Code have a built-in auto router?
No. Claude Code has no router that picks a model for each request; its closest options are opusplan, which uses Opus in plan mode and Sonnet to carry out the plan, --fallback-model for when the main model is overloaded, and a model setting per subagent (docs). For a pick on every request, choose AutoRouter in /model, or point Claude Code at OpenRouter's Auto Code or LiteLLM's auto router (beta) through their Claude Code guides.
Which router switches models when my Claude or ChatGPT plan hits its limit?
Auto Pro does: when a connected plan hits its limit, it keeps requests going from the $20 of monthly included usage until the plan resets, and asks you to top up if that runs out. Claude Code's --fallback-model doesn't switch on rate-limit or billing errors (docs), and OpenRouter sidesteps plan limits by billing its own credits.
How were these routers ranked?
Auto ranked them for one reader, a solo developer who already pays for AI subscriptions, using five criteria in order: plans used first, a model picked for each request, cost on the $100 worked example, number of setups supported, and how openly the picks are documented. Auto has a stake in the result, so the use-case table shows where another tool is the better choice, and every claim about another tool links to its own page.
Is LiteLLM's autorouter the same as Auto?
No, LiteLLM's auto router is a beta feature of the open-source LiteLLM gateway (docs), and OpenRouter's Auto Router is the openrouter/auto model (docs). Auto is a separate Mac app for all your coding agents.
Can I still pick a model myself?
Yes, every option here lets you pick a model yourself. In Auto, choosing a model in your app's picker sends requests straight to it, and AutoRouter routes only while it is the model selected.
What happens when my Claude or ChatGPT plan runs out?
With Auto Pro, when a connected plan hits its limit, Pro keeps those requests going from the monthly usage until the plan resets, and if that runs out too, Auto asks you to top up. Claude Code's own fallback chain doesn't switch models on rate-limit or billing errors (docs). How Claude Code usage limits work explains the limits.
Does Auto store my prompts?
Auto doesn't store transcripts, but it keeps the message that opens each request, up to 4,000 characters, to review routing, plus records of the model chosen, tokens and cost (privacy).
Which is cheapest: OpenRouter, LiteLLM or Portkey?
Self-hosted LiteLLM has no license fee, but you pay for the machine and your time. OpenRouter charges a 5.5% fee on credit purchases with a $0.80 minimum (OpenRouter), about $106 on the $100 worked example, and Portkey is free on Developer or from about $49 a month on Production, $149 on the same example.
Sources
- Auto
- Auto privacy
- claude-code-router README
- claude-code-router routing docs
- claude-code-router provider docs
- Weave Router README
- Weave Router install docs
- Weave Router product page
- Weave Router benchmark methodology
- OpenRouter: Claude Code integration
- OpenRouter: Codex CLI
- OpenRouter: Auto Router
- OpenRouter pricing
- LiteLLM: Auto Router with Claude Code and Claude Desktop
- LiteLLM: Auto Routing
- LiteLLM: Claude Code with a Claude subscription
- LiteLLM: docs overview
- LiteLLM: data security
- Portkey: Claude Code
- Portkey: Codex
- Portkey: conditional routing
- Portkey pricing
- Claude Code: model configuration
- Claude Code: subagents
- Codex: developer commands
- Codex: advanced configuration
- OpenRouter: OpenRouter vs Portkey
- API7: Portkey vs LiteLLM
- LiteLLM: Cursor integration
- Portkey: Cursor
- Claude Code: LLM gateways
- OpenRouter: Model Routing Benchmarks