Model routers for Claude Code and Codex, compared
AutoRouter8 min read
AutoRouter, the Mac app for Codex and Claude Code, adds 20+ models to both apps as of October 2026, picks one for each turn after your own rules, uses your ChatGPT and Claude plans first, and shows each turn's model, what it cost and why. claude-code-router and LiteLLM are open-source gateways you run yourself. Weave Router scores each request, hosted or self-hosted; OpenRouter bills one balance of credits; and Portkey adds budgets and logs. For simple cases, Claude Code's opusplan and Codex profiles need nothing installed.
AutoRouter wrote this post, so weigh its rows accordingly. Claims about the other tools come from their own pages, linked where used and checked on October 22, 2026.
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).
Which routers use your ChatGPT or Claude plan?
AutoRouter 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.
- AutoRouter runs OpenAI models on your ChatGPT plan in Codex and Claude models on your Claude plan in Claude Code, and gives those plans the work that needs them so they last longer. A subscription isn't required: AutoRouter Pro gives every model, with $20 of included usage 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 October 22, 2026:
| Tool | Uses your plans | Runs as |
|---|---|---|
| AutoRouter | 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 (October 22, 2026) | How it picks the model |
|---|---|---|
| AutoRouter | Free $0; Pro $20/month with $20 of usage; paid models at provider price + 10%; Enterprise priced by seats | Your rules first, then a model that clears the quality bar for the turn |
| claude-code-router | Open source (MIT), no fee listed | Your ordered rules or scripts |
| Weave Router | Hosted: 5% of routed spend; Apache-2.0 to self-host | Scores every request with a cluster scorer |
| OpenRouter | List price; 5.5% fee on credit purchases (Standard) | Auto Router: about 30 task types, ranked by 7-day spend |
| 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 | Configs: conditions, weights, fallbacks |
| Built-in pickers | Your plan | You choose; opusplan switches by mode |
AutoRouter 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 turn, 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 AutoRouter turn shows its model, what it cost and why, and you can rate a pick or choose a model yourself. AutoRouter sometimes misjudges how hard a task is and has no published benchmarks yet, 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.
What does each router cost?
Every option pays providers for work your plans don't cover. As a worked example at prices checked on October 22, 2026, say those turns come to $100 at provider list prices in a month.
- AutoRouter Pro: $100 plus 10% is $110. The first $20 comes from the usage included with the $20 Pro fee and $90 from credits, so the month costs $110 with the fee.
- OpenRouter Standard: $100 plus the 5.5% fee on the credits you buy, so roughly $106 (pricing).
- Weave Router hosted: $100 plus 5% of routed spend, so $105; its page doesn't say how turns 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.
AutoRouter Pro costs the most on paid usage here, and that 10% on paid models is how AutoRouter earns. Price only decides between models that already clear the quality bar, your plans come first, and AutoRouter earns nothing on plans.
An illustrative example week on AutoRouter's landing page (October 22, 2026) has 30% hard, 45% medium and 25% quick turns 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 turns to open models, which its included usage pays for. In that example, Free does 1.9× the work of using a frontier model for everything, and Pro does 2.9×.
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.
- 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. AutoRouter adds a pick for every turn and models from every provider in the same picker.
When is something other than AutoRouter 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: AutoRouter 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 AutoRouter 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, AutoRouter 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 500+ models as of October 22, 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). AutoRouter works with Codex and the Claude Code CLI for now.
To try AutoRouter, 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.
Questions
Is LiteLLM's autorouter the same as AutoRouter?
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). AutoRouter is a separate Mac app for Codex and Claude Code by Fractal Works, Inc.
Can I still pick a model myself?
Yes, every option here lets you pick a model yourself. In AutoRouter, choosing a model in the Codex or Claude Code picker sends turns straight to it, and AutoRouter routes only while it is the model selected.
What happens when my Claude or ChatGPT plan runs out?
With AutoRouter Pro, when a ChatGPT or Claude plan hits its limit, Pro keeps those turns going from the monthly usage until the plan resets, and if that runs out too, AutoRouter 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 AutoRouter store my prompts?
AutoRouter doesn't store transcripts, but it keeps the message that opens each turn, up to 4,000 characters, to review routing, plus records of the model chosen, tokens and cost (privacy).
Sources
- AutoRouter
- AutoRouter 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