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.