cd /news/developer-tools/claude-code-with-any-model-three-way… · home topics developer-tools article
[ARTICLE · art-104785] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Claude Code with any model: three ways to route it (incl. the 2-minute one)

Claude Code, the agentic coding interface, can be routed to alternative models such as Kimi K3, GPT-5.4, and Gemini 3.7 Flash using environment variables or the Opper CLI. Opper, an EU-hosted gateway, provides a unified API key for over 700 models and supports EU-hosted routes, addressing data residency requirements for European clients.

read2 min views4 publishedAug 20, 2026

Claude Code is the best agentic coding interface right now, but out of the box it only talks to Anthropic's API with Anthropic billing. Sometimes you want the same interface with a different brain: Kimi K3 for cheap long sessions, GPT-5.4 to cross-check a plan, Gemini 3.7 Flash for speed, or simply a model that runs on EU infrastructure because your client requires it.

There are three ways to do this. I'll go from most configurable to least effort.

claude-code-router is the community answer, and it's genuinely powerful: per-task routing rules, request transformers, plugins. If you want "background tasks go to a cheap model, planning goes to a big one," this is your tool.

The tradeoff is that you run and maintain a local proxy with a JSON config, and you still need API keys for every provider you route to. For a team setup that's real overhead.

Claude Code respects two environment variables, which means any gateway that speaks the Anthropic Messages API can sit behind it. I work at Opper, an EU-hosted gateway that serves 700+ models through one API key, so that's what I'll use:

export ANTHROPIC_BASE_URL="https://api.opper.ai/v3/compat"
export ANTHROPIC_AUTH_TOKEN="<your-opper-api-key>"
claude

That's the whole setup. Because the gateway also implements Anthropic's model-listing endpoint, the /model

picker inside Claude Code shows the live catalogue, so you can switch to moonshot/kimi-k3

, openai/gpt-5.4

or gemini/gemini-3.5-flash

mid-session instead of editing config files.

Two things I like about this over a local proxy: there's nothing running on your machine, and billing is unified, one balance across every model with token prices matching what the providers charge.

If you don't want to manage env vars at all, the Opper CLI wires everything for you:

npm install -g @opperai/cli
opper launch claude

opper launch

starts Claude Code with its inference already routed through the gateway. Pick a model at launch if you want:

opper launch claude --model moonshot/kimi-k3

Anything after the agent name is forwarded to Claude Code verbatim, so opper launch claude --resume

works exactly as you'd expect.

If you build for European customers, this setup solves a second problem for free. Opper runs in the EU, and the catalogue marks which routes are EU-hosted, including EU variants of frontier models (for example vertexai/gemini-3.7-flash-eu

, or Claude served from European Vertex regions). Same Claude Code workflow, but the tokens don't leave Europe, which is the difference between "we should check with legal" and "approved" in a lot of B2B contexts.

opper launch claude

The full model catalogue with prices and EU/US hosting per route is at opper.ai/models. If you try this and something breaks, tell me in the comments, I maintain this setup daily.

── more in #developer-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-with-any…] indexed:0 read:2min 2026-08-20 ·