Urgent.News

What's breaking now, across thousands of outlets.

Editions

AI

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

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…

Claude Code is currently the leading agentic coding interface. However, it currently only works with Anthropic's API and billing. There are times when you may want to use a different model, such as Kimi K3 for cost-effective long sessions, GPT-5.4 for cross-checking, or Gemini 3.7 Flash for speed. There are three ways to achieve this, ranging from most configurable to least effort.

Option 1 involves using claude-code-router, a community tool that allows for per-task routing rules, request transformers, and plugins. This option is powerful, but it requires setting up a local proxy with a JSON config and maintaining API keys for every provider you route to. This setup can be quite cumbersome for a team.

Option 2 is to point Claude Code at an Anthropic-compatible gateway. Claude Code respects two environment variables, so any gateway that speaks the Anthropic Messages API can be integrated. For example, Opper, an EU-hosted gateway that serves over 700 models through one API key, can be used. By exporting the appropriate environment variables, Claude Code can switch to different models mid-session without having to edit config files.

Option 3 is the simplest solution, requiring no additional setup. The Opper CLI can launch Claude Code with the inference already routed through the gateway. Simply use the command `opper launch claude --model moonshot/kimi-k3` to launch Claude Code with the specified model. This option is ideal for those who don't want to manage environment variables or set up any additional infrastructure.

If your business operates in Europe, this setup offers an additional benefit. Opper runs in the EU and marks which routes are EU-hosted. This ensures that the tokens do not leave Europe, which can be crucial for B2B contexts where legal and regulatory considerations are paramount. To explore the full model catalogue, including prices and EU/US hosting per route, visit opper.ai/models.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Thursday 20 August →