<?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: XHuoAPI</title>
    <description>The latest articles on DEV Community by XHuoAPI (@xhuoapi).</description>
    <link>https://dev.to/xhuoapi</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%2F4176341%2F7500cace-4a4e-4e70-80fa-ccbdc7f21627.png</url>
      <title>DEV Community: XHuoAPI</title>
      <link>https://dev.to/xhuoapi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xhuoapi"/>
    <language>en</language>
    <item>
      <title>deepseek-v4.1-flash-1017 fixing a real bug in Claude Code and OpenCode, and what each run cost</title>
      <dc:creator>XHuoAPI</dc:creator>
      <pubDate>Tue, 27 Oct 2026 09:27:43 +0000</pubDate>
      <link>https://dev.to/xhuoapi/deepseek-v41-flash-1017-fixing-a-real-bug-in-claude-code-and-opencode-and-what-each-run-cost-453j</link>
      <guid>https://dev.to/xhuoapi/deepseek-v41-flash-1017-fixing-a-real-bug-in-claude-code-and-opencode-and-what-each-run-cost-453j</guid>
      <description>&lt;p&gt;DeepSeek's October 17 snapshot of V4.1 Flash is the model behind the &lt;code&gt;deepseek-flash&lt;/code&gt; name on DeepSeek's API, and it is now callable under its pinned ID &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt; on XHuoAPI. Pinning the snapshot matters for agents: the behaviour you tested is the behaviour you keep.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I run XHuoAPI. DeepSeek's own prices are listed next to ours, with the source, so you can compare.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The test: fix a failing test, six times
&lt;/h2&gt;

&lt;p&gt;A tiny Node project with one bug: orders of $50 or more should have no shipping fee, but &lt;code&gt;total &amp;gt; 50&lt;/code&gt; charges a $50 order. Each tool got the same prompt, "The test in shipping.test.js fails. Find the bug in shipping.js and fix it", and a run counted only if &lt;code&gt;node --test&lt;/code&gt; passed afterwards.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Passed&lt;/th&gt;
&lt;th&gt;Time per run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code (Anthropic Messages format)&lt;/td&gt;
&lt;td&gt;2.1.310&lt;/td&gt;
&lt;td&gt;3 / 3&lt;/td&gt;
&lt;td&gt;25–43 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenCode 2 (OpenAI Chat Completions format)&lt;/td&gt;
&lt;td&gt;2.1.3&lt;/td&gt;
&lt;td&gt;3 / 3&lt;/td&gt;
&lt;td&gt;20–49 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every run found the &lt;code&gt;&amp;gt;&lt;/code&gt; vs &lt;code&gt;&amp;gt;=&lt;/code&gt; mistake and made a one-character edit.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a run cost
&lt;/h2&gt;

&lt;p&gt;Claude Code sent about 58k–71k input tokens per run (most of it Claude Code's own system prompt and tool definitions) and got 550–750 output tokens back. At XHuoAPI's Standard price that is about &lt;strong&gt;$0.02 per run at peak hours and about half that off-peak&lt;/strong&gt;, before any cache discount.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prices (USD per 1M tokens, checked 2026-10-26)
&lt;/h2&gt;

&lt;p&gt;DeepSeek bills peak hours (01:00–04:00 and 06:00–10:00 UTC, Monday to Friday) at twice the off-peak rate. XHuoAPI uses the same hours for DeepSeek models.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Where&lt;/th&gt;
&lt;th&gt;Model ID&lt;/th&gt;
&lt;th&gt;Peak in / out&lt;/th&gt;
&lt;th&gt;Off-peak in / out&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DeepSeek API (&lt;a href="https://api-docs.deepseek.com/quick_start/pricing" rel="noopener noreferrer"&gt;source&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;deepseek-flash&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.30 / $1.20&lt;/td&gt;
&lt;td&gt;$0.15 / $0.60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XHuoAPI Standard, the default tier (&lt;a href="https://xhuoapi.ai/en/models/deepseek-v4.1-flash-1017.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-1017" rel="noopener noreferrer"&gt;source&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.24 / $0.96&lt;/td&gt;
&lt;td&gt;$0.12 / $0.48&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XHuoAPI Saver&lt;/td&gt;
&lt;td&gt;same&lt;/td&gt;
&lt;td&gt;$0.15 / $0.60&lt;/td&gt;
&lt;td&gt;$0.075 / $0.30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XHuoAPI Spot&lt;/td&gt;
&lt;td&gt;same&lt;/td&gt;
&lt;td&gt;$0.09 / $0.36&lt;/td&gt;
&lt;td&gt;$0.045 / $0.18&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Cheaper tiers trade stability for price. The same key also calls Qwen, GLM, Kimi, GPT and Claude.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Claude Code&lt;/strong&gt; (leave &lt;code&gt;/v1&lt;/code&gt; off the base URL):&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;https://api.xhuoapi.ai
&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;YOUR_KEY
&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;deepseek-v4.1-flash-1017
&lt;span class="nb"&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;deepseek-v4.1-flash-1017
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;OpenCode 2&lt;/strong&gt;, &lt;code&gt;opencode.jsonc&lt;/code&gt;:&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;"$schema"&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://opencode.ai/config.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"providers"&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;"xhuoapi"&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;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"XHuoAPI"&lt;/span&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="s2"&gt;"XHUOAPI_API_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;"package"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@opencode/ai/providers/openai-compatible"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"settings"&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;"baseURL"&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.xhuoapi.ai/v1"&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;"models"&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;"deepseek-v4.1-flash-1017"&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;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"DeepSeek V4.1 Flash 1017"&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;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="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;Run it with &lt;code&gt;opencode run -m xhuoapi/deepseek-v4.1-flash-1017 "..."&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Thinking is on by default; &lt;code&gt;thinking: {"type": "disabled"}&lt;/code&gt; turns it off on our endpoint. Batch jobs are cheaper off-peak on both DeepSeek and XHuoAPI.&lt;/p&gt;

&lt;p&gt;Full comparison (DeepSeek, DeepInfra, OpenRouter, XHuoAPI): &lt;a href="https://xhuoapi.ai/en/guides/deepseek-api-outside-china.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-1017" rel="noopener noreferrer"&gt;https://xhuoapi.ai/en/guides/deepseek-api-outside-china.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-1017&lt;/a&gt;&lt;br&gt;
Per-tool test results: &lt;a href="https://xhuoapi.ai/en/guides/chinese-models-in-coding-agents.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-1017" rel="noopener noreferrer"&gt;https://xhuoapi.ai/en/guides/chinese-models-in-coding-agents.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-1017&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deepseek</category>
      <category>claudecode</category>
      <category>opencode</category>
      <category>ai</category>
    </item>
    <item>
      <title>DeepSeek V4.1 Flash in Claude Code and OpenCode: setup, test runs, and what it costs on four platforms</title>
      <dc:creator>XHuoAPI</dc:creator>
      <pubDate>Sat, 24 Oct 2026 07:35:44 +0000</pubDate>
      <link>https://dev.to/xhuoapi/deepseek-v41-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-costs-on-four-4jjm</link>
      <guid>https://dev.to/xhuoapi/deepseek-v41-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-costs-on-four-4jjm</guid>
      <description>&lt;p&gt;DeepSeek's newest Flash snapshot (V4.1 Flash 1017) is now what you get behind the &lt;code&gt;deepseek-flash&lt;/code&gt; model name on DeepSeek's API. I wanted two answers: does it hold up as the model behind a coding agent, and what does it actually cost depending on where you call it?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I run XHuoAPI, one of the four places compared below. Prices for all four are listed with sources so you can check them yourself.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Does it work in coding agents?
&lt;/h2&gt;

&lt;p&gt;I ran the same small task three times in each tool: in an empty folder, "Create a file hello.py that prints 'hello from xhuo'", and counted a run as passed only if the file existed with the right content.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Passed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code (Anthropic Messages format)&lt;/td&gt;
&lt;td&gt;2.1.310&lt;/td&gt;
&lt;td&gt;3 / 3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenCode 2 (OpenAI Chat Completions format)&lt;/td&gt;
&lt;td&gt;2.1.3&lt;/td&gt;
&lt;td&gt;3 / 3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Claude Code runs took 16–27 s; OpenCode 9–11 s. Each Claude Code run sent roughly 32k–55k input tokens, almost all of it Claude Code's own system prompt and tool definitions, so the input price matters more than the output price for agent use.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs (USD per 1M tokens, checked 2026-10-24)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Where&lt;/th&gt;
&lt;th&gt;Model ID&lt;/th&gt;
&lt;th&gt;Input / Output&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DeepSeek's own API&lt;/td&gt;
&lt;td&gt;&lt;code&gt;deepseek-flash&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.30 / $1.20&lt;/td&gt;
&lt;td&gt;Peak hours (01:00–04:00 and 06:00–10:00 UTC, Mon–Fri). Off-peak: $0.15 / $0.60. &lt;a href="https://api-docs.deepseek.com/quick_start/pricing" rel="noopener noreferrer"&gt;source&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepInfra&lt;/td&gt;
&lt;td&gt;&lt;code&gt;deepseek-ai/DeepSeek-V4.1-Flash&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.14 / $0.42&lt;/td&gt;
&lt;td&gt;Promotional price, fp8; $0.20 / $0.60 without the promotion. &lt;a href="https://deepinfra.com/deepseek-ai/DeepSeek-V4.1-Flash" rel="noopener noreferrer"&gt;source&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenRouter&lt;/td&gt;
&lt;td&gt;&lt;code&gt;deepseek/deepseek-v4.1-flash-1017&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.30 / $1.20&lt;/td&gt;
&lt;td&gt;DeepSeek's own endpoint on OpenRouter; the cheapest of 33 providers is $0.07 / $0.15, mostly fp4 / fp8 quantized. &lt;a href="https://openrouter.ai/deepseek/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;source&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XHuoAPI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;deepseek-v4.1-flash&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.24 / $0.96&lt;/td&gt;
&lt;td&gt;Standard tier (default). Saver $0.15 / $0.60, Spot $0.09 / $0.36; cheaper tiers are less stable. &lt;a href="https://xhuoapi.ai/en/models/deepseek-v4.1-flash.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-v41-flash" rel="noopener noreferrer"&gt;source&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;How I'd pick:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cheapest per token:&lt;/strong&gt; OpenRouter's low-cost providers (check the quantization) or XHuoAPI's Spot tier; then DeepInfra's promotion and DeepSeek's off-peak hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First-party:&lt;/strong&gt; DeepSeek's own API. It also has an Anthropic-format endpoint.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One account for many vendors:&lt;/strong&gt; OpenRouter or XHuoAPI. On XHuoAPI the Saver tier equals DeepSeek's off-peak price at any hour, and the same key calls Qwen, GLM, Kimi, GPT and Claude.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Claude Code&lt;/strong&gt; (any Anthropic-compatible endpoint works the same way; leave &lt;code&gt;/v1&lt;/code&gt; off the base URL):&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;https://api.xhuoapi.ai
&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;YOUR_KEY
&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;deepseek-v4.1-flash
&lt;span class="nb"&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;deepseek-v4.1-flash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;OpenCode 2&lt;/strong&gt;, &lt;code&gt;opencode.jsonc&lt;/code&gt; in your project:&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;"$schema"&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://opencode.ai/config.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"providers"&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;"xhuoapi"&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;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"XHuoAPI"&lt;/span&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="s2"&gt;"XHUOAPI_API_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;"package"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@opencode/ai/providers/openai-compatible"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"settings"&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;"baseURL"&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.xhuoapi.ai/v1"&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;"models"&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;"deepseek-v4.1-flash"&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;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"DeepSeek V4.1 Flash"&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;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="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;Then &lt;code&gt;opencode run -m xhuoapi/deepseek-v4.1-flash "..."&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Two things worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thinking is on by default. On our endpoint, &lt;code&gt;thinking: {"type": "disabled"}&lt;/code&gt; (or &lt;code&gt;reasoning_effort: "none"&lt;/code&gt;) turned it off, and &lt;code&gt;reasoning_effort&lt;/code&gt; &lt;code&gt;low&lt;/code&gt; / &lt;code&gt;max&lt;/code&gt; changed how much it reasons.&lt;/li&gt;
&lt;li&gt;Third-party hosts often serve quantized weights. If you compare outputs between providers, check the precision column first.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full price table (including V4 Pro) and the per-tool test results are here: &lt;a href="https://xhuoapi.ai/en/guides/deepseek-api-outside-china.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-v41-flash" rel="noopener noreferrer"&gt;https://xhuoapi.ai/en/guides/deepseek-api-outside-china.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-v41-flash&lt;/a&gt; and &lt;a href="https://xhuoapi.ai/en/guides/chinese-models-in-coding-agents.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-v41-flash" rel="noopener noreferrer"&gt;https://xhuoapi.ai/en/guides/chinese-models-in-coding-agents.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=deepseek-v41-flash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deepseek</category>
      <category>claudecode</category>
      <category>ai</category>
      <category>llm</category>
    </item>
    <item>
      <title>Running Claude Code on DeepSeek, GLM and Qwen with two environment variables</title>
      <dc:creator>XHuoAPI</dc:creator>
      <pubDate>Sun, 11 Oct 2026 06:09:07 +0000</pubDate>
      <link>https://dev.to/xhuoapi/running-claude-code-on-deepseek-glm-and-qwen-with-two-environment-variables-3pif</link>
      <guid>https://dev.to/xhuoapi/running-claude-code-on-deepseek-glm-and-qwen-with-two-environment-variables-3pif</guid>
      <description>&lt;p&gt;Claude Code talks to its backend in the Anthropic Messages format. Any endpoint that accepts that format can stand in for Anthropic's API, which means you can run the same agent loop on DeepSeek, GLM, Qwen or Kimi without a proxy or a converter.&lt;/p&gt;

&lt;p&gt;I tested this on Claude Code 2.1.284 by asking it to create and write a real file with each model, and re-ran the DeepSeek case on 2.1.296 today. Here is the setup and what I found.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I run XHuoAPI, the gateway used below. The same two variables work with any Anthropic-compatible endpoint.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;Install Claude Code (Node.js 18+):&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; @anthropic-ai/claude-code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Point it at the gateway. Leave &lt;code&gt;/v1&lt;/code&gt; off the base URL; Claude Code appends &lt;code&gt;/v1/messages&lt;/code&gt; itself:&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;https://api.xhuoapi.ai
&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;YOUR_KEY
&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;deepseek-v3.2
&lt;span class="nb"&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;deepseek-v3.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or put the same values in the &lt;code&gt;env&lt;/code&gt; block of &lt;code&gt;~/.claude/settings.json&lt;/code&gt; if you'd rather not touch your shell config.&lt;/p&gt;

&lt;p&gt;Check the connection with a one-off task:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"Reply with the single word: ok"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Switching models
&lt;/h2&gt;

&lt;p&gt;Change &lt;code&gt;ANTHROPIC_MODEL&lt;/code&gt; and &lt;code&gt;ANTHROPIC_DEFAULT_HAIKU_MODEL&lt;/code&gt; together. The second one matters: Claude Code sends some background work to a "Haiku-class" model, and if that variable still points at a model your endpoint doesn't serve, those background calls fail quietly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened in the test
&lt;/h2&gt;

&lt;p&gt;Same task for every model: create a file and write a small program into it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;claude-sonnet-4-6&lt;/td&gt;
&lt;td&gt;worked first try&lt;/td&gt;
&lt;td&gt;~7 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deepseek-v3.2&lt;/td&gt;
&lt;td&gt;worked first try&lt;/td&gt;
&lt;td&gt;~9 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;qwen3.8-max&lt;/td&gt;
&lt;td&gt;worked first try&lt;/td&gt;
&lt;td&gt;~24 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;glm-5.3&lt;/td&gt;
&lt;td&gt;worked first try&lt;/td&gt;
&lt;td&gt;~45 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kimi-k3&lt;/td&gt;
&lt;td&gt;failed once, worked on retry&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two things worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prompt caching does a lot of work here.&lt;/strong&gt; Claude Code sends a long system prompt with every request. The first request wrote about 36K tokens to the cache; later ones read about 64K from it. Cache reads are billed well below normal input on most models, so long sessions cost less than the raw token count suggests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;code&gt;unrecognized_model&lt;/code&gt; line is expected.&lt;/strong&gt; Since 2.1.290, Claude Code auto-compacts sessions on model IDs it doesn't know (like &lt;code&gt;deepseek-v3.2&lt;/code&gt;) within an assumed context window and prints &lt;code&gt;[claude-code:unrecognized_model]&lt;/code&gt;. The task still runs. Set &lt;code&gt;CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1&lt;/code&gt; if you want the old behavior.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ANTHROPIC_AUTH_TOKEN&lt;/code&gt; vs &lt;code&gt;ANTHROPIC_API_KEY&lt;/code&gt;.&lt;/strong&gt; The first is sent as &lt;code&gt;Authorization: Bearer&lt;/code&gt;, the second as &lt;code&gt;x-api-key&lt;/code&gt;. Use &lt;code&gt;AUTH_TOKEN&lt;/code&gt; to avoid the interactive confirmation prompt Claude Code shows the first time it sees an &lt;code&gt;API_KEY&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full guide with the settings-file version and per-model notes is here: &lt;a href="https://xhuoapi.ai/en/guides/claude-code.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code" rel="noopener noreferrer"&gt;https://xhuoapi.ai/en/guides/claude-code.html?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code&lt;/a&gt;&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>deepseek</category>
      <category>ai</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
