<?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: xiaohan lin (Ethan lin)</title>
    <description>The latest articles on DEV Community by xiaohan lin (Ethan lin) (@ethanlinxh).</description>
    <link>https://dev.to/ethanlinxh</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%2F4028972%2Fc93529da-b49f-488c-a684-814c4c9a3e71.jpg</url>
      <title>DEV Community: xiaohan lin (Ethan lin)</title>
      <link>https://dev.to/ethanlinxh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ethanlinxh"/>
    <language>en</language>
    <item>
      <title>Point Claude Code at Any Model: One Base URL</title>
      <dc:creator>xiaohan lin (Ethan lin)</dc:creator>
      <pubDate>Wed, 15 Jul 2026 08:02:39 +0000</pubDate>
      <link>https://dev.to/ethanlinxh/point-claude-code-at-any-model-one-base-url-4m1f</link>
      <guid>https://dev.to/ethanlinxh/point-claude-code-at-any-model-one-base-url-4m1f</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyv4lq570dck71nvh4zn7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyv4lq570dck71nvh4zn7.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://glideflowai.com/blog/point-claude-code-at-any-model-one-base-url" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — Run GLM-5.2, Qwen, or Kimi inside Claude Code by changing three environment variables. The easy-to-miss detail: &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; takes the host &lt;strong&gt;without&lt;/strong&gt; &lt;code&gt;/v1&lt;/code&gt;. Full setup, verification steps, and troubleshooting below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude Code is most useful when the feedback loop is short: give it a repository task, let it inspect and edit under your controls, then run the tests. The model choice is part of that loop. You may want a long-context coding route for a large codebase, an agentic coding route for a multi-step change, or a different route for a lower-risk maintenance task.&lt;/p&gt;

&lt;p&gt;The safe way to experiment is to change configuration, verify a small request, and then run the same repository task with a fixed budget. This is a configuration guide, not a claim that different models produce the same results. Model behavior, context support, tool use, and cost differ by route. Keep your normal code-review and test process in place.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two compatible endpoint shapes to keep straight
&lt;/h2&gt;

&lt;p&gt;There are two related but distinct settings in this guide.&lt;/p&gt;

&lt;p&gt;For an OpenAI-compatible SDK or a direct chat-completions test, use the versioned URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.glideflowai.com/v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude Code itself uses an Anthropic-compatible connection configuration. For &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt;, use the host &lt;strong&gt;without&lt;/strong&gt; &lt;code&gt;/v1&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.glideflowai.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This distinction matters. Appending &lt;code&gt;/v1&lt;/code&gt; to &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; is a common configuration error. The model selection is still explicit through &lt;code&gt;ANTHROPIC_MODEL&lt;/code&gt;. Copy an exact ID from the &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;model catalog&lt;/a&gt; rather than relying on a display name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you change anything
&lt;/h2&gt;

&lt;p&gt;Have these four things ready:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A local Claude Code installation.&lt;/li&gt;
&lt;li&gt;A GlideflowAI API key created in the &lt;a href="https://app.glideflowai.com" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A small non-sensitive repository or a disposable branch for the first agent run.&lt;/li&gt;
&lt;li&gt;A model ID from the catalog. This article starts with &lt;code&gt;glm-5.2&lt;/code&gt; because it is listed for long-context coding; it is a starting point, not a universal recommendation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep the key in your shell environment or local settings file. Do not commit it, paste it into a browser bundle, or include it in screenshots. If you use a secret manager, point your shell configuration at the injected value rather than copying the key into a repository-specific file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fastest path: configure one shell session
&lt;/h2&gt;

&lt;p&gt;Use these exports for a one-session test:&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.glideflowai.com"&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;"sk-your-key"&lt;/span&gt;
&lt;span class="nb"&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;"glm-5.2"&lt;/span&gt;

claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside Claude Code, begin with something observable and low-risk, such as “inspect the repository and list the test commands; do not edit files.” Confirm the model name in the session information if your version exposes it, then ask the tool to make a small change on a branch and run the relevant test.&lt;/p&gt;

&lt;p&gt;This is intentionally a narrow validation. It tells you that the credential, endpoint, and selected model can establish a session. It does not prove that a route is suitable for every project or that it will always complete an agent loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Persist the configuration locally
&lt;/h2&gt;

&lt;p&gt;If the session test works, you can persist the same values in Claude Code’s settings file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ANTHROPIC_BASE_URL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.glideflowai.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ANTHROPIC_AUTH_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sk-your-key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ANTHROPIC_MODEL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"glm-5.2"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this as &lt;code&gt;~/.claude/settings.json&lt;/code&gt; if that is the settings location used by your installation. Merge the &lt;code&gt;env&lt;/code&gt; object with existing settings rather than overwriting unrelated configuration. If your team manages environment variables centrally, prefer that mechanism; it keeps credentials out of dotfiles that could be copied between machines.&lt;/p&gt;

&lt;p&gt;To change routes later, change only the model value and repeat the same validation task:&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_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"kimi-k2.7-code"&lt;/span&gt;
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Model IDs are case- and punctuation-sensitive. For the current menu, use the &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;catalog&lt;/a&gt;, not a model name from an old terminal history or social post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Select models by the task, then test them
&lt;/h2&gt;

&lt;p&gt;It is tempting to call one model “the coding model” and leave the configuration there. Coding agents make that fragile: a task that involves repository-wide reading is different from a constrained refactor or a sequence of tool calls.&lt;/p&gt;

&lt;p&gt;Start by assigning a hypothesis to each route. &lt;code&gt;glm-5.2&lt;/code&gt; is described in the catalog as a long-context coding model for coding agents, tool use, and large-document workflows. &lt;code&gt;kimi-k2.7-code&lt;/code&gt; is described as coding-focused for agentic programming and repository-level edits. Qwen3.7 routes can be evaluated for planning, multimodal automation, or lower-cost experimentation according to their catalog descriptions and your own test results.&lt;/p&gt;

&lt;p&gt;Then give every route the same task:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check out a clean branch with a known failing test or a small requested change.&lt;/li&gt;
&lt;li&gt;Give Claude Code the same prompt, file scope, and tool permissions.&lt;/li&gt;
&lt;li&gt;Set the same maximum number of turns or time budget, if your workflow supports it.&lt;/li&gt;
&lt;li&gt;Record whether the tests passed, how many retries occurred, and what you had to fix manually.&lt;/li&gt;
&lt;li&gt;Record input and output token usage separately.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The final item matters because agent runs can be output-heavy. Public menu prices are listed per million tokens; calculate input and output separately rather than relying on a single blended figure.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model route&lt;/th&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;Public reference link&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GLM-5.2&lt;/td&gt;
&lt;td&gt;$0.90&lt;/td&gt;
&lt;td&gt;$2.95&lt;/td&gt;
&lt;td&gt;&lt;a href="https://docs.z.ai/guides/overview/pricing" rel="noopener noreferrer"&gt;Z.ai pricing&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi K2.7 Code&lt;/td&gt;
&lt;td&gt;$0.699&lt;/td&gt;
&lt;td&gt;$3.00&lt;/td&gt;
&lt;td&gt;&lt;a href="https://www.alibabacloud.com/help/en/model-studio/model-pricing" rel="noopener noreferrer"&gt;Alibaba Model Studio pricing&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.7-Plus&lt;/td&gt;
&lt;td&gt;$0.247&lt;/td&gt;
&lt;td&gt;$1.20&lt;/td&gt;
&lt;td&gt;&lt;a href="https://www.alibabacloud.com/help/en/model-studio/model-pricing" rel="noopener noreferrer"&gt;Alibaba Model Studio pricing&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Those rows are transparent menu data, not a performance score. Check the catalog for current values before using them in a budget model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify the same key outside Claude Code
&lt;/h2&gt;

&lt;p&gt;When a configuration fails, separate the client problem from the API problem. The direct OpenAI-compatible endpoint uses &lt;code&gt;/v1&lt;/code&gt;; test it with a small &lt;code&gt;curl&lt;/code&gt; request before changing several settings at once.&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.glideflowai.com/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer sk-your-key"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "model":"glm-5.2",
    "messages":[{"role":"user","content":"Say OK."}],
    "max_tokens":512
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use at least &lt;code&gt;512&lt;/code&gt; output tokens for a first test with a reasoning-oriented model. Very small limits can be consumed before visible text is emitted, which makes a valid request look like an empty answer.&lt;/p&gt;

&lt;p&gt;The matching Python check uses the OpenAI SDK shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sk-your-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.glideflowai.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;glm-5.2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Say OK.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;512&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;OpenAI&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;openai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GLIDEFLOW_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.glideflowai.com/v1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;glm-5.2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Say OK.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}],&lt;/span&gt;
  &lt;span class="na"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;512&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The direct check is not a real Claude Code run. It narrows the problem: if &lt;code&gt;curl&lt;/code&gt; works but Claude Code does not, re-check the Anthropic-compatible base URL and the environment seen by the &lt;code&gt;claude&lt;/code&gt; process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Switching models without losing the experiment
&lt;/h2&gt;

&lt;p&gt;Changing the model ID is easy; comparing model runs rigorously requires discipline. Create a small log in the repository or your issue tracker with fields for task, commit, model ID, input tokens, output tokens, tool turns, test result, and manual cleanup. Include the prompt. If you change the prompt midway through a run, note that too.&lt;/p&gt;

&lt;p&gt;For example, a useful test prompt might be: “In this branch, identify why the named unit test fails. Make the smallest fix. Run only the relevant test. Explain the changed files and stop if the test still fails.” It gives the agent a bounded goal and gives you a repeatable result across routes.&lt;/p&gt;

&lt;p&gt;Avoid switching a production repository’s default model after one impressive demo. Use a branch, keep write permissions constrained, review the diff, and retain a known-good configuration. The gateway makes configuration changes relatively small; it does not make model output safe to merge without review.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  The endpoint is wrong
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; must be &lt;code&gt;https://api.glideflowai.com&lt;/code&gt; with no &lt;code&gt;/v1&lt;/code&gt;. The OpenAI SDK and curl examples use &lt;code&gt;https://api.glideflowai.com/v1&lt;/code&gt;. These are different settings for different protocol paths.&lt;/p&gt;

&lt;h3&gt;
  
  
  The model ID is wrong or unavailable to the key
&lt;/h3&gt;

&lt;p&gt;Copy the exact model ID from &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;the catalog&lt;/a&gt;. An HTTP 503 response containing &lt;code&gt;无可用渠道&lt;/code&gt; means the ID is incorrect or is not enabled for the key; it is not an instruction to keep retrying the same request.&lt;/p&gt;

&lt;h3&gt;
  
  
  The response has no visible text
&lt;/h3&gt;

&lt;p&gt;Increase the output-token allowance to at least 512 for the first check. A reasoning-oriented route may use a very small limit before returning visible content.&lt;/p&gt;

&lt;h3&gt;
  
  
  The key is present in one terminal but not another
&lt;/h3&gt;

&lt;p&gt;Run &lt;code&gt;claude&lt;/code&gt; from the same shell session where the export was set, or confirm that your launcher inherits the environment. Do not print a full key into logs while debugging.&lt;/p&gt;

&lt;h3&gt;
  
  
  The agent’s behavior changed after the connection succeeded
&lt;/h3&gt;

&lt;p&gt;That is a model-evaluation question, not necessarily a configuration fault. Reduce the task, capture the prompt and tool output, compare against the same test on another route, and keep the result as evidence rather than extrapolating from one run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep configuration separate from repository policy
&lt;/h2&gt;

&lt;p&gt;Pointing Claude Code at a compatible endpoint changes how the tool reaches a model. It should not silently change the policies around your repository. Keep the same branch protection, code-review expectations, and test requirements that you would use with the default configuration. In particular, do not grant broader filesystem or shell permissions merely because an experiment needs to complete quickly. A narrow first task is valuable precisely because it tests the integration without increasing the blast radius.&lt;/p&gt;

&lt;p&gt;For a team project, write down the configuration contract next to the experiment record: the tool version, the endpoint type, the model ID, the environment-variable names, and the date of the test. Do not store the key itself. This gives another developer enough information to reproduce the setup while preserving normal credential handling. It also prevents an ambiguous report such as “Claude Code stopped working after an upgrade,” where nobody knows whether the change was in the client, the model ID, or the inherited shell environment.&lt;/p&gt;

&lt;p&gt;If a model route is selected for a recurring task, make the choice explicit in the project instructions rather than relying on one developer’s terminal history. Describe the task class and the validation requirement, for example: “use this route only for documentation edits; run the docs build before proposing a change.” That is more durable than calling any one model a general default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diagnose failures one variable at a time
&lt;/h2&gt;

&lt;p&gt;When an agent session does not start, avoid changing the endpoint, key, model ID, and prompt together. First confirm that the shell contains the expected variable names without printing the credential. Then run the direct API connectivity check. Next, verify the Claude Code base URL has no &lt;code&gt;/v1&lt;/code&gt;. Finally, copy a known catalog model ID and retry with the small “OK” prompt.&lt;/p&gt;

&lt;p&gt;When a session starts but an edit run goes badly, preserve the transcript before trying again. Was the model asked to operate outside the stated file scope? Did a test command fail because of local dependencies? Did the agent stop because the turn or output limit was reached? These are actionable observations. They are more useful than attributing every unsuccessful run to the route itself.&lt;/p&gt;

&lt;p&gt;For longer tasks, give the agent checkpoints: inspect first, propose a plan, make the smallest edit, run the named test, and summarize. Checkpoints create natural places to stop an expensive or confused run. They also produce a review trail that makes later comparisons between configurations fairer.&lt;/p&gt;

&lt;p&gt;Finally, keep the first successful configuration deliberately boring. Use one documented model ID, one small repository task, and one observable test command. Only after that baseline is repeatable should you try a larger prompt, a different model route, or broader tool permissions. This sequence may feel slower than copying a configuration snippet into a production repository, but it tells you exactly what changed when an agent run succeeds or fails. It also gives reviewers a compact diff, a known command to rerun, and a clear boundary for deciding whether the configuration is appropriate for a wider team workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next steps
&lt;/h2&gt;

&lt;p&gt;Once your first session is working, browse the &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;current model menu&lt;/a&gt; and retain only the two or three routes that your repository tests support. The companion guide, &lt;a href="https://glideflowai.com/blog/cheapest-openai-compatible-llm-gateways-coding-agents-2026" rel="noopener noreferrer"&gt;choosing an OpenAI-compatible gateway for coding agents&lt;/a&gt;, explains how to account for token usage. For model-specific selection, read &lt;a href="https://glideflowai.com/blog/claude-sonnet-5-alternatives-coding-agents-glm-kimi-qwen" rel="noopener noreferrer"&gt;GLM-5.2 vs Kimi K2.7 vs Qwen3.7 for coding agents&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
