<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Opper AI</title>
    <description>The latest articles on DEV Community by Opper AI (opper).</description>
    <link>https://dev.to/opper</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F14424%2F0659716e-4de0-46f2-95b1-19718db5511f.png</url>
      <title>DEV Community: Opper AI</title>
      <link>https://dev.to/opper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/opper"/>
    <language>en</language>
    <item>
      <title>Claude Code with any model: three ways to route it (incl. the 2-minute one)</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Thu, 20 Aug 2026 16:29:41 +0000</pubDate>
      <link>https://dev.to/opper/claude-code-with-any-model-three-ways-to-route-it-incl-the-2-minute-one-2md2</link>
      <guid>https://dev.to/opper/claude-code-with-any-model-three-ways-to-route-it-incl-the-2-minute-one-2md2</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;There are three ways to do this. I'll go from most configurable to least effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 1: claude-code-router
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/musistudio/claude-code-router" rel="noopener noreferrer"&gt;claude-code-router&lt;/a&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 2: point Claude Code at an Anthropic-compatible gateway
&lt;/h2&gt;

&lt;p&gt;Claude Code respects two environment variables, which means any gateway that speaks the Anthropic Messages API can sit behind it. I work at &lt;a href="https://opper.ai" rel="noopener noreferrer"&gt;Opper&lt;/a&gt;, an EU-hosted gateway that serves 700+ models through one API key, so that's what I'll use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://api.opper.ai/v3/compat"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_AUTH_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;your-opper-api-key&amp;gt;"&lt;/span&gt;
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the whole setup. Because the gateway also implements Anthropic's model-listing endpoint, the &lt;code&gt;/model&lt;/code&gt; picker inside Claude Code shows the live catalogue, so you can switch to &lt;code&gt;moonshot/kimi-k3&lt;/code&gt;, &lt;code&gt;openai/gpt-5.4&lt;/code&gt; or &lt;code&gt;gemini/gemini-3.5-flash&lt;/code&gt; mid-session instead of editing config files.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 3: one command
&lt;/h2&gt;

&lt;p&gt;If you don't want to manage env vars at all, the Opper CLI wires everything for you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @opperai/cli
opper launch claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;opper launch&lt;/code&gt; starts Claude Code with its inference already routed through the gateway. Pick a model at launch if you want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opper launch claude &lt;span class="nt"&gt;--model&lt;/span&gt; moonshot/kimi-k3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anything after the agent name is forwarded to Claude Code verbatim, so &lt;code&gt;opper launch claude --resume&lt;/code&gt; works exactly as you'd expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  The EU angle
&lt;/h2&gt;

&lt;p&gt;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 &lt;code&gt;vertexai/gemini-3.7-flash-eu&lt;/code&gt;, 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which one should you use?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You want per-task routing rules and love config: &lt;strong&gt;claude-code-router&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You want zero local moving parts and model switching from inside Claude Code: &lt;strong&gt;the two env vars&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You want the shortest path: &lt;strong&gt;&lt;code&gt;opper launch claude&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full model catalogue with prices and EU/US hosting per route is at &lt;a href="https://opper.ai/models" rel="noopener noreferrer"&gt;opper.ai/models&lt;/a&gt;. If you try this and something breaks, tell me in the comments, I maintain this setup daily.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>claudecode</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
