<?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: AirLLM</title>
    <description>The latest articles on DEV Community by AirLLM (@airllm).</description>
    <link>https://dev.to/airllm</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%2Fuser%2Fprofile_image%2F4267266%2F0811c340-fa9c-4d18-a2bb-319fa60f15d0.png</url>
      <title>DEV Community: AirLLM</title>
      <link>https://dev.to/airllm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/airllm"/>
    <language>en</language>
    <item>
      <title>How to Route Claude Code Through an LLM Router (Without Breaking Subagents)</title>
      <dc:creator>AirLLM</dc:creator>
      <pubDate>Fri, 27 Nov 2026 20:27:15 +0000</pubDate>
      <link>https://dev.to/airllm/how-to-route-claude-code-through-an-llm-router-without-breaking-subagents-3lki</link>
      <guid>https://dev.to/airllm/how-to-route-claude-code-through-an-llm-router-without-breaking-subagents-3lki</guid>
      <description>&lt;h1&gt;
  
  
  How to Route Claude Code Through an LLM Router (Without Breaking Subagents)
&lt;/h1&gt;

&lt;p&gt;If you point Claude Code at an LLM router and only set &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt;, the main loop often works, but background tasks and subagents ask for a model name the gateway does not know, and fail with "model not found".&lt;/p&gt;

&lt;p&gt;Claude Code can send its requests to an LLM router through the &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; variable. That one variable is what makes routers possible. This guide walks through a complete setup and explains each line so you can adapt it to whatever gateway you use.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a router changes (and what it doesn't)
&lt;/h2&gt;

&lt;p&gt;A coding session is not one request. Even a modest task — "add OAuth login and update the tests" — becomes a sequence of steps: understand the repository, design the flow, read configuration, edit the service, run tests, diagnose a failure, verify. Those steps do not all need the same intelligence.&lt;/p&gt;

&lt;p&gt;A coding-agent router sits between Claude Code and the model providers and decides, per request, which model should handle it.&lt;/p&gt;

&lt;p&gt;Full disclosure: we make AirLLM. Air Router, our routing layer, is used in the examples. Air Router gives every step the model it needs. Once an active task requires a stronger model tier, Air Router avoids moving that task to a weaker tier (&lt;a href="https://airllm.ai/air-router?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router" rel="noopener noreferrer"&gt;Air Router&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Your commands, slash commands, permissions and workflow stay the same. What changes is where the model requests go. Claude Code still runs the agent loop and the tools on your machine. The router only answers the model calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing airllm-auto or airllm-intelligent
&lt;/h2&gt;

&lt;p&gt;Before you change any settings, choose a routing alias.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;airllm-intelligent&lt;/code&gt; — use airllm-intelligent to route between appropriate Claude tiers without leaving the Claude model family.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;airllm-auto&lt;/code&gt; — the default for coding tools and agents. Picks a model per request across providers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Either way, use your AirLLM API key as &lt;code&gt;ANTHROPIC_AUTH_TOKEN&lt;/code&gt;. To use Air Router, set &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; to &lt;code&gt;https://api.airllm.ai/&lt;/code&gt;, set &lt;code&gt;ANTHROPIC_AUTH_TOKEN&lt;/code&gt; to your AirLLM API key, and set the model lines to a routing model. Requests are billed to your AirLLM account. Don't set only the base URL: AirLLM never needs Claude Code plan credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Get a key
&lt;/h2&gt;

&lt;p&gt;Sign in to the AirLLM dashboard and create an API key under &lt;strong&gt;API Keys&lt;/strong&gt;. (If you are using another gateway, get its key and base URL.) The Free plan is $0 / month. No credit card required to start (&lt;a href="https://airllm.ai/pricing?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router" rel="noopener noreferrer"&gt;pricing&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The quickest route is the AirLLM setup script, which writes these settings to &lt;code&gt;~/.claude/settings.json&lt;/code&gt; for you. It merges into your existing config without overwriting other settings; back up those files first if you want a copy. Safe to re-run: it updates its own entries instead of adding duplicates. Signed-in admins can skip the editing: &lt;strong&gt;API Keys → Quick Setup&lt;/strong&gt; downloads a copy with your key, model and tool already inside. Downloading the setup script from API Keys issues a new key, and the previous one stops working. The rest of this guide shows the same settings by hand, so you can see what each line does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Add the variables to your shell profile
&lt;/h2&gt;

&lt;p&gt;Check that Claude Code is installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;~/.zshrc&lt;/code&gt; (or &lt;code&gt;~/.bashrc&lt;/code&gt; on most Linux systems) and add:&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="kd"&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.airllm.ai/"&lt;/span&gt;
&lt;span class="kd"&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;"your_airllm_api_key"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;ANTHROPIC_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;ANTHROPIC_DEFAULT_HAIKU_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;ANTHROPIC_DEFAULT_SONNET_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;ANTHROPIC_DEFAULT_OPUS_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;ANTHROPIC_DEFAULT_FABLE_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CLAUDE_CODE_SUBAGENT_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CLAUDE_CODE_SUBAGENT_MODEL_FORCE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;API_TIMEOUT_MS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"3000000"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Line by line:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt;&lt;/strong&gt; — set it to &lt;code&gt;https://api.airllm.ai/&lt;/code&gt;. Claude Code appends &lt;code&gt;/v1/messages&lt;/code&gt; itself. Do not add a trailing &lt;code&gt;/v1&lt;/code&gt;; that is a common source of 404s.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ANTHROPIC_AUTH_TOKEN&lt;/code&gt;&lt;/strong&gt; — your AirLLM (or other gateway) API key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ANTHROPIC_MODEL&lt;/code&gt;&lt;/strong&gt; — the model for the main loop. &lt;code&gt;airllm-auto&lt;/code&gt; lets the router pick per request; use &lt;code&gt;airllm-intelligent&lt;/code&gt; to stay on Claude models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The four &lt;code&gt;ANTHROPIC_DEFAULT_*_MODEL&lt;/code&gt; lines and &lt;code&gt;CLAUDE_CODE_SUBAGENT_MODEL&lt;/code&gt;&lt;/strong&gt; — these are the ones people forget. Claude Code's background tasks and subagents use separate model settings. If the gateway does not recognise those names, those requests fail with "model not found". Mapping every tier to the same routing alias fixes that (&lt;a href="https://airllm.ai/developer-doc?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router" rel="noopener noreferrer"&gt;Developer Guide&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;CLAUDE_CODE_SUBAGENT_MODEL_FORCE&lt;/code&gt;, &lt;code&gt;API_TIMEOUT_MS&lt;/code&gt;, and &lt;code&gt;CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC&lt;/code&gt;&lt;/strong&gt; — included as shown in the official setup snippet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reload and start:&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;source&lt;/span&gt; ~/.zshrc
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$ANTHROPIC_BASE_URL&lt;/span&gt;
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;p&gt;The Developer Guide documents the same variables as user-level environment variables. In PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ANTHROPIC_BASE_URL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"https://api.airllm.ai/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ANTHROPIC_AUTH_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"your_airllm_api_key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ANTHROPIC_MODEL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ANTHROPIC_DEFAULT_HAIKU_MODEL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ANTHROPIC_DEFAULT_SONNET_MODEL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ANTHROPIC_DEFAULT_OPUS_MODEL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ANTHROPIC_DEFAULT_FABLE_MODEL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"CLAUDE_CODE_SUBAGENT_MODEL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"airllm-auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"CLAUDE_CODE_SUBAGENT_MODEL_FORCE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"API_TIMEOUT_MS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"3000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;SetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"User"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open a new PowerShell window, then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;
&lt;span class="n"&gt;claude&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are running Claude Code inside WSL, set the variables inside WSL with the macOS/Linux steps instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Pick a routing alias
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Alias&lt;/th&gt;
&lt;th&gt;What it routes between&lt;/th&gt;
&lt;th&gt;When to use it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;airllm-auto&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Default for coding tools and agents. Picks a model per request across providers.&lt;/td&gt;
&lt;td&gt;You want the router to choose freely across providers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;airllm-intelligent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Routes each coding step between appropriate Claude tiers, without leaving the Claude model family&lt;/td&gt;
&lt;td&gt;You want to stay on Claude models&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;To use &lt;code&gt;airllm-intelligent&lt;/code&gt;, replace &lt;code&gt;airllm-auto&lt;/code&gt; in every model line of the snippet. Other routing aliases (&lt;code&gt;airllm-advanced&lt;/code&gt;, &lt;code&gt;airllm-agent&lt;/code&gt;) are documented in the &lt;a href="https://airllm.ai/developer-doc?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router" rel="noopener noreferrer"&gt;Developer Guide&lt;/a&gt;; &lt;code&gt;airllm-coding&lt;/code&gt; and &lt;code&gt;airllm-thinking&lt;/code&gt; are chat aliases, not for coding agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Check that it works
&lt;/h2&gt;

&lt;p&gt;Send a small, verifiable prompt from Claude Code:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a simple Java method to validate an email address.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then open your AirLLM dashboard: the request should appear in your usage logs. The setup is working when the request shows up there with the expected route and model, and Claude Code gets a response. If nothing shows up, Claude Code is still talking to another endpoint, usually because the shell was not reloaded or a different terminal is open.&lt;/p&gt;

&lt;p&gt;If you want to test the key outside Claude Code first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.airllm.ai/v1/chat/completions \
  -H &lt;span class="s2"&gt;"Authorization: Bearer your_airllm_api_key"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"model":"airllm-auto","messages":[{"role":"user","content":"Write a simple Java method to validate an email address."}]}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: when you set a custom &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt;, Claude Code turns MCP tool search off by default (set &lt;code&gt;ENABLE_TOOL_SEARCH=true&lt;/code&gt; to turn it back on) and disables Remote Control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;"model not found" from a subagent&lt;/strong&gt; — one of the model lines still names a model the gateway does not recognise. Set all five extra model lines (the four &lt;code&gt;ANTHROPIC_DEFAULT_*_MODEL&lt;/code&gt; variables and &lt;code&gt;CLAUDE_CODE_SUBAGENT_MODEL&lt;/code&gt;) to the same &lt;code&gt;airllm-*&lt;/code&gt; alias.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No request in your AirLLM logs, or Claude Code still seems to use your subscription&lt;/strong&gt; — confirm the variables are exported in the shell you launched from (&lt;code&gt;echo $ANTHROPIC_BASE_URL&lt;/code&gt; or &lt;code&gt;echo $env:ANTHROPIC_BASE_URL&lt;/code&gt;). Starting from an IDE terminal that did not source your profile is a common cause; writing &lt;code&gt;~/.claude/settings.json&lt;/code&gt; avoids it. Also check Windows vs WSL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;404 on every request&lt;/strong&gt; — the base URL is wrong. Claude Code takes &lt;code&gt;https://api.airllm.ai/&lt;/code&gt; without &lt;code&gt;/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;401 Unauthorized&lt;/strong&gt; — the key is missing or wrong. Check &lt;code&gt;ANTHROPIC_AUTH_TOKEN&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A model you named returns a message saying it is disabled by your organization&lt;/strong&gt; — an admin has blocked it in Model Governance. On AirLLM this comes back as a normal 200 reply, in your tool's own format, whose text is: &lt;code&gt;The model '&amp;lt;id&amp;gt;' is disabled by your organization. Check with your administrator to enable it.&lt;/code&gt; The tool shows it instead of retrying.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Cost habits that still matter
&lt;/h2&gt;

&lt;p&gt;A router is not a substitute for good session hygiene. Run &lt;code&gt;/clear&lt;/code&gt; between unrelated tasks and &lt;code&gt;/compact&lt;/code&gt; with a focus in long sessions. Keep &lt;code&gt;CLAUDE.md&lt;/code&gt; short and turn off unused MCP servers.&lt;/p&gt;

&lt;p&gt;Avoid switching models by hand in the middle of a long session — the new model cannot reuse the previous model's prompt cache. As Air Router puts it: The Lowest-Priced Model Isn't Always the Cheapest Request. (A follow-up article covers the arithmetic.)&lt;/p&gt;

&lt;p&gt;Our guide on &lt;a href="https://airllm.ai/reduce-claude-code-costs?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router" rel="noopener noreferrer"&gt;how to reduce Claude Code costs&lt;/a&gt; goes into more detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Developer Guide, including every supported tool: &lt;a href="https://airllm.ai/developer-doc?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router" rel="noopener noreferrer"&gt;https://airllm.ai/developer-doc?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Claude Code router page: &lt;a href="https://airllm.ai/claude-code-router?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router" rel="noopener noreferrer"&gt;https://airllm.ai/claude-code-router?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Start free (No credit card required to start): &lt;a href="https://airllm.ai/pricing?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router" rel="noopener noreferrer"&gt;https://airllm.ai/pricing?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-router&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>claude</category>
      <category>llm</category>
      <category>ai</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
