<?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: AIHubMix</title>
    <description>The latest articles on DEV Community by AIHubMix (@aihubmix).</description>
    <link>https://dev.to/aihubmix</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%2F3926159%2Fb406b2d2-62da-447b-afeb-febff1b99896.jpg</url>
      <title>DEV Community: AIHubMix</title>
      <link>https://dev.to/aihubmix</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aihubmix"/>
    <language>en</language>
    <item>
      <title>MiniMax M3.1 Flash vs DeepSeek V4.1 Flash vs Claude Haiku 5.5: Same Bug Fix, Measured</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Mon, 19 Oct 2026 10:54:28 +0000</pubDate>
      <link>https://dev.to/aihubmix/minimax-m31-flash-vs-deepseek-v41-flash-vs-claude-haiku-55-same-bug-fix-measured-5fnf</link>
      <guid>https://dev.to/aihubmix/minimax-m31-flash-vs-deepseek-v41-flash-vs-claude-haiku-55-same-bug-fix-measured-5fnf</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; One two-bug Python fix, 215 hidden tests, three runs per model through one AIHubMix key, on 19 October 2026. All 12 runs passed every test. At default settings, Claude Haiku 5.5 finished in about 7 s for $0.0007 per fix, DeepSeek V4.1 Flash 1017 in about 15 s for $0.0014, and MiniMax M3.1 Flash in 56 s for $0.0045. With &lt;code&gt;reasoning_effort: "low"&lt;/code&gt;, M3.1 Flash dropped to 9.5 s and $0.0006, the cheapest configuration tested.&lt;/p&gt;

&lt;p&gt;On this task, the default thinking level shaped the bill more than the per-token price did.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three models
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;MiniMax M3.1 Flash&lt;/th&gt;
&lt;th&gt;DeepSeek V4.1 Flash 1017&lt;/th&gt;
&lt;th&gt;Claude Haiku 5.5&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AIHubMix model ID&lt;/td&gt;
&lt;td&gt;minimax-m3.1-flash&lt;/td&gt;
&lt;td&gt;deepseek-v4.1-flash-1017&lt;/td&gt;
&lt;td&gt;claude-haiku-5-5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input / output per 1M&lt;/td&gt;
&lt;td&gt;$0.165 / $0.66&lt;/td&gt;
&lt;td&gt;$0.155 / $0.62&lt;/td&gt;
&lt;td&gt;$0.10 / $0.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cache read per 1M&lt;/td&gt;
&lt;td&gt;$0.0165&lt;/td&gt;
&lt;td&gt;$0.0031&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context / max output&lt;/td&gt;
&lt;td&gt;1M / 512K&lt;/td&gt;
&lt;td&gt;1M / 384K&lt;/td&gt;
&lt;td&gt;1M / 128K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input types&lt;/td&gt;
&lt;td&gt;Text, image, video&lt;/td&gt;
&lt;td&gt;Text, image&lt;/td&gt;
&lt;td&gt;Text, image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Thinking can be off&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Default thinking&lt;/td&gt;
&lt;td&gt;max&lt;/td&gt;
&lt;td&gt;On&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open weights&lt;/td&gt;
&lt;td&gt;Not yet&lt;/td&gt;
&lt;td&gt;Yes (MIT)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are AIHubMix list prices on 19 October 2026. A 30% AIHubMix discount on DeepSeek V4.1 Flash 1017 runs from 19 to 25 October and isn't included. Haiku 5.5's rate rises to $0.50 / $2.50 above 100K prompt tokens. DeepSeek's own API doubles its price at peak hours; AIHubMix lists one price. M3.1 Flash's video input is documented by MiniMax, while AIHubMix lists text and image.&lt;/p&gt;

&lt;p&gt;Spec sources: &lt;a href="https://platform.minimax.io/docs/guides/models-intro" rel="noopener noreferrer"&gt;MiniMax's model list&lt;/a&gt;, &lt;a href="https://api-docs.deepseek.com/quick_start/pricing" rel="noopener noreferrer"&gt;DeepSeek's models and pricing page&lt;/a&gt;, and &lt;a href="https://www.anthropic.com/claude/haiku" rel="noopener noreferrer"&gt;Anthropic's Haiku page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Why these three? They're the cheap tier of each vendor and launched within four weeks of each other:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DeepSeek V4.1 Flash came out on 10 September and its 1017 update on 17 October.&lt;/li&gt;
&lt;li&gt;Haiku 5.5 came out on 7 October.&lt;/li&gt;
&lt;li&gt;M3.1 Flash ran anonymously as Space Bunny Alpha from 23 September, was named on 27 September, and became callable per token on AIHubMix on 19 October.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During its free OpenRouter week, Space Bunny topped the daily chart ahead of DeepSeek V4.1 Flash.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An AIHubMix key in &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt; (the &lt;a href="https://docs.aihubmix.com/en/quick-start" rel="noopener noreferrer"&gt;quick start&lt;/a&gt; covers it).&lt;/li&gt;
&lt;li&gt;Python 3.10+ and &lt;code&gt;pip install openai&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;All three models answer on &lt;code&gt;https://aihubmix.com/v1/chat/completions&lt;/code&gt;, so only the model ID changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The task and the grader
&lt;/h2&gt;

&lt;p&gt;The function under test has two bugs. A pause that runs past the period end subtracts the end day, which isn't in the period. Overlapping pauses get subtracted twice.&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;billable_days&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pauses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Days in the half-open period [start, end) when the subscription was active.
    `pauses` holds inclusive (first_day, last_day) ranges...&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p_start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p_end&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pauses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p_start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p_end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The prompt describes the two symptoms and asks for the corrected function in one code block. The grader pulls the last code block from the reply and runs it against 215 cases in an isolated subprocess:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;15 hand-written edge cases: touching, nested, and duplicate pauses, a pause covering the whole period, an empty period, and a pause starting on the end date&lt;/li&gt;
&lt;li&gt;200 random cases from a fixed seed, each checked against a brute-force reference that counts day by day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The original function passes 138 of the 215.&lt;/p&gt;

&lt;h2&gt;
  
  
  The request loop
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&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;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://aihubmix.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;extra&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;minimax-m3.1-flash&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;reasoning_effort&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;low&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-v4.1-flash-1017&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="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-haiku-5-5&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;t0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;r&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="n"&gt;model&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;32768&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="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;extra&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;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;t0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;s&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;output tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thinking tokens are in &lt;code&gt;usage.completion_tokens_details.reasoning_tokens&lt;/code&gt;. Cost is computed from &lt;code&gt;prompt_tokens&lt;/code&gt;, &lt;code&gt;prompt_tokens_details.cached_tokens&lt;/code&gt;, and &lt;code&gt;completion_tokens&lt;/code&gt; at each model's AIHubMix price. Thinking is billed as output on all three.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Three runs per row, Chat Completions, &lt;code&gt;max_tokens&lt;/code&gt; 32,768, measured by AIHubMix on 19 October 2026:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model and setting&lt;/th&gt;
&lt;th&gt;Avg thinking tokens&lt;/th&gt;
&lt;th&gt;Avg output tokens&lt;/th&gt;
&lt;th&gt;Avg time&lt;/th&gt;
&lt;th&gt;Avg cost per fix&lt;/th&gt;
&lt;th&gt;Tests&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Haiku 5.5 (default)&lt;/td&gt;
&lt;td&gt;755&lt;/td&gt;
&lt;td&gt;1,323&lt;/td&gt;
&lt;td&gt;7.2 s&lt;/td&gt;
&lt;td&gt;$0.0007&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepSeek V4.1 Flash 1017 (default)&lt;/td&gt;
&lt;td&gt;1,823&lt;/td&gt;
&lt;td&gt;2,148&lt;/td&gt;
&lt;td&gt;14.6 s&lt;/td&gt;
&lt;td&gt;$0.0014&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MiniMax M3.1 Flash (default = max)&lt;/td&gt;
&lt;td&gt;6,364&lt;/td&gt;
&lt;td&gt;6,673&lt;/td&gt;
&lt;td&gt;56.3 s&lt;/td&gt;
&lt;td&gt;$0.0045&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MiniMax M3.1 Flash (low)&lt;/td&gt;
&lt;td&gt;591&lt;/td&gt;
&lt;td&gt;889&lt;/td&gt;
&lt;td&gt;9.5 s&lt;/td&gt;
&lt;td&gt;$0.0006&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Here is what the numbers say:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Same correctness.&lt;/strong&gt; Twelve perfect fixes. This task doesn't separate the models on quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;About 8× the thinking at default.&lt;/strong&gt; Flash's default spent 6,364 thinking tokens against Haiku's 755. That's why Haiku's default costs about a sixth of Flash's default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flash at &lt;code&gt;low&lt;/code&gt; is the cheapest,&lt;/strong&gt; at $0.64 per 1,000 fixes against Haiku's $0.70. Haiku is still faster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Throughput.&lt;/strong&gt; Output tokens divided by wall time came to about 183 tok/s for Haiku, 148 for DeepSeek, and 112 for Flash.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Per 1,000 fixes: Haiku about $0.70, DeepSeek about $1.35, and Flash about $4.45 at default or $0.64 at &lt;code&gt;low&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A second check sorted five support tickets into four labels, with each model at its default and at its lowest thinking setting. All 30 answers were correct, and every call cost under $0.0001. Thinking tokens per call were 0–6 for Flash, 0 for Haiku, and about 25 for DeepSeek.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes and fixes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Flash's default looks like a hang.&lt;/strong&gt; With no effort field, M3.1 Flash thinks at &lt;code&gt;max&lt;/code&gt;, and a small fix took 56 s on average. Client timeouts tuned for a fast model will fire. The fix is to send &lt;code&gt;reasoning_effort&lt;/code&gt; on every request and start at &lt;code&gt;low&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;reasoning_effort: "none"&lt;/code&gt; doesn't zero DeepSeek's thinking through AIHubMix.&lt;/strong&gt; On the triage prompts, DeepSeek used about 25 reasoning tokens with &lt;code&gt;none&lt;/code&gt; and with the default alike. The cost difference is negligible. Just don't assume &lt;code&gt;none&lt;/code&gt; gives you a non-thinking reply on this route.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Haiku's long-prompt price cliff.&lt;/strong&gt; Above 100K prompt tokens, Haiku 5.5 bills $0.50 / $2.50. As an estimate for a 300K-token prompt with no cache, counting input only and assuming the higher rate applies to the whole prompt as OrcaRouter describes: Haiku costs 300,000 × $0.50 ÷ 1M = $0.15, while M3.1 Flash costs 300,000 × $0.165 ÷ 1M ≈ $0.05, about the same as DeepSeek. That's roughly 3× per call. Route large-context calls away from Haiku, or cache aggressively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Promo prices drift.&lt;/strong&gt; DeepSeek V4.1 Flash 1017's AIHubMix page shows the discounted price until 25 October. Budget on the list price.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this test can't tell you
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quality differences.&lt;/strong&gt; Every run passed, so a harder, multi-file task is needed to rank the models on correctness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Statistical confidence.&lt;/strong&gt; Three runs per setting is a small sample, and thinking length varies a lot between runs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;M3.1 Flash on a benchmark.&lt;/strong&gt; MiniMax hasn't published one and Artificial Analysis doesn't list it. DeepSeek's benchmark scores are self-reported in its V4.1 Flash technical report. Haiku's Artificial Analysis score of 43 is cited by OrcaRouter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Video input through AIHubMix.&lt;/strong&gt; It's in MiniMax's docs but wasn't tested here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Haiku's exact long-prompt rule.&lt;/strong&gt; The $0.15 figure assumes the higher rate covers the whole prompt.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which one to use
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A person waiting, short prompts:&lt;/strong&gt; Claude Haiku 5.5.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Benchmarks, self-hosting, or a real non-thinking mode:&lt;/strong&gt; DeepSeek V4.1 Flash 1017.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Large context, long outputs, or video, with effort set explicitly:&lt;/strong&gt; MiniMax M3.1 Flash at &lt;code&gt;low&lt;/code&gt; or &lt;code&gt;medium&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To check the price cards side by side, use AIHubMix's compare pages: &lt;a href="https://aihubmix.com/compare/minimax-m3.1-flash/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;M3.1 Flash vs DeepSeek V4.1 Flash 1017&lt;/a&gt; and &lt;a href="https://aihubmix.com/compare/minimax-m3.1-flash/claude-haiku-5-5" rel="noopener noreferrer"&gt;M3.1 Flash vs Claude Haiku 5.5&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the MiniMax M3.1 Flash series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For what M3.1 Flash is and what it replaced, from Space Bunny to its price against M2.7 and M3: &lt;a href="https://dev.to/aihubmix/minimax-m31-flash-ex-space-bunny-on-the-api-specs-price-and-a-measured-bug-fix-cost-1ijk"&gt;MiniMax M3.1 Flash (ex-Space Bunny) on the API: Specs, Price, and a Measured Bug-Fix Cost&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Flash's numbers above swing on one setting. Here's the same fix at all five effort levels: &lt;a href="https://dev.to/aihubmix/measuring-minimax-m31-flashs-five-effort-levels-on-one-bug-fix-5ej3"&gt;Measuring MiniMax M3.1 Flash's Five Effort Levels on One Bug Fix&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If you're porting MiniMax M2.5/M2.7 code rather than starting fresh, read the 400s and silent changes first: &lt;a href="https://dev.to/aihubmix/fixing-requires-adaptive-thinking-2013-when-moving-from-minimax-m27-to-m31-flash-1iif"&gt;Fixing "requires adaptive thinking" (2013) When Moving from MiniMax M2.7 to M3.1 Flash&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://platform.minimax.io/docs/guides/models-intro" rel="noopener noreferrer"&gt;MiniMax: Models&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://api-docs.deepseek.com/quick_start/pricing" rel="noopener noreferrer"&gt;DeepSeek: Models &amp;amp; Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.anthropic.com/claude/haiku" rel="noopener noreferrer"&gt;Anthropic: Claude Haiku&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aihubmix.com/compare/minimax-m3.1-flash/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;AIHubMix: MiniMax M3.1 Flash vs DeepSeek V4.1 Flash 1017&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.orcarouter.ai/blog/claude-haiku-5-5-vs-minimax-m3-1-flash-preview" rel="noopener noreferrer"&gt;OrcaRouter: Claude Haiku 5.5 vs MiniMax M3.1 Flash Preview&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>api</category>
      <category>minimax</category>
    </item>
    <item>
      <title>Measuring MiniMax M3.1 Flash's Five Effort Levels on One Bug Fix</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Mon, 19 Oct 2026 10:54:22 +0000</pubDate>
      <link>https://dev.to/aihubmix/measuring-minimax-m31-flashs-five-effort-levels-on-one-bug-fix-5ej3</link>
      <guid>https://dev.to/aihubmix/measuring-minimax-m31-flashs-five-effort-levels-on-one-bug-fix-5ej3</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; We ran the same two-bug fix through MiniMax M3.1 Flash at all five effort levels plus "omitted", three runs each, and graded every answer against 215 hidden tests. Every run passed. The omitted default, which MiniMax documents as &lt;code&gt;max&lt;/code&gt;, averaged 6,364 thinking tokens, 56 seconds, and $0.0045 per fix. &lt;code&gt;low&lt;/code&gt; averaged 591 thinking tokens, 9.5 seconds, and $0.0006. So the default cost about 7× &lt;code&gt;low&lt;/code&gt; and bought nothing on this task. Set &lt;code&gt;low&lt;/code&gt; explicitly and move up per task.&lt;/p&gt;

&lt;p&gt;The engineering problem: M3.1 Flash always thinks, and if the request has no effort field, MiniMax's &lt;a href="https://platform.minimax.io/docs/guides/text-generation" rel="noopener noreferrer"&gt;text generation guide&lt;/a&gt; says it "defaults to &lt;code&gt;max&lt;/code&gt;". Code migrated from MiniMax M2.x never set an effort level because M2.x had none. That code now runs at the most expensive setting by default.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Model: &lt;code&gt;minimax-m3.1-flash&lt;/code&gt; on &lt;a href="https://aihubmix.com/model/minimax-m3.1-flash" rel="noopener noreferrer"&gt;AIHubMix&lt;/a&gt;. Upstream reports &lt;code&gt;MiniMax-M3.1-Flash&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Endpoint: &lt;code&gt;POST https://aihubmix.com/v1/chat/completions&lt;/code&gt;, &lt;code&gt;max_tokens: 32768&lt;/code&gt;, key from &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt; (see the &lt;a href="https://docs.aihubmix.com/en/quick-start" rel="noopener noreferrer"&gt;AIHubMix quick start&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Date: 19 October 2026. Three runs per setting.&lt;/li&gt;
&lt;li&gt;Prices (AIHubMix, per 1M tokens): $0.165 input, $0.66 output, $0.0165 cached input. Thinking tokens bill as output.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The task: a billing function with two bugs. A pause that runs past the period end double-counts one day, and overlapping pauses get subtracted twice. The prompt states both symptoms and asks for the corrected function in one code block. A local harness runs it against 215 cases: 15 hand-written edge cases plus 200 random ones checked against a brute-force reference. The original buggy function passes 138.&lt;/p&gt;

&lt;h2&gt;
  
  
  Field names per protocol
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Protocol&lt;/th&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Values&lt;/th&gt;
&lt;th&gt;Default&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI Chat Completions&lt;/td&gt;
&lt;td&gt;reasoning_effort&lt;/td&gt;
&lt;td&gt;low, medium, high, xhigh, max&lt;/td&gt;
&lt;td&gt;max&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anthropic Messages&lt;/td&gt;
&lt;td&gt;output_config.effort&lt;/td&gt;
&lt;td&gt;low, medium, high, xhigh, max&lt;/td&gt;
&lt;td&gt;max&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI Responses&lt;/td&gt;
&lt;td&gt;reasoning.effort&lt;/td&gt;
&lt;td&gt;low, medium, high, xhigh, max&lt;/td&gt;
&lt;td&gt;max&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All three protocols work for this model on AIHubMix. Thinking can't be turned off. MiniMax's &lt;a href="https://platform.minimax.io/docs/api-reference/text-chat-anthropic" rel="noopener noreferrer"&gt;Messages API reference&lt;/a&gt; says &lt;code&gt;thinking: {"type": "disabled"}&lt;/code&gt; and effort &lt;code&gt;none&lt;/code&gt; return HTTP 400 with &lt;code&gt;model "MiniMax-M3.1-Flash" requires adaptive thinking&lt;/code&gt;. Older MiniMax models ignore the effort field.&lt;/p&gt;

&lt;h2&gt;
  
  
  The measurement loop
&lt;/h2&gt;

&lt;p&gt;This is the shape of the run, minus the grader:&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&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;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://aihubmix.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bugfix_prompt.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;effort&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;low&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;medium&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;high&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;xhigh&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;max&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;extra&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;reasoning_effort&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;effort&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;effort&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
        &lt;span class="n"&gt;t0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;r&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;minimax-m3.1-flash&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;32768&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="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;extra&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&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;effort&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;omitted&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;t0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
              &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens_details&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reasoning_tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Effort&lt;/th&gt;
&lt;th&gt;Avg thinking tokens&lt;/th&gt;
&lt;th&gt;Range (3 runs)&lt;/th&gt;
&lt;th&gt;Avg time&lt;/th&gt;
&lt;th&gt;Avg cost per fix&lt;/th&gt;
&lt;th&gt;Tests&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;low&lt;/td&gt;
&lt;td&gt;591&lt;/td&gt;
&lt;td&gt;344–812&lt;/td&gt;
&lt;td&gt;9.5 s&lt;/td&gt;
&lt;td&gt;$0.0006&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;1,522&lt;/td&gt;
&lt;td&gt;970–2,488&lt;/td&gt;
&lt;td&gt;21.7 s&lt;/td&gt;
&lt;td&gt;$0.0013&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;td&gt;2,863&lt;/td&gt;
&lt;td&gt;2,194–3,673&lt;/td&gt;
&lt;td&gt;27.1 s&lt;/td&gt;
&lt;td&gt;$0.0022&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;xhigh&lt;/td&gt;
&lt;td&gt;1,949&lt;/td&gt;
&lt;td&gt;1,019–2,562&lt;/td&gt;
&lt;td&gt;19.2 s&lt;/td&gt;
&lt;td&gt;$0.0015&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;max&lt;/td&gt;
&lt;td&gt;4,699&lt;/td&gt;
&lt;td&gt;2,612–6,246&lt;/td&gt;
&lt;td&gt;40.4 s&lt;/td&gt;
&lt;td&gt;$0.0034&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;omitted&lt;/td&gt;
&lt;td&gt;6,364&lt;/td&gt;
&lt;td&gt;4,284–9,376&lt;/td&gt;
&lt;td&gt;56.3 s&lt;/td&gt;
&lt;td&gt;$0.0045&lt;/td&gt;
&lt;td&gt;215/215 ×3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Cost arithmetic for the "omitted" row: 464 prompt tokens, about 192 of them cached, plus 6,673 output tokens. That's (272 × $0.165 + 192 × $0.0165 + 6,673 × $0.66) ÷ 1M ≈ $0.0045.&lt;/p&gt;

&lt;p&gt;What the table supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quality was flat.&lt;/strong&gt; 18 Chat runs, 18 perfect fixes. On this bounded bug, thinking beyond &lt;code&gt;low&lt;/code&gt; bought nothing measurable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;low → medium is a real step:&lt;/strong&gt; about 2.6× the thinking tokens and more than twice the time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Above medium, n=3 can't order the levels.&lt;/strong&gt; xhigh averaged below high, and max overlaps both.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Omitted ≈ max,&lt;/strong&gt; as documented. The higher "omitted" average is within run-to-run noise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time tracks tokens.&lt;/strong&gt; Throughput held at about 112 output tokens per second across all 24 Flash runs (Chat and Messages), so a 6,000-token think costs close to a minute of wall time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Short prompts behave differently. With five support tickets sorted into four labels, &lt;code&gt;low&lt;/code&gt; used 0 thinking tokens and the default averaged 6, with every label correct. "What is 17 × 23?" at &lt;code&gt;low&lt;/code&gt; produced no thinking and 2 output tokens. Adaptive thinking scales with the prompt, so the missing off switch barely costs anything on classification-style calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes and fixes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Truncation from thinking.&lt;/strong&gt; Thinking counts toward &lt;code&gt;max_tokens&lt;/code&gt;. One default run used 9,376 thinking tokens on a single function. A 4K or 8K limit carried over from M2.x can end with &lt;code&gt;finish_reason: "length"&lt;/code&gt; and a cut-off answer. Fix: raise &lt;code&gt;max_tokens&lt;/code&gt; (MiniMax recommends 131,072, max 524,288) and check &lt;code&gt;finish_reason&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Latency spikes at a fixed level.&lt;/strong&gt; On the Anthropic Messages endpoint, three &lt;code&gt;low&lt;/code&gt; runs used 511, 1,861, and 6,060 thinking tokens; the last took 56 seconds. Effort sets the average depth, not a cap. Fix: set client and proxy timeouts to 120 s or more at high and above, and don't size timeouts from &lt;code&gt;low&lt;/code&gt; averages alone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effort values that silently do nothing.&lt;/strong&gt; Through AIHubMix, &lt;code&gt;reasoning_effort&lt;/code&gt; values &lt;code&gt;none&lt;/code&gt;, &lt;code&gt;minimal&lt;/code&gt;, and &lt;code&gt;auto&lt;/code&gt; all returned HTTP 200, and the model still thought. MiniMax's own endpoints reject unknown values, according to a gateway project's tests (&lt;a href="https://github.com/Wei-Shaw/sub2api/issues/8025" rel="noopener noreferrer"&gt;sub2api issue #8025&lt;/a&gt;). Fix: send one of the five documented values. AIHubMix's &lt;a href="https://docs.aihubmix.com/en/api/unified-inference" rel="noopener noreferrer"&gt;unified reasoning parameters page&lt;/a&gt; describes how the gateway maps reasoning fields across vendors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools that don't send a level.&lt;/strong&gt; OpenCode &lt;a href="https://github.com/anomalyco/opencode/issues/54801" rel="noopener noreferrer"&gt;resolves no effort variants&lt;/a&gt; for this model, so its effort toggle does nothing. Some frameworks also send "thinking disabled", which returns the 400. Fix: check the outgoing request body.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mixed-model routing.&lt;/strong&gt; M3 and M2.x ignore the effort field, so a level that saves money on Flash does nothing on the others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify it reached the model.&lt;/strong&gt; Read &lt;code&gt;usage&lt;/code&gt;: &lt;code&gt;completion_tokens_details.reasoning_tokens&lt;/code&gt; (Chat), &lt;code&gt;output_tokens_details.thinking_tokens&lt;/code&gt; (Messages), &lt;code&gt;output_tokens_details.reasoning_tokens&lt;/code&gt; (Responses). If these don't change when you change the level, the setting isn't arriving.&lt;/p&gt;

&lt;p&gt;Setting it on Messages and Responses through AIHubMix:&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;anthropic&lt;/span&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;ant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;anthropic&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Anthropic&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://aihubmix.com&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&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;minimax-m3.1-flash&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;32768&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;Write a function that merges overlapping date ranges.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="n"&gt;extra_body&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;output_config&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;effort&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;medium&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="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;oai&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;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://aihubmix.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;oai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;responses&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;minimax-m3.1-flash&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reasoning&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;effort&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;low&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_output_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;32768&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Write a function that merges overlapping date ranges.&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="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Starting points
&lt;/h2&gt;

&lt;p&gt;Only the first two rows are backed by the measurements above. The rest are recommendations to check against your own retry rates.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workload&lt;/th&gt;
&lt;th&gt;Start at&lt;/th&gt;
&lt;th&gt;Move up when&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Classification, extraction, routing&lt;/td&gt;
&lt;td&gt;low&lt;/td&gt;
&lt;td&gt;Labels are wrong on hard cases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Single-function fixes, small reviews&lt;/td&gt;
&lt;td&gt;low&lt;/td&gt;
&lt;td&gt;A fix fails tests twice&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-file changes, refactors&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;The agent misses a dependent file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent loops with many tool calls&lt;/td&gt;
&lt;td&gt;low or medium&lt;/td&gt;
&lt;td&gt;Steps repeat or stall&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hard debugging, design questions&lt;/td&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;td&gt;Answers stay shallow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Interactive chat, person waiting&lt;/td&gt;
&lt;td&gt;low&lt;/td&gt;
&lt;td&gt;Never default to max here&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What we can't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Where higher levels start to pay off.&lt;/strong&gt; Our task was solved at every level. MiniMax hasn't published per-level token, latency, or accuracy data, and one bounded task can't show where &lt;code&gt;high&lt;/code&gt;, &lt;code&gt;xhigh&lt;/code&gt;, or &lt;code&gt;max&lt;/code&gt; earn their cost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ordering above medium.&lt;/strong&gt; Three runs per level isn't enough to separate high, xhigh, and max.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other tasks and prompt lengths.&lt;/strong&gt; All numbers come from one short coding prompt and one classification prompt, measured by AIHubMix on 19 October 2026. Nobody else has reproduced them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the MiniMax M3.1 Flash series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For the bigger picture behind this setting, from the Space Bunny launch to the price against M2.7 and M3: &lt;a href="https://dev.to/aihubmix/minimax-m31-flash-ex-space-bunny-on-the-api-specs-price-and-a-measured-bug-fix-cost-1ijk"&gt;MiniMax M3.1 Flash (ex-Space Bunny) on the API: Specs, Price, and a Measured Bug-Fix Cost&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Effort is one of several things that change when M2.5/M2.7 code moves over. This post covers the 400 errors and the rest: &lt;a href="https://dev.to/aihubmix/fixing-requires-adaptive-thinking-2013-when-moving-from-minimax-m27-to-m31-flash-1iif"&gt;Fixing "requires adaptive thinking" (2013) When Moving from MiniMax M2.7 to M3.1 Flash&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;At &lt;code&gt;low&lt;/code&gt;, Flash was the cheapest of three models on this same fix. Here's how its default compares with DeepSeek's and Haiku's: &lt;a href="https://dev.to/aihubmix/minimax-m31-flash-vs-deepseek-v41-flash-vs-claude-haiku-55-same-bug-fix-measured-5fnf"&gt;MiniMax M3.1 Flash vs DeepSeek V4.1 Flash vs Claude Haiku 5.5: Same Bug Fix, Measured&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://platform.minimax.io/docs/guides/text-generation" rel="noopener noreferrer"&gt;MiniMax: Model Invocation (text generation guide)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://platform.minimax.io/docs/api-reference/text-chat-anthropic" rel="noopener noreferrer"&gt;MiniMax: Messages API reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aihubmix.com/model/minimax-m3.1-flash" rel="noopener noreferrer"&gt;AIHubMix: MiniMax M3.1 Flash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aihubmix.com/en/api/unified-inference" rel="noopener noreferrer"&gt;AIHubMix: Unified Reasoning Parameters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Wei-Shaw/sub2api/issues/8025" rel="noopener noreferrer"&gt;sub2api issue #8025: MiniMax M3 / M3.1 Flash effort support&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>api</category>
      <category>minimax</category>
    </item>
    <item>
      <title>Fixing "requires adaptive thinking" (2013) When Moving from MiniMax M2.7 to M3.1 Flash</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Mon, 19 Oct 2026 10:54:14 +0000</pubDate>
      <link>https://dev.to/aihubmix/fixing-requires-adaptive-thinking-2013-when-moving-from-minimax-m27-to-m31-flash-1iif</link>
      <guid>https://dev.to/aihubmix/fixing-requires-adaptive-thinking-2013-when-moving-from-minimax-m27-to-m31-flash-1iif</guid>
      <description>&lt;p&gt;&lt;strong&gt;Result first.&lt;/strong&gt; We sent M2.x-style requests to MiniMax M3.1 Flash through AIHubMix on 19 October 2026. Three things broke or changed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Disabling thinking on Chat Completions returns &lt;strong&gt;HTTP 400, code 2013, "requires adaptive thinking"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Every other way of asking for "no thinking" returns &lt;strong&gt;200 and the model thinks anyway&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;With no effort set, the model runs at &lt;strong&gt;max&lt;/strong&gt;: on a small bug fix that meant about 6,400 reasoning tokens and 56 seconds, against about 600 tokens and 9.5 seconds at &lt;code&gt;low&lt;/code&gt;. Both settings passed all 215 tests.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The rest of this post is the error, a minimal repro, the fixes, and what we couldn't verify.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters now
&lt;/h2&gt;

&lt;p&gt;MiniMax retires M2.5 and M2.7 (plus the &lt;code&gt;-highspeed&lt;/code&gt; variants) on &lt;strong&gt;18 November 2026&lt;/strong&gt;. Since 19 October, both families have been closed to new users. Requests on M Plan and Token Plan that name them are served by M3.1 Flash under the old name, per MiniMax's &lt;a href="https://platform.minimax.io/docs/guides/models-intro" rel="noopener noreferrer"&gt;models page&lt;/a&gt;. Pay-as-you-go calls keep working until the retirement date, then stop: "Once retired, API requests to these models will no longer work." M2.1 and M2 aren't in the notice.&lt;/p&gt;

&lt;p&gt;If you're on a plan, your logs still say M2.7 but the model behind it has changed: 1M context instead of 204,800, top_p 0.95 instead of 0.9, and thinking at &lt;code&gt;max&lt;/code&gt; by default. Re-run your evals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An AIHubMix key in &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Model ID on AIHubMix: &lt;a href="https://aihubmix.com/model/minimax-m3.1-flash" rel="noopener noreferrer"&gt;&lt;code&gt;minimax-m3.1-flash&lt;/code&gt;&lt;/a&gt;. Responses report the upstream name as &lt;code&gt;MiniMax-M3.1-Flash&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Endpoints that work for this model on AIHubMix (all tested): &lt;code&gt;/v1/chat/completions&lt;/code&gt;, &lt;code&gt;/v1/messages&lt;/code&gt;, &lt;code&gt;/v1/responses&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The 400: repro and fix
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://aihubmix.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 &lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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": "minimax-m3.1-flash",
       "messages": [{"role": "user", "content": "hi"}],
       "thinking": {"type": "disabled"}}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response, copied from our run:&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="nl"&gt;"error"&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="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"invalid params, model &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;MiniMax-M3.1-Flash&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; requires adaptive thinking; thinking.type=&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;disabled&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; (including reasoning.effort=none) is not allowed (2013) (tid: …)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bad_request_error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"param"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&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;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&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;MiniMax's &lt;a href="https://platform.minimax.io/docs/api-reference/text-chat-anthropic" rel="noopener noreferrer"&gt;Messages API reference&lt;/a&gt; says the model "always thinks"; &lt;code&gt;thinking.type&lt;/code&gt;, if sent, must be &lt;code&gt;adaptive&lt;/code&gt;. Code written for M3 can hit this, because M3 can turn thinking off. Frameworks that classify the model as non-reasoning and send "thinking off" by default fail on every call, as the kodus-ai and 9router-go projects reported.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; drop &lt;code&gt;thinking&lt;/code&gt;, or send &lt;code&gt;{"type": "adaptive"}&lt;/code&gt;. To make calls faster, lower the effort:&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&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;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://aihubmix.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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;resp&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;minimax-m3.1-flash&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;reasoning_effort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;low&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;# low | medium | high | xhigh | max; omitted = max
&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;32768&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;         &lt;span class="c1"&gt;# thinking counts toward this
&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;Explain in two sentences why the sky is blue.&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="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&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;finish_reason&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens_details&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reasoning_tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Same code 2013, different cause
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;invalid param: remote returned status 400 (2013)&lt;/code&gt; came back for an image URL on upload.wikimedia.org. The same request with a base64 image, or an image URL from another host, returned 200. 2013 is MiniMax's general invalid-params code. Our reading of this message is that the upstream couldn't fetch the image; MiniMax doesn't document the case. Send images as &lt;code&gt;data:image/png;base64,…&lt;/code&gt; and read the full message before grepping logs for 2013.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quiet failure modes (all return 200)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Request through AIHubMix&lt;/th&gt;
&lt;th&gt;What actually happens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Messages, thinking disabled&lt;/td&gt;
&lt;td&gt;Still thinks: 469–622 tokens on a short puzzle&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chat, reasoning_effort none&lt;/td&gt;
&lt;td&gt;Still thinks: 265–372 tokens on the same puzzle&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chat, reasoning_effort minimal&lt;/td&gt;
&lt;td&gt;Still thinks (one run, arithmetic prompt)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Effort omitted&lt;/td&gt;
&lt;td&gt;Runs at max&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;max_tokens 64&lt;/td&gt;
&lt;td&gt;finish_reason length, answer cut mid-sentence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cache_control blocks&lt;/td&gt;
&lt;td&gt;Not supported; caching is automatic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;service_tier&lt;/td&gt;
&lt;td&gt;Not supported; no Priority tier&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The puzzle rows are three runs each; &lt;code&gt;low&lt;/code&gt; used 173–251 reasoning tokens on the same puzzle. Only Chat Completions with &lt;code&gt;thinking: {"type": "disabled"}&lt;/code&gt; produces the 400.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effort cost, measured.&lt;/strong&gt; The task was a two-bug fix in one Python function, graded against 215 hidden tests. It ran three times per setting on Chat Completions.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Avg reasoning tokens&lt;/th&gt;
&lt;th&gt;Avg time&lt;/th&gt;
&lt;th&gt;Avg cost per fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Effort omitted&lt;/td&gt;
&lt;td&gt;6,364&lt;/td&gt;
&lt;td&gt;56 s&lt;/td&gt;
&lt;td&gt;$0.0045&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Effort low&lt;/td&gt;
&lt;td&gt;591&lt;/td&gt;
&lt;td&gt;9.5 s&lt;/td&gt;
&lt;td&gt;$0.0006&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All runs passed. Prices are AIHubMix's: $0.165 input, $0.66 output, and $0.0165 cache read per 1M tokens. Thinking is billed as output, and it was 95% of the output at default (6,364 of 6,673 tokens).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Truncation.&lt;/strong&gt; With &lt;code&gt;max_tokens: 64&lt;/code&gt; and a two-sentence question, the response was &lt;code&gt;finish_reason: "length"&lt;/code&gt; with content "Sunlight contains many colors,". MiniMax recommends 131,072 and allows 524,288.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caching.&lt;/strong&gt; &lt;code&gt;cache_control&lt;/code&gt; isn't supported on M3.1 Flash (or M3). M2.7 billed explicit cache writes at $0.375 per 1M tokens. Every request we sent, even the first, had about 175–195 prompt tokens served from cache. It looks like a fixed MiniMax-side preamble, and it costs about a third of a cent per thousand requests at AIHubMix's cache-read price.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pricing gaps.&lt;/strong&gt; MiniMax's pricing page has no per-token price for M3.1 Flash yet. M3's official price doubles above 512K input tokens; AIHubMix lists one flat price for M3.1 Flash, so check your first invoice if you send very long prompts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agents and coding tools
&lt;/h2&gt;

&lt;p&gt;Agent behaviour that matters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It reasons before every tool call, even at &lt;code&gt;low&lt;/code&gt;; our short tool steps took about 2–7 s.&lt;/li&gt;
&lt;li&gt;It follows instructions narrowly. An early tester called it "insanely fast, but it needs clear and specific instructions, otherwise it's too lazy." Give explicit stop conditions and verification steps.&lt;/li&gt;
&lt;li&gt;MiniMax documents &lt;code&gt;tool_choice&lt;/code&gt; as &lt;code&gt;auto&lt;/code&gt; only. AIHubMix accepted &lt;code&gt;"required"&lt;/code&gt; and &lt;code&gt;{"type": "any"}&lt;/code&gt; and the tool was called, but forcing isn't documented. Don't rely on it.&lt;/li&gt;
&lt;li&gt;Return thinking blocks unchanged (Messages) and keep &lt;code&gt;reasoning_content&lt;/code&gt; intact (Chat), per MiniMax. A stripped short round trip worked in our test; long loops should follow the rule.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Protocol support, tested on 19 October with text, a tool call, and a tool-result round trip:&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;Protocol&lt;/th&gt;
&lt;th&gt;Works via AIHubMix&lt;/th&gt;
&lt;th&gt;Effort field&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;Anthropic Messages&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;output_config.effort&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Codex CLI&lt;/td&gt;
&lt;td&gt;OpenAI Responses&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;reasoning.effort&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenCode&lt;/td&gt;
&lt;td&gt;OpenAI-compatible&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;reasoning_effort&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Claude Code&lt;/strong&gt; (&lt;a href="https://docs.aihubmix.com/en/api/Claude-Code" rel="noopener noreferrer"&gt;AIHubMix guide&lt;/a&gt;):&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://aihubmix.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;"&lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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;"minimax-m3.1-flash"&lt;/span&gt;
&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;&lt;span class="s2"&gt;"minimax-m3.1-flash"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;thinking: enabled&lt;/code&gt; with a budget and &lt;code&gt;thinking: adaptive&lt;/code&gt; both returned 200.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Codex CLI&lt;/strong&gt; (&lt;a href="https://docs.aihubmix.com/en/api/Codex-CLI" rel="noopener noreferrer"&gt;AIHubMix guide&lt;/a&gt;): use a custom provider with &lt;code&gt;wire_api = "responses"&lt;/code&gt;, &lt;code&gt;model = "minimax-m3.1-flash"&lt;/code&gt;, and &lt;code&gt;model_reasoning_effort&lt;/code&gt;. Function calls come back as &lt;code&gt;function_call&lt;/code&gt; items. &lt;code&gt;xhigh&lt;/code&gt; and &lt;code&gt;minimal&lt;/code&gt; were accepted. &lt;code&gt;minimal&lt;/code&gt; isn't a MiniMax level, so the model still thinks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenCode&lt;/strong&gt;: &lt;a href="https://github.com/anomalyco/opencode/issues/54801" rel="noopener noreferrer"&gt;issue #54801&lt;/a&gt; (reproduced on v2.0.27) says OpenCode resolves no effort variants for this model. The workaround is to declare five variants in &lt;code&gt;opencode.json&lt;/code&gt;. Through AIHubMix's OpenAI-compatible provider, each variant should set &lt;code&gt;reasoning_effort&lt;/code&gt; (&lt;code&gt;low&lt;/code&gt; … &lt;code&gt;max&lt;/code&gt;) rather than the issue's &lt;code&gt;output_config.effort&lt;/code&gt;. Don't add &lt;code&gt;none&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The context window is 1,000,000 on MiniMax's API. MiniMax Code's own client defaults to 512K "to balance experience and cost", per a maintainer's quote of MiniMax's docs in the magpie project. The API has no window parameter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smoke test (about 15 minutes):&lt;/strong&gt; give the agent a scratch folder with one known bug and a failing test, and ask it to "Run the tests, fix the bug, run the tests again, and show me the output." Pass criteria: tests run before and after, the final run is green, it takes a few turns, and no turn returns a 400. In the AIHubMix usage log, &lt;code&gt;minimax-m3.1-flash&lt;/code&gt; requests should show reasoning tokens. If turns take close to a minute, the effort setting isn't reaching the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we couldn't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code effort.&lt;/strong&gt; Whether Claude Code's effort setting reaches a non-Claude model as &lt;code&gt;output_config.effort&lt;/code&gt; isn't documented. If it doesn't, the model runs at &lt;code&gt;max&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forced tool calls.&lt;/strong&gt; Whether &lt;code&gt;tool_choice&lt;/code&gt; forcing is enforced or the model just happened to call the tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The image error.&lt;/strong&gt; Why the Wikimedia URL failed; our explanation is a reading of the error text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long tool loops.&lt;/strong&gt; Whether stripping thinking blocks breaks them. Our test was one short round trip.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AIHubMix's own M2.7 route.&lt;/strong&gt; What happens to &lt;code&gt;minimax-m2.7&lt;/code&gt; on AIHubMix after 18 November isn't stated. MiniMax's retirement applies to MiniMax's API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sample size.&lt;/strong&gt; All timings come from three runs per setting, so treat small differences as noise.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the MiniMax M3.1 Flash series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What you're migrating to, from the Space Bunny launch to its price against M2.7 and M3: &lt;a href="https://dev.to/aihubmix/minimax-m31-flash-ex-space-bunny-on-the-api-specs-price-and-a-measured-bug-fix-cost-1ijk"&gt;MiniMax M3.1 Flash (ex-Space Bunny) on the API: Specs, Price, and a Measured Bug-Fix Cost&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The effort setting decides most of your post-migration bill. All five levels, measured on one fix: &lt;a href="https://dev.to/aihubmix/measuring-minimax-m31-flashs-five-effort-levels-on-one-bug-fix-5ej3"&gt;Measuring MiniMax M3.1 Flash's Five Effort Levels on One Bug Fix&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If you're reconsidering MiniMax altogether, the same task on its two closest rivals: &lt;a href="https://dev.to/aihubmix/minimax-m31-flash-vs-deepseek-v41-flash-vs-claude-haiku-55-same-bug-fix-measured-5fnf"&gt;MiniMax M3.1 Flash vs DeepSeek V4.1 Flash vs Claude Haiku 5.5: Same Bug Fix, Measured&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://platform.minimax.io/docs/guides/models-intro" rel="noopener noreferrer"&gt;MiniMax: Models (retirement notice)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://platform.minimax.io/docs/api-reference/text-chat-anthropic" rel="noopener noreferrer"&gt;MiniMax: Messages API reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aihubmix.com/model/minimax-m3.1-flash" rel="noopener noreferrer"&gt;AIHubMix: MiniMax M3.1 Flash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/anomalyco/opencode/issues/54801" rel="noopener noreferrer"&gt;OpenCode issue #54801: no thinking depth variants for M3.1 Flash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.developersdigest.tech/blog/minimax-m2-5-m2-7-retirement-m3-migration" rel="noopener noreferrer"&gt;Developers Digest: MiniMax M2.5 and M2.7 Retirement&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>api</category>
      <category>minimax</category>
    </item>
    <item>
      <title>MiniMax M3.1 Flash (ex-Space Bunny) on the API: Specs, Price, and a Measured Bug-Fix Cost</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Mon, 19 Oct 2026 10:54:04 +0000</pubDate>
      <link>https://dev.to/aihubmix/minimax-m31-flash-ex-space-bunny-on-the-api-specs-price-and-a-measured-bug-fix-cost-1ijk</link>
      <guid>https://dev.to/aihubmix/minimax-m31-flash-ex-space-bunny-on-the-api-specs-price-and-a-measured-bug-fix-cost-1ijk</guid>
      <description>&lt;p&gt;&lt;strong&gt;Result first:&lt;/strong&gt; MiniMax M3.1 Flash is now callable per token on AIHubMix as &lt;code&gt;minimax-m3.1-flash&lt;/code&gt; ($0.165 input / $0.66 output per million tokens). On a two-bug fix in one Python function, it passed all 215 hidden tests at both settings we compared. Left at its default effort, it averaged 6,673 output tokens and 56 seconds per fix. At &lt;code&gt;reasoning_effort="low"&lt;/code&gt; it averaged 889 tokens and 9.5 seconds. That's $0.0045 vs $0.0006 per fix.&lt;/p&gt;

&lt;p&gt;If you're switching from M2.7 (MiniMax already reroutes plan traffic) or evaluating it against M3, the per-token price is only half the story. The effort setting decides the other half.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this model is
&lt;/h2&gt;

&lt;p&gt;M3.1 Flash first shipped anonymously. On 23 September it appeared on OpenRouter and OpenCode as &lt;strong&gt;Space Bunny Alpha&lt;/strong&gt;: free, 1M context, multimodal, thinking always on. According to &lt;a href="https://cellcog.ai/blog/what-is-space-bunny-alpha/" rel="noopener noreferrer"&gt;CellCog's timeline&lt;/a&gt; it topped OpenRouter's daily chart ahead of DeepSeek V4.1 Flash and stayed OpenCode's most-used model for five days. The community matched it to MiniMax through the tokenizer before MiniMax said anything. cheaty's &lt;a href="https://x.com/cheatyyyy/status/2102781392199565683" rel="noopener noreferrer"&gt;comparison on X&lt;/a&gt; found the text tokenizer "perfectly matches that of the MiniMax M3", and other testers matched 36/36 and 50/50 probe strings.&lt;/p&gt;

&lt;p&gt;Timeline:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date (2026)&lt;/th&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;23 Sep&lt;/td&gt;
&lt;td&gt;Space Bunny Alpha live on OpenRouter and OpenCode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;27 Sep&lt;/td&gt;
&lt;td&gt;MiniMax names M3.1-Flash-Preview, default in MiniMax Code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30 Sep&lt;/td&gt;
&lt;td&gt;Token Plan becomes M Plan, includes M3.1 Flash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;19 Oct&lt;/td&gt;
&lt;td&gt;M2.5/M2.7 closed to new users; plan requests routed to M3.1 Flash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;19 Oct&lt;/td&gt;
&lt;td&gt;minimax-m3.1-flash live on AIHubMix, pay per token&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;MiniMax's &lt;a href="https://platform.minimax.io/docs/guides/models-intro" rel="noopener noreferrer"&gt;model list&lt;/a&gt; now drops the "Preview" label and calls it &lt;code&gt;MiniMax-M3.1-Flash&lt;/code&gt;, a "frontier multimodal coding model with 1M context window and tunable thinking depth." Every AIHubMix response reports that upstream name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spec diff vs M2.7
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;MiniMax M2.7&lt;/th&gt;
&lt;th&gt;MiniMax M3.1 Flash&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Context window&lt;/td&gt;
&lt;td&gt;204,800&lt;/td&gt;
&lt;td&gt;1,000,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;max_tokens (recommended / max)&lt;/td&gt;
&lt;td&gt;65,536 / 204,800&lt;/td&gt;
&lt;td&gt;131,072 / 524,288&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input&lt;/td&gt;
&lt;td&gt;Text&lt;/td&gt;
&lt;td&gt;Text, image, video&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Thinking&lt;/td&gt;
&lt;td&gt;Always on, no levels&lt;/td&gt;
&lt;td&gt;Always on, five levels&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Default thinking depth&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;max&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Explicit cache_control&lt;/td&gt;
&lt;td&gt;Supported, writes billed&lt;/td&gt;
&lt;td&gt;Not supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Default top_p&lt;/td&gt;
&lt;td&gt;0.9&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Status&lt;/td&gt;
&lt;td&gt;Retires 18 Nov 2026&lt;/td&gt;
&lt;td&gt;Current&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Unchanged: both think on every request, both speak MiniMax's Anthropic-compatible and OpenAI-compatible APIs, and both accept only &lt;code&gt;tool_choice: auto&lt;/code&gt; per MiniMax's API reference.&lt;/p&gt;

&lt;p&gt;The new knob is effort. MiniMax's &lt;a href="https://platform.minimax.io/docs/guides/text-generation" rel="noopener noreferrer"&gt;text generation guide&lt;/a&gt; lists &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;, &lt;code&gt;xhigh&lt;/code&gt;, and &lt;code&gt;max&lt;/code&gt;, and the model uses &lt;code&gt;max&lt;/code&gt; when the field is omitted. M2.7 code doesn't send this field, so after a model swap, every request runs at max.&lt;/p&gt;

&lt;h2&gt;
  
  
  Price table
&lt;/h2&gt;

&lt;p&gt;Per million tokens, checked 19 October 2026. Official prices are from MiniMax's pay-as-you-go page; M3's includes MiniMax's "Permanent 50% off" label.&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;Official input / output&lt;/th&gt;
&lt;th&gt;AIHubMix input / output&lt;/th&gt;
&lt;th&gt;AIHubMix cache read&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MiniMax M2.7&lt;/td&gt;
&lt;td&gt;$0.30 / $1.20&lt;/td&gt;
&lt;td&gt;$0.2958 / $1.1832&lt;/td&gt;
&lt;td&gt;$0.05916&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MiniMax M3.1 Flash&lt;/td&gt;
&lt;td&gt;not published&lt;/td&gt;
&lt;td&gt;$0.165 / $0.66&lt;/td&gt;
&lt;td&gt;$0.0165&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MiniMax M3&lt;/td&gt;
&lt;td&gt;$0.30 / $1.20&lt;/td&gt;
&lt;td&gt;$0.288 / $1.152&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On AIHubMix, Flash is about 44% below M2.7 ($0.165 ÷ $0.2958 ≈ 0.56) and about 43% below M3 ($0.165 ÷ $0.288 ≈ 0.57); output follows the same ratio. M3's official price doubles above 512K input tokens, while AIHubMix lists one flat price for Flash.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring a real task
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt; an AIHubMix key in &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt;, and the &lt;code&gt;openai&lt;/code&gt; Python SDK. The &lt;a href="https://docs.aihubmix.com/en/quick-start" rel="noopener noreferrer"&gt;AIHubMix quick start&lt;/a&gt; covers both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task:&lt;/strong&gt; a billing function &lt;code&gt;billable_days(start, end, pauses)&lt;/code&gt; with two bugs. A pause that runs past the period end double-counts one day, and overlapping pauses are subtracted twice. The prompt describes the symptoms and asks for the corrected function only. A local harness then runs 215 hidden cases. Each setting ran three times through Chat Completions on 19 October 2026. These are AIHubMix's own measurements, not yet reproduced by anyone else.&lt;/p&gt;

&lt;p&gt;The request, with cost computed from &lt;code&gt;usage&lt;/code&gt;:&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&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;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://aihubmix.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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;PRICE_IN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;PRICE_OUT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;PRICE_CACHE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.165&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.66&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0165&lt;/span&gt;  &lt;span class="c1"&gt;# AIHubMix, per 1M tokens
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;effort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;extra&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;reasoning_effort&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;effort&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;effort&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
    &lt;span class="n"&gt;r&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;minimax-m3.1-flash&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;32768&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="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;extra&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;
    &lt;span class="n"&gt;cached&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prompt_tokens_details&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cached_tokens&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prompt_tokens_details&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prompt_tokens&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;PRICE_IN&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;cached&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;PRICE_CACHE&lt;/span&gt;
            &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;PRICE_OUT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;r&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;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cost&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Results (3 runs each):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Avg output tokens&lt;/th&gt;
&lt;th&gt;Avg time&lt;/th&gt;
&lt;th&gt;Avg cost per fix&lt;/th&gt;
&lt;th&gt;Tests passed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Effort omitted (= max)&lt;/td&gt;
&lt;td&gt;6,673&lt;/td&gt;
&lt;td&gt;56 s&lt;/td&gt;
&lt;td&gt;$0.0045&lt;/td&gt;
&lt;td&gt;215/215 every run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Effort low&lt;/td&gt;
&lt;td&gt;889&lt;/td&gt;
&lt;td&gt;9.5 s&lt;/td&gt;
&lt;td&gt;$0.0006&lt;/td&gt;
&lt;td&gt;215/215 every run&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Here is the arithmetic for the default row: 464 prompt tokens, about 192 of them cached, plus 6,673 output tokens. (272 × $0.165 + 192 × $0.0165 + 6,673 × $0.66) ÷ 1,000,000 ≈ $0.0045. Per 1,000 such fixes, that's about $4.45 at the default and $0.64 at &lt;code&gt;low&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Variance was large: the default ranged from 4,589 to 9,680 output tokens, and from 39 to 82 seconds. The effort post in this series has all five levels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes when you switch
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Unset effort means max.&lt;/strong&gt; If your client never sends an effort field, expect long turns and thinking-heavy bills. Fix: send &lt;code&gt;reasoning_effort&lt;/code&gt; (Chat Completions) on every request; start at &lt;code&gt;low&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No way to skip thinking.&lt;/strong&gt; M3 can run without thinking; Flash can't. Short classification prompts spent almost nothing (0 to 6 thinking tokens) in our runs, but zero isn't guaranteed. If a code path needs a guaranteed non-thinking call, keep it on M3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No Priority tier.&lt;/strong&gt; Flash rejects the &lt;code&gt;service_tier&lt;/code&gt; field. If you relied on M3's Priority tier (1.5× price) for latency, there's no equivalent here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Video isn't on AIHubMix's listing yet.&lt;/strong&gt; MiniMax documents video input; AIHubMix currently lists text and image. Base64 images and image URLs both worked in our tests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompts need to be specific.&lt;/strong&gt; An early Space Bunny user called it "insanely fast, but it needs clear and specific instructions, otherwise it's too lazy." Spell out the expected output and the checks the model should run.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What we can't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quality against M3.&lt;/strong&gt; MiniMax published no benchmark for M3.1 Flash, and Artificial Analysis has no entry for it. M3 has MiniMax's self-reported 59.0% on SWE-Bench Pro and an Artificial Analysis Intelligence Index of 29.2. Any Flash benchmark table you see is either M3's or unsourced.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MiniMax's own per-token price.&lt;/strong&gt; Not published as of 19 October 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Harder tasks.&lt;/strong&gt; Our task was bounded, and &lt;code&gt;low&lt;/code&gt; was enough. Three runs per setting can't tell you where higher effort starts paying off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open weights.&lt;/strong&gt; MiniMax says it plans to release them, with no date. M3's weights are on Hugging Face.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Should you switch
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;M Plan / Token Plan users on M2.5 or M2.7:&lt;/strong&gt; you already have; MiniMax reroutes the names starting today. Re-run evals and add an effort setting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pay-as-you-go users on M2.5 or M2.7:&lt;/strong&gt; you have until 18 November. On AIHubMix, change the model ID and add &lt;code&gt;reasoning_effort&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Teams on M3 for coding agents:&lt;/strong&gt; try Flash at &lt;code&gt;low&lt;/code&gt;/&lt;code&gt;medium&lt;/code&gt; on a slice of traffic. AIHubMix's &lt;a href="https://aihubmix.com/compare/minimax-m3.1-flash/minimax-m3" rel="noopener noreferrer"&gt;compare page&lt;/a&gt; shows both price cards, and the &lt;a href="https://aihubmix.com/model/minimax-m3.1-flash" rel="noopener noreferrer"&gt;model page&lt;/a&gt; has the ID and endpoints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stay on M3&lt;/strong&gt; if you need open weights, thinking off, independent benchmarks, or the Priority tier.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the MiniMax M3.1 Flash series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Switching existing M2.7 code? This one covers the 400 errors and the silent changes: &lt;a href="https://dev.to/aihubmix/fixing-requires-adaptive-thinking-2013-when-moving-from-minimax-m27-to-m31-flash-1iif"&gt;Fixing "requires adaptive thinking" (2013) When Moving from MiniMax M2.7 to M3.1 Flash&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The default effort drove most of the cost above. Here are all five levels on the same fix: &lt;a href="https://dev.to/aihubmix/measuring-minimax-m31-flashs-five-effort-levels-on-one-bug-fix-5ej3"&gt;Measuring MiniMax M3.1 Flash's Five Effort Levels on One Bug Fix&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The same task on the two other cheap coding models released the same month: &lt;a href="https://dev.to/aihubmix/minimax-m31-flash-vs-deepseek-v41-flash-vs-claude-haiku-55-same-bug-fix-measured-5fnf"&gt;MiniMax M3.1 Flash vs DeepSeek V4.1 Flash vs Claude Haiku 5.5: Same Bug Fix, Measured&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://platform.minimax.io/docs/guides/models-intro" rel="noopener noreferrer"&gt;MiniMax: Models&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://platform.minimax.io/docs/guides/text-generation" rel="noopener noreferrer"&gt;MiniMax: Model Invocation (text generation guide)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aihubmix.com/model/minimax-m3.1-flash" rel="noopener noreferrer"&gt;AIHubMix: MiniMax M3.1 Flash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cellcog.ai/blog/what-is-space-bunny-alpha/" rel="noopener noreferrer"&gt;CellCog: Space Bunny Alpha, the Stealth Model and the MiniMax Clues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.developersdigest.tech/blog/minimax-m2-5-m2-7-retirement-m3-migration" rel="noopener noreferrer"&gt;Developers Digest: MiniMax M2.5 and M2.7 Retirement&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>api</category>
      <category>minimax</category>
    </item>
    <item>
      <title>Codex config.toml: A Working Setup and What Each Error Means</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Mon, 19 Oct 2026 10:02:29 +0000</pubDate>
      <link>https://dev.to/aihubmix/codex-configtoml-a-working-setup-and-what-each-error-means-2ghj</link>
      <guid>https://dev.to/aihubmix/codex-configtoml-a-working-setup-and-what-each-error-means-2ghj</guid>
      <description>&lt;p&gt;Recent Codex CLI releases reject parts of older &lt;code&gt;config.toml&lt;/code&gt; files. A &lt;code&gt;profile = "..."&lt;/code&gt; line, &lt;code&gt;wire_api = "chat"&lt;/code&gt; or &lt;code&gt;approval_policy = "untrusted"&lt;/code&gt; now stop it at startup, and a few other mistakes fail silently. Configs copied from guides written earlier in 2026 are the usual cause.&lt;/p&gt;

&lt;p&gt;This post is the config that works on Codex CLI 0.162.1 with a custom provider, the checks to run after editing it, and the exact messages Codex prints when something is wrong. Checked on October 19, 2026, against OpenAI's configuration docs. AIHubMix is the provider in the examples; any gateway that serves the OpenAI Responses API is configured the same way.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;File: &lt;code&gt;~/.codex/config.toml&lt;/code&gt; (&lt;code&gt;C:\Users\&amp;lt;you&amp;gt;\.codex\config.toml&lt;/code&gt; on Windows). Codex reads it only at startup.&lt;/li&gt;
&lt;li&gt;Provider: &lt;code&gt;base_url&lt;/code&gt;, &lt;code&gt;wire_api = "responses"&lt;/code&gt; (the only accepted value), and &lt;code&gt;env_key&lt;/code&gt;, which names an environment variable holding the key.&lt;/li&gt;
&lt;li&gt;Profiles: one file each, &lt;code&gt;~/.codex/&amp;lt;name&amp;gt;.config.toml&lt;/code&gt;, selected with &lt;code&gt;--profile &amp;lt;name&amp;gt;&lt;/code&gt;. &lt;code&gt;[profiles.x]&lt;/code&gt; tables inside &lt;code&gt;config.toml&lt;/code&gt; are gone.&lt;/li&gt;
&lt;li&gt;Project &lt;code&gt;.codex/config.toml&lt;/code&gt;: trusted projects only, and it can't set &lt;code&gt;model_provider&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Proxy: no config key. Codex follows &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;ALL_PROXY&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Codex CLI installed (&lt;code&gt;npm install -g @openai/codex&lt;/code&gt;), checked here on 0.162.1&lt;/li&gt;
&lt;li&gt;An API key for your provider; for AIHubMix, from the &lt;a href="https://aihubmix.com/token" rel="noopener noreferrer"&gt;AIHubMix console&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The config
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="c"&gt;# ~/.codex/config.toml&lt;/span&gt;
&lt;span class="py"&gt;model&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"gpt-6-sol"&lt;/span&gt;
&lt;span class="py"&gt;model_provider&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"aihubmix"&lt;/span&gt;
&lt;span class="py"&gt;model_reasoning_effort&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"high"&lt;/span&gt;

&lt;span class="nn"&gt;[model_providers.aihubmix]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"AIHubMix"&lt;/span&gt;
&lt;span class="py"&gt;base_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://aihubmix.com/v1"&lt;/span&gt;
&lt;span class="py"&gt;wire_api&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"responses"&lt;/span&gt;
&lt;span class="py"&gt;env_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"AIHUBMIX_API_KEY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# macOS / Linux: put this in ~/.zshrc or ~/.bashrc, then open a new terminal&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sk-...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Windows PowerShell: applies to terminals opened afterwards&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;setx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sk-..."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three rules that cause most failures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;model_provider&lt;/code&gt; must match the table name, and the table name can't be &lt;code&gt;openai&lt;/code&gt;, &lt;code&gt;ollama&lt;/code&gt; or &lt;code&gt;lmstudio&lt;/code&gt;, which belong to Codex's built-in providers.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;env_key&lt;/code&gt; is the &lt;strong&gt;name&lt;/strong&gt; of the variable, not the key. The key saved by &lt;code&gt;codex login&lt;/code&gt; in &lt;code&gt;auth.json&lt;/code&gt; is never sent to a custom provider.&lt;/li&gt;
&lt;li&gt;Top-level keys go above the first &lt;code&gt;[table]&lt;/code&gt; line. In TOML, everything after a table header belongs to that table.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Check it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="s2"&gt;"say ok"&lt;/span&gt;     &lt;span class="c"&gt;# one non-interactive request&lt;/span&gt;
codex doctor            &lt;span class="c"&gt;# install, config and auth checks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;codex exec&lt;/code&gt; prints the effective settings before the request: &lt;code&gt;model:&lt;/code&gt;, &lt;code&gt;provider:&lt;/code&gt;, &lt;code&gt;approval:&lt;/code&gt;, &lt;code&gt;sandbox:&lt;/code&gt; and &lt;code&gt;reasoning effort:&lt;/code&gt;. That header is the quickest way to see which values actually won. Note that &lt;code&gt;codex exec&lt;/code&gt; reported &lt;code&gt;approval: never&lt;/code&gt; in testing even with &lt;code&gt;on-request&lt;/code&gt; in the config, because a non-interactive run has nobody to ask.&lt;/p&gt;

&lt;h2&gt;
  
  
  Profiles and project config
&lt;/h2&gt;

&lt;p&gt;A profile is a file with only the keys that differ, written at the top level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="c"&gt;# ~/.codex/review.config.toml&lt;/span&gt;
&lt;span class="py"&gt;model_reasoning_effort&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"xhigh"&lt;/span&gt;
&lt;span class="py"&gt;sandbox_mode&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"read-only"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with &lt;code&gt;codex --profile review&lt;/code&gt;. The format changed in Codex 0.134.0; OpenAI's &lt;a href="https://learn.chatgpt.com/docs/config-file/config-advanced#profiles" rel="noopener noreferrer"&gt;advanced configuration guide&lt;/a&gt; covers the migration.&lt;/p&gt;

&lt;p&gt;A repo's &lt;code&gt;.codex/config.toml&lt;/code&gt; is read only if the project is trusted in your user config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[projects."/Users/you/code/my-app"]&lt;/span&gt;
&lt;span class="py"&gt;trust_level&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"trusted"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even then, Codex drops &lt;code&gt;model_provider&lt;/code&gt;, &lt;code&gt;model_providers&lt;/code&gt;, &lt;code&gt;openai_base_url&lt;/code&gt;, &lt;code&gt;profile&lt;/code&gt;, &lt;code&gt;notify&lt;/code&gt; and a few others from project files, so a repo can't redirect your requests. Keep providers in &lt;code&gt;~/.codex/config.toml&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Precedence
&lt;/h2&gt;

&lt;p&gt;From OpenAI's &lt;a href="https://learn.chatgpt.com/docs/config-file/config-basic" rel="noopener noreferrer"&gt;Config basics&lt;/a&gt;, highest first:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CLI flags and &lt;code&gt;-c key=value&lt;/code&gt; overrides&lt;/li&gt;
&lt;li&gt;Project &lt;code&gt;.codex/config.toml&lt;/code&gt; (closest to the working directory wins)&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;--profile&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;~/.codex/config.toml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/codex/config.toml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Built-in defaults&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The project file outranks the profile. In a test with a different &lt;code&gt;model&lt;/code&gt; in the user config, a profile and a trusted project, &lt;code&gt;codex exec --profile fast&lt;/code&gt; ran the project's model and only took the profile's reasoning effort; &lt;code&gt;-m&lt;/code&gt; beat both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sandbox and approvals
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Values&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;sandbox_mode&lt;/td&gt;
&lt;td&gt;read-only, workspace-write, danger-full-access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;approval_policy&lt;/td&gt;
&lt;td&gt;on-request, never, or a granular table&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;workspace-write&lt;/code&gt; allows writes in the working directory, &lt;code&gt;/tmp&lt;/code&gt; and &lt;code&gt;$TMPDIR&lt;/code&gt;, with no network until you set &lt;code&gt;network_access = true&lt;/code&gt; under &lt;code&gt;[sandbox_workspace_write]&lt;/code&gt;. &lt;code&gt;never&lt;/code&gt; stops prompts but doesn't widen the sandbox.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proxy
&lt;/h2&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;HTTPS_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:7890
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;NO_PROXY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;localhost,127.0.0.1
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CODEX_CA_CERTIFICATE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/path/to/corp-root-ca.pem   &lt;span class="c"&gt;# only for TLS-inspecting proxies&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OpenAI's &lt;a href="https://learn.chatgpt.com/docs/config-file/environment-variables" rel="noopener noreferrer"&gt;environment variable reference&lt;/a&gt; documents &lt;code&gt;CODEX_CA_CERTIFICATE&lt;/code&gt; but not the proxy variables. With Codex 0.162.1, requests to the custom provider went through &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, lowercase &lt;code&gt;https_proxy&lt;/code&gt; and &lt;code&gt;ALL_PROXY&lt;/code&gt;, and hosts in &lt;code&gt;NO_PROXY&lt;/code&gt; were skipped.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom models in /model
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/model&lt;/code&gt; lists only OpenAI's models unless a top-level &lt;code&gt;model_catalog_json&lt;/code&gt; points at a catalog file. The catalog replaces the built-in list, and every entry needs the full internal field set, so generate it: the &lt;a href="https://docs.aihubmix.com/en/api/Codex-CLI" rel="noopener noreferrer"&gt;AIHubMix Codex CLI guide&lt;/a&gt; has a script that clones a built-in entry for the top 30 AIHubMix models. Verify with &lt;code&gt;codex debug models&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes and fixes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;legacy profile = "..." config is no longer supported&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;profile = "..."&lt;/code&gt; selector is still in &lt;code&gt;config.toml&lt;/code&gt;. Move the profile into its own file and delete the selector. With a leftover &lt;code&gt;[profiles.x]&lt;/code&gt; table, &lt;code&gt;--profile x&lt;/code&gt; fails with &lt;code&gt;--profile x cannot be used while ... contains legacy ... config&lt;/code&gt;. Without the flag, the table is ignored silently.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;wire_api = "chat" is no longer supported&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Change it to &lt;code&gt;responses&lt;/code&gt;. Providers that only serve Chat Completions need a translating proxy.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;model_providers contains reserved built-in provider IDs&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Rename a provider called &lt;code&gt;openai&lt;/code&gt;, &lt;code&gt;ollama&lt;/code&gt; or &lt;code&gt;lmstudio&lt;/code&gt;. To repoint the built-in OpenAI provider, set the top-level &lt;code&gt;openai_base_url&lt;/code&gt; instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;approval_policy = "untrusted" is no longer supported&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Remove it or use &lt;code&gt;on-request&lt;/code&gt;. &lt;code&gt;on-failure&lt;/code&gt; is deprecated but still accepted.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Missing environment variable: AIHUBMIX_API_KEY&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The variable named in &lt;code&gt;env_key&lt;/code&gt; isn't in the environment Codex started from. New terminal, or &lt;code&gt;source ~/.zshrc&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  401 Unauthorized after "Reconnecting..."
&lt;/h3&gt;

&lt;p&gt;The request carried no key. Check &lt;code&gt;env_key&lt;/code&gt;; &lt;code&gt;auth.json&lt;/code&gt; doesn't apply to custom providers.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Model metadata for ... not found. Defaulting to fallback metadata&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;A warning for any model outside Codex's catalog, normal for non-OpenAI models. Requests still work; a catalog removes it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Ignored unsupported project-local config keys&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;A project file set a user-only key, usually &lt;code&gt;model_provider&lt;/code&gt;. Move it to &lt;code&gt;~/.codex/config.toml&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;missing field base_instructions&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;A catalog entry is incomplete and the whole file is rejected. Regenerate the catalog instead of hand-editing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not verified here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;PAC files: Codex has no setting for them; the behavior described in third-party write-ups wasn't tested.&lt;/li&gt;
&lt;li&gt;The desktop app's model picker: it may hide catalog models (&lt;a href="https://github.com/openai/codex/issues/19694" rel="noopener noreferrer"&gt;openai/codex#19694&lt;/a&gt;); only the CLI was tested.&lt;/li&gt;
&lt;li&gt;No real requests were sent for the error tests; each used a throwaway &lt;code&gt;CODEX_HOME&lt;/code&gt; and an unreachable base URL.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://learn.chatgpt.com/docs/config-file/config-basic" rel="noopener noreferrer"&gt;Config basics&lt;/a&gt; (OpenAI)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://learn.chatgpt.com/docs/config-file/config-advanced" rel="noopener noreferrer"&gt;Advanced configuration&lt;/a&gt; (OpenAI)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://learn.chatgpt.com/docs/config-file/config-reference" rel="noopener noreferrer"&gt;Configuration reference&lt;/a&gt; (OpenAI)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aihubmix.com/en/api/Codex-CLI" rel="noopener noreferrer"&gt;Codex CLI integration guide&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://codex.danielvaughan.com/2026/04/18/codex-cli-proxy-configuration-socks-http-corporate-networks/" rel="noopener noreferrer"&gt;Codex CLI proxy configuration: SOCKS, HTTP, and corporate networks&lt;/a&gt; (Daniel Vaughan)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>codex</category>
      <category>openai</category>
    </item>
    <item>
      <title>DeepSeek V4.1 Flash 1017: Same Price, Shorter Outputs, and AIHubMix vs OpenRouter Pricing</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Mon, 19 Oct 2026 05:35:27 +0000</pubDate>
      <link>https://dev.to/aihubmix/deepseek-v41-flash-1017-same-price-shorter-outputs-should-you-switch-1nj5</link>
      <guid>https://dev.to/aihubmix/deepseek-v41-flash-1017-same-price-shorter-outputs-should-you-switch-1nj5</guid>
      <description>&lt;p&gt;DeepSeek V4.1 Flash 1017 keeps the September checkpoint's per-token price and API surface, and by DeepSeek's own chart it cuts the cost of a DeepSWE task from about $0.50 to just under $0.20 while the score rises from 74.2% to 77.0%. Terminal-Bench 4.0 goes from 31.2 to 42.3. All of these are DeepSeek's numbers; nobody has reproduced them yet.&lt;/p&gt;

&lt;p&gt;The engineering problem is that the upgrade ships as a checkpoint swap, not as a new API. On October 17, 2026, DeepSeek pointed &lt;code&gt;deepseek-flash&lt;/code&gt; at 1017, so anything calling DeepSeek directly has already moved, and the September checkpoint can't be pinned. On AIHubMix, 1017 has its own ID, &lt;a href="https://aihubmix.com/model/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;&lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;&lt;/a&gt;, so you choose when to switch. Either way, three things need checking on your own workload:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which checkpoint actually answered;&lt;/li&gt;
&lt;li&gt;whether shorter outputs break anything downstream;&lt;/li&gt;
&lt;li&gt;what a finished task costs now, not what a token costs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post covers what changed, a working request through AIHubMix, how to confirm the checkpoint, the cost math, how AIHubMix and OpenRouter compare on price, and the failure modes worth testing for.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed, in one table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;September V4.1 Flash&lt;/th&gt;
&lt;th&gt;V4.1 Flash 1017&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Architecture&lt;/td&gt;
&lt;td&gt;552B MoE, 8B / 16B active&lt;/td&gt;
&lt;td&gt;Same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context / max output&lt;/td&gt;
&lt;td&gt;1M / 384K&lt;/td&gt;
&lt;td&gt;Same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input&lt;/td&gt;
&lt;td&gt;Text and images&lt;/td&gt;
&lt;td&gt;Same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Thinking default&lt;/td&gt;
&lt;td&gt;On, effort high&lt;/td&gt;
&lt;td&gt;Same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Effort levels&lt;/td&gt;
&lt;td&gt;low / high / max&lt;/td&gt;
&lt;td&gt;Same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepSeek API name&lt;/td&gt;
&lt;td&gt;deepseek-flash&lt;/td&gt;
&lt;td&gt;deepseek-flash (now 1017)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;List price&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output length&lt;/td&gt;
&lt;td&gt;Long&lt;/td&gt;
&lt;td&gt;Shorter (DeepSeek, not quantified)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href="https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash-1017" rel="noopener noreferrer"&gt;Hugging Face model card&lt;/a&gt; calls it "a minor update", and DeepSeek's &lt;a href="https://api-docs.deepseek.com/news/news261017" rel="noopener noreferrer"&gt;release note&lt;/a&gt; calls it "a Pareto improvement in performance and cost". The architecture and API are untouched; the post-training is new, described by DeepSeek as "reinforcement learning with self-feedback to improve end-to-end project development".&lt;/p&gt;

&lt;p&gt;The legacy names &lt;code&gt;deepseek-v4-flash&lt;/code&gt; and &lt;code&gt;deepseek-v4-flash-vision-exp&lt;/code&gt; still resolve on DeepSeek's API, and both now run on 1017 at Flash prices.&lt;/p&gt;

&lt;h2&gt;
  
  
  The benchmark deltas
&lt;/h2&gt;

&lt;p&gt;Figures come from DeepSeek's model card and changelog, compiled the same way by &lt;a href="https://the-decoder.com/deepseek-v4-1-flash-1017-beats-larger-rivals-in-agentic-tasks-while-once-again-massively-cutting-per-task-costs/" rel="noopener noreferrer"&gt;The Decoder&lt;/a&gt; and Kingy.ai; nobody has reproduced them independently.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Benchmark&lt;/th&gt;
&lt;th&gt;September&lt;/th&gt;
&lt;th&gt;1017&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Terminal-Bench 4.0&lt;/td&gt;
&lt;td&gt;31.2&lt;/td&gt;
&lt;td&gt;42.3&lt;/td&gt;
&lt;td&gt;+11.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ProgramBench&lt;/td&gt;
&lt;td&gt;20.3&lt;/td&gt;
&lt;td&gt;29.1&lt;/td&gt;
&lt;td&gt;+8.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apex Bench v1.1&lt;/td&gt;
&lt;td&gt;64.6&lt;/td&gt;
&lt;td&gt;72.1&lt;/td&gt;
&lt;td&gt;+7.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HLE, no tools&lt;/td&gt;
&lt;td&gt;36.8&lt;/td&gt;
&lt;td&gt;42.6&lt;/td&gt;
&lt;td&gt;+5.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automation-Bench&lt;/td&gt;
&lt;td&gt;54.8&lt;/td&gt;
&lt;td&gt;60.5&lt;/td&gt;
&lt;td&gt;+5.7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agents' Last Exam&lt;/td&gt;
&lt;td&gt;31.8&lt;/td&gt;
&lt;td&gt;35.4&lt;/td&gt;
&lt;td&gt;+3.6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepSWE v1.1&lt;/td&gt;
&lt;td&gt;74.2&lt;/td&gt;
&lt;td&gt;77.0&lt;/td&gt;
&lt;td&gt;+2.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NL2Repo-Bench&lt;/td&gt;
&lt;td&gt;65.4&lt;/td&gt;
&lt;td&gt;68.2&lt;/td&gt;
&lt;td&gt;+2.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BabyVision, with tools&lt;/td&gt;
&lt;td&gt;89.6&lt;/td&gt;
&lt;td&gt;92.5&lt;/td&gt;
&lt;td&gt;+2.9&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Terminal-Bench 4.0 ran in the Claude Code harness; DeepSWE in mini-SWE-v2.&lt;/p&gt;

&lt;p&gt;Read it by workload. Long terminal sessions and building a program from scratch moved the most, which matches the training DeepSeek describes. Repository-level bug fixing (DeepSWE, NL2Repo) and vision moved two to three points. If your agent mostly patches existing repos, expect a smaller step than the headline number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An AIHubMix API key exported as &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt;. The &lt;a href="https://docs.aihubmix.com/en/quick-start" rel="noopener noreferrer"&gt;AIHubMix quick start&lt;/a&gt; walks through creating one.&lt;/li&gt;
&lt;li&gt;The OpenAI Python SDK (&lt;code&gt;pip install openai&lt;/code&gt;), pointed at &lt;code&gt;https://aihubmix.com/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The model ID &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;. AIHubMix serves it on Chat Completions, the Responses API, and Anthropic Messages; the sample below uses Chat Completions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The request
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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://aihubmix.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;resp&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;deepseek-v4.1-flash-1017&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;Write a Python function that merges overlapping intervals.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="n"&gt;reasoning_effort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;high&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;32000&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;resp&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;&lt;code&gt;reasoning_effort="high"&lt;/code&gt; is the default anyway; it's set explicitly so the level shows up in your code review. Thinking is on by default, and reasoning tokens count toward &lt;code&gt;max_tokens&lt;/code&gt;, so leave room. The model card recommends at least 256K for long agent runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirm which checkpoint answered
&lt;/h2&gt;

&lt;p&gt;AIHubMix ran a set of requests against &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt; on October 19, 2026, one run per check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every response's &lt;code&gt;model&lt;/code&gt; field read &lt;code&gt;deepseek-v4-1-flash-261017&lt;/code&gt;. Log &lt;code&gt;resp.model&lt;/code&gt;: that string is how you know the 1017 checkpoint answered.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reasoning_effort&lt;/code&gt; values &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;, and &lt;code&gt;max&lt;/code&gt; were all accepted with HTTP 200.&lt;/li&gt;
&lt;li&gt;The response included &lt;code&gt;reasoning_content&lt;/code&gt;, and &lt;code&gt;usage.completion_tokens_details.reasoning_tokens&lt;/code&gt; reported the thinking share of the output, which is the number to watch when you compare effort levels.&lt;/li&gt;
&lt;li&gt;Chat Completions, the Responses API (&lt;code&gt;/v1/responses&lt;/code&gt;), and Anthropic Messages (&lt;code&gt;/v1/messages&lt;/code&gt;) all returned 200.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cost: the token price is fixed, the token count isn't
&lt;/h2&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;DeepSeek input&lt;/th&gt;
&lt;th&gt;DeepSeek output&lt;/th&gt;
&lt;th&gt;AIHubMix input&lt;/th&gt;
&lt;th&gt;AIHubMix output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;V4.1 Flash (September)&lt;/td&gt;
&lt;td&gt;$0.30&lt;/td&gt;
&lt;td&gt;$1.20&lt;/td&gt;
&lt;td&gt;$0.3098&lt;/td&gt;
&lt;td&gt;$1.2392&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V4.1 Flash 1017&lt;/td&gt;
&lt;td&gt;$0.30&lt;/td&gt;
&lt;td&gt;$1.20&lt;/td&gt;
&lt;td&gt;$0.3098&lt;/td&gt;
&lt;td&gt;$1.2392&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V4 Pro 0813&lt;/td&gt;
&lt;td&gt;$1.32&lt;/td&gt;
&lt;td&gt;$3.96&lt;/td&gt;
&lt;td&gt;$1.3944&lt;/td&gt;
&lt;td&gt;$4.1832&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Peak prices per 1M tokens, cache miss. Peak hours are 01:00–04:00 and 06:00–10:00 UTC on weekdays; every other hour, weekends, and Chinese public holidays are off-peak at half price. Flash cache hits cost $0.006 on DeepSeek and $0.0062 on AIHubMix at peak. AIHubMix is running a limited-time 30% discount on 1017; the figures here use list prices.&lt;/p&gt;

&lt;p&gt;Since the price per token is identical, any saving has to come from fewer tokens. The September checkpoint was verbose: when &lt;a href="https://artificialanalysis.ai/models/deepseek-v4-1-flash" rel="noopener noreferrer"&gt;Artificial Analysis&lt;/a&gt; ran its Intelligence Index on it at max effort, it generated about 250M output tokens against a 130M median, and 62% more than DeepSeek's V4 Pro 0813. DeepSeek's DeepSWE chart, as read by The Decoder, puts the September model at 74.2% for about $0.50 a task, 1017 at its top setting at 77.0% for just under $0.20, and 1017 at its low setting above 72% for about $0.10.&lt;/p&gt;

&lt;p&gt;To turn that into a per-session number, here is an estimate from stated assumptions, because no published test gives per-task token counts for 1017: a bug-fix session of 40 model calls, 1.2M input tokens in total with 90% served from cache, and 60K output tokens including thinking. At AIHubMix list prices:&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;Peak&lt;/th&gt;
&lt;th&gt;Off-peak&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;V4.1 Flash 1017&lt;/td&gt;
&lt;td&gt;$0.118&lt;/td&gt;
&lt;td&gt;$0.059&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V4 Pro 0813&lt;/td&gt;
&lt;td&gt;$0.469&lt;/td&gt;
&lt;td&gt;$0.233&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1017, peak: 0.12M × $0.3098 + 1.08M × $0.0062 + 0.06M × $1.2392 = $0.118
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same token counts cost exactly the same on the September model. What changes is the token count itself: if 1017 needs fewer turns and shorter answers for the same fix, the bill shrinks with them. Running batch work off-peak halves it again.&lt;/p&gt;

&lt;p&gt;Effort is the other lever. DeepSeek's V4.1 Flash paper maps the API's low, high, and max tiers to internal effort values of 50, 75, and 100, and reports that the last step to max "lengthens agent trajectories by 1.6–1.8× for only marginal improvements". Start agents at &lt;code&gt;high&lt;/code&gt; and reserve &lt;code&gt;max&lt;/code&gt; for the hardest tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  AIHubMix vs OpenRouter
&lt;/h2&gt;

&lt;p&gt;OpenRouter serves 1017 as &lt;a href="https://openrouter.ai/deepseek/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;&lt;code&gt;deepseek/deepseek-v4.1-flash-1017&lt;/code&gt;&lt;/a&gt; through 15 providers, so its price depends on which one answers. The like-for-like row is DeepSeek's own endpoint:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Route&lt;/th&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;Cache hit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OpenRouter, DeepSeek endpoint&lt;/td&gt;
&lt;td&gt;$0.30&lt;/td&gt;
&lt;td&gt;$1.20&lt;/td&gt;
&lt;td&gt;$0.006&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIHubMix, DeepSeek channel&lt;/td&gt;
&lt;td&gt;$0.3098&lt;/td&gt;
&lt;td&gt;$1.2392&lt;/td&gt;
&lt;td&gt;$0.0062&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AIHubMix, ByteDance, Oct 19–25&lt;/td&gt;
&lt;td&gt;$0.1971&lt;/td&gt;
&lt;td&gt;$0.7885&lt;/td&gt;
&lt;td&gt;$0.0039&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Peak prices per 1M tokens, checked October 19, 2026; both halve off-peak on the same schedule. AIHubMix serves 1017 through DeepSeek, ByteDance, and Alibaba Cloud channels. The ByteDance channel lists at $0.2816 / $1.1264, is 30% off October 19–25 (UTC) with the discount applied automatically to &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;, and adds a cache storage fee of $0.0024 per 1M tokens per hour. AIHubMix has no top-up fee; OpenRouter adds no markup to DeepSeek's price but charges 5.5% when you buy credits by card.&lt;/p&gt;

&lt;p&gt;Through October 25 that makes AIHubMix about 34% cheaper per token, or 38% once OpenRouter's card fee is counted. At list price, the DeepSeek channel is 3.3% higher per token but about 2% cheaper after the card fee, and the ByteDance channel is 6% lower per token. For the session above: $0.075 against $0.114 at peak ($0.121 with the fee), and $0.038 against $0.057 off-peak.&lt;/p&gt;

&lt;p&gt;OpenRouter won't route to DeepSeek's endpoint by default, though. Without provider preferences it picks among stable providers weighted by the inverse square of price, and several third-party hosts undercut every peak price above:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Host on OpenRouter&lt;/th&gt;
&lt;th&gt;Weights&lt;/th&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;Session&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Relace&lt;/td&gt;
&lt;td&gt;Not stated&lt;/td&gt;
&lt;td&gt;$0.05&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;td&gt;$0.023&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepInfra&lt;/td&gt;
&lt;td&gt;fp8&lt;/td&gt;
&lt;td&gt;$0.098&lt;/td&gt;
&lt;td&gt;$0.294&lt;/td&gt;
&lt;td&gt;$0.033&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wafer&lt;/td&gt;
&lt;td&gt;mxfp4&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;td&gt;$0.50&lt;/td&gt;
&lt;td&gt;$0.045&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Morph&lt;/td&gt;
&lt;td&gt;fp8&lt;/td&gt;
&lt;td&gt;$0.043&lt;/td&gt;
&lt;td&gt;$0.60&lt;/td&gt;
&lt;td&gt;$0.047&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;InferenceNet&lt;/td&gt;
&lt;td&gt;fp8&lt;/td&gt;
&lt;td&gt;$0.08&lt;/td&gt;
&lt;td&gt;$0.50&lt;/td&gt;
&lt;td&gt;$0.048&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Flat rates per 1M tokens around the clock, checked October 19, 2026. "Weights" is the quantization OpenRouter lists. Off-peak, the discounted ByteDance channel ($0.0986 / $0.3942, $0.038 per session) beats Wafer, Morph, and InferenceNet; Relace and DeepInfra stay cheaper.&lt;/p&gt;

&lt;p&gt;Check two things before routing production traffic there: output quality on quantized weights, since DeepSeek's benchmarks weren't run on these hosts, and the output cap, since DeepInfra and InferenceNet stop at 131K tokens on OpenRouter, below the 256K the model card recommends for long agent runs. To pin DeepSeek's endpoint instead, pass &lt;code&gt;"provider": {"only": ["deepseek"]}&lt;/code&gt; in the request body (&lt;code&gt;extra_body&lt;/code&gt; in the OpenAI SDK).&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes and fixes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A parser that worked on September output starts failing
&lt;/h3&gt;

&lt;p&gt;Shorter outputs can break parsers and evaluation checks written around the old verbosity. Before moving production prompts with strict output formats, run your regression suite against &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt; and diff the failures against your September baseline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Your "September" traffic on DeepSeek is already 1017
&lt;/h3&gt;

&lt;p&gt;On DeepSeek's own API, &lt;code&gt;deepseek-flash&lt;/code&gt; is a rolling alias, and &lt;code&gt;deepseek-v4-flash&lt;/code&gt; and &lt;code&gt;deepseek-v4-flash-vision-exp&lt;/code&gt; now run on 1017 too. There is no pinned name for September. If you need reproducible behaviour, call a dated model ID; on AIHubMix that's &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;, and log &lt;code&gt;resp.model&lt;/code&gt; so a change would show up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Answers come back short or cut off at a low max_tokens
&lt;/h3&gt;

&lt;p&gt;Thinking is on by default and its tokens count toward &lt;code&gt;max_tokens&lt;/code&gt;. A budget sized for a non-thinking model leaves little room for the answer. Keep it generous (the sample uses 32,000), go to 256K or more for long agent runs as the model card recommends, and watch &lt;code&gt;reasoning_tokens&lt;/code&gt; in the usage block.&lt;/p&gt;

&lt;h3&gt;
  
  
  The bill doesn't drop the way the chart suggests
&lt;/h3&gt;

&lt;p&gt;Two usual causes. Traffic that lands in the weekday peak window (01:00–04:00 and 06:00–10:00 UTC) pays twice the off-peak rate, so move batch jobs out of it. And &lt;code&gt;max&lt;/code&gt; effort lengthens agent runs by 1.6–1.8× by DeepSeek's own measure; if an agent framework sets it globally, drop it back to &lt;code&gt;high&lt;/code&gt; and raise it per task.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it is not the right model
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge-heavy questions.&lt;/strong&gt; HLE without tools is 42.6, well behind Claude Opus 5 (56.3) and below Claude Haiku 5.5 (45.9, Anthropic's figure).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long, hard shell sessions.&lt;/strong&gt; 42.3 on Terminal-Bench 4.0 is a big jump, but Sonnet 5.5 (70.6) and Opus 5.5 (66.4) are in a different league there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workloads that need a frozen model on DeepSeek's API&lt;/strong&gt;, for the alias reason above.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For context on the comparisons DeepSeek chose: inside its own lineup, 1017 has passed V4 Pro 0813 on every agentic benchmark DeepSeek publishes for both (Terminal-Bench 4.0: 42.3 vs 12.4; DeepSWE: 77.0 vs 62.7). Against Claude Opus 5 it leads on DeepSWE, Automation-Bench, Agents' Last Exam, and Apex, while Opus 5 leads on Terminal-Bench 4.0 (51.8), ProgramBench (37.0), NL2Repo (75.3), and HLE (56.3). Opus 5.5, Sonnet 5.5, and the GPT-6 generation are not in DeepSeek's table; Google separately reports Opus 5.5 at 66.4 on Terminal-Bench 4.0.&lt;/p&gt;

&lt;h2&gt;
  
  
  What hasn't been verified
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Every benchmark number above is DeepSeek's own. No third party has reproduced them.&lt;/li&gt;
&lt;li&gt;How much shorter the outputs are. DeepSeek hasn't published a figure, and the per-task costs are The Decoder's reading of a vendor chart, not a measurement.&lt;/li&gt;
&lt;li&gt;Per-task token counts for 1017. The session cost above is an estimate from assumptions.&lt;/li&gt;
&lt;li&gt;Effort cost through AIHubMix. The October 19 test used trivial prompts, and the reasoning token counts (68, 39, and 54 for low, high, and max) don't separate the levels. It confirms the parameter passes through, nothing more.&lt;/li&gt;
&lt;li&gt;Quality on OpenRouter's quantized hosts. No published test compares their output with DeepSeek's endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Decision rules
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Switch now:&lt;/strong&gt; coding agents, terminal automation, and tool-calling pipelines on the September Flash. Same price, better scores, and fewer tokens per task by DeepSeek's measure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Switch after a regression run:&lt;/strong&gt; production prompts with strict output formats, or anything gated by an evaluation suite.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stay put or look elsewhere:&lt;/strong&gt; knowledge-heavy Q&amp;amp;A and hard debugging that already needs a frontier model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="https://aihubmix.com/compare/deepseek-v4.1-flash/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;AIHubMix compare page&lt;/a&gt; shows the two Flash checkpoints' specs and prices side by side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the DeepSeek V4.1 Flash 1017 series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Switching an existing tool loop? The &lt;code&gt;reasoning_content&lt;/code&gt; 400, the alias swap, and peak-hour billing each have their own fix in the migration guide: &lt;a href="https://dev.to/aihubmix/migrating-to-deepseek-v41-flash-1017-the-reasoningcontent-400-the-silent-alias-swap-and-3hl"&gt;Migrating to DeepSeek V4.1 Flash 1017: The reasoning_content 400, the Silent Alias Swap, and Peak-Hour Billing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If Terminal-Bench is the number you care about, this runs 1017 and Anthropic's cheapest model on the same terminal coding task: &lt;a href="https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-claude-haiku-55-which-cheap-model-for-terminal-coding-agents-1jcp"&gt;DeepSeek V4.1 Flash 1017 vs Claude Haiku 5.5: Which Cheap Model for Terminal Coding Agents?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Running V4 Pro 0813 next to the Flash? This one checks whether Pro still earns its 3.3× output price: &lt;a href="https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-v4-pro-is-the-flash-enough-now-3chb"&gt;DeepSeek V4.1 Flash 1017 vs V4 Pro: Is the Flash Enough Now?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://api-docs.deepseek.com/news/news261017" rel="noopener noreferrer"&gt;DeepSeek-V4.1-Flash-1017 release note&lt;/a&gt; (DeepSeek)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash-1017" rel="noopener noreferrer"&gt;DeepSeek-V4.1-Flash-1017 model card&lt;/a&gt; (Hugging Face)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/model/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;DeepSeek V4.1 Flash 1017 on AIHubMix&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://the-decoder.com/deepseek-v4-1-flash-1017-beats-larger-rivals-in-agentic-tasks-while-once-again-massively-cutting-per-task-costs/" rel="noopener noreferrer"&gt;Deepseek V4.1 Flash 1017 beats larger rivals in agentic tasks&lt;/a&gt; (The Decoder)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://openrouter.ai/deepseek/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;DeepSeek V4.1 Flash 1017 on OpenRouter&lt;/a&gt; (OpenRouter)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>deepseek</category>
      <category>api</category>
    </item>
    <item>
      <title>Migrating to DeepSeek V4.1 Flash 1017: The reasoning_content 400, the Silent Alias Swap, and Peak-Hour Billing</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Mon, 19 Oct 2026 05:35:18 +0000</pubDate>
      <link>https://dev.to/aihubmix/migrating-to-deepseek-v41-flash-1017-the-reasoningcontent-400-the-silent-alias-swap-and-3hl</link>
      <guid>https://dev.to/aihubmix/migrating-to-deepseek-v41-flash-1017-the-reasoningcontent-400-the-silent-alias-swap-and-3hl</guid>
      <description>&lt;p&gt;If a DeepSeek tool loop fails with HTTP 400 on the request right after its first tool call, DeepSeek's docs point to one dropped field: &lt;code&gt;reasoning_content&lt;/code&gt;. That's the loud part of moving to DeepSeek V4.1 Flash 1017. The quiet part happened on October 17, 2026, when DeepSeek swapped the checkpoint behind &lt;code&gt;deepseek-flash&lt;/code&gt; without changing the name or the price. Many apps migrated that afternoon without anyone deciding to.&lt;/p&gt;

&lt;p&gt;This post is the engineering side of the move: reproduce and fix the 400, detect the swap from the response itself, see what peak hours and the effort setting do to the bill, and wire Claude Code, Codex, and DeepSeek Harness to the new checkpoint. On AIHubMix it has its own ID, &lt;a href="https://aihubmix.com/model/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;&lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;&lt;/a&gt;, so the switch happens when you change the model string, not when DeepSeek ships.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;With &lt;code&gt;tools&lt;/code&gt; in the request, DeepSeek requires the &lt;code&gt;reasoning_content&lt;/code&gt; of every earlier assistant turn. Drop it and DeepSeek's API returns 400. Append the whole assistant message to your history.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;deepseek-flash&lt;/code&gt;, &lt;code&gt;deepseek-v4-flash&lt;/code&gt;, and &lt;code&gt;deepseek-v4-flash-vision-exp&lt;/code&gt; on DeepSeek's API all run 1017 now, and there is no pinned name for the September checkpoint. Log the response's &lt;code&gt;model&lt;/code&gt; field and rerun your evals.&lt;/li&gt;
&lt;li&gt;Weekday peak hours (01:00–04:00 and 06:00–10:00 UTC) cost twice the off-peak rate. A sample agent session comes to $0.118 at peak and $0.059 off-peak.&lt;/li&gt;
&lt;li&gt;Keep effort at &lt;code&gt;high&lt;/code&gt;. DeepSeek's own paper says &lt;code&gt;max&lt;/code&gt; lengthens agent runs 1.6–1.8× for marginal gains.&lt;/li&gt;
&lt;li&gt;Through AIHubMix, Chat Completions, Anthropic Messages, and the Responses API all returned 200 in a one-run test on October 19.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An AIHubMix API key in &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Model ID &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;. OpenAI-format clients use the base URL &lt;code&gt;https://aihubmix.com/v1&lt;/code&gt;; Claude Code uses &lt;code&gt;https://aihubmix.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For the smoke test at the end: git, Python with pytest, and one of Claude Code, Codex, or DeepSeek Harness.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What AIHubMix tested
&lt;/h2&gt;

&lt;p&gt;AIHubMix sent a short set of requests to &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt; on October 19, 2026, at 03:02 UTC. Each check ran once, so read every row as "worked once", not as a guarantee.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Endpoint&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Effort low, high, max&lt;/td&gt;
&lt;td&gt;Chat Completions&lt;/td&gt;
&lt;td&gt;200 for all three&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool turn 2 without reasoning_content&lt;/td&gt;
&lt;td&gt;Chat Completions&lt;/td&gt;
&lt;td&gt;200, normal answer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two-turn tool call&lt;/td&gt;
&lt;td&gt;Anthropic Messages&lt;/td&gt;
&lt;td&gt;200 on both turns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No effort setting&lt;/td&gt;
&lt;td&gt;Anthropic Messages&lt;/td&gt;
&lt;td&gt;No thinking block&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;output_config.effort set to low&lt;/td&gt;
&lt;td&gt;Anthropic Messages&lt;/td&gt;
&lt;td&gt;Thinking block returned&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;reasoning.effort set to low&lt;/td&gt;
&lt;td&gt;Responses&lt;/td&gt;
&lt;td&gt;200, reasoning + message&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every response carried &lt;code&gt;"model": "deepseek-v4-1-flash-261017"&lt;/code&gt;, the 1017 checkpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure 1: HTTP 400 on the request after a tool call
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Symptom.&lt;/strong&gt; The request that sends the tool result back fails with this message, as reported in a GitHub issue against &lt;a href="https://github.com/lidge-jun/opencodex/issues/7118" rel="noopener noreferrer"&gt;opencodex&lt;/a&gt; for V4.1 Flash on October 15:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[invalid_request_error] The `reasoning_content` in the thinking mode must be passed back to the API.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same text shows up in earlier reports against opencode, LangChain, and claude-code-router for V4 Pro and V4 Flash.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cause.&lt;/strong&gt; DeepSeek's &lt;a href="https://api-docs.deepseek.com/guides/thinking_mode" rel="noopener noreferrer"&gt;thinking mode guide&lt;/a&gt; says that when a request includes &lt;code&gt;tools&lt;/code&gt;, the &lt;code&gt;reasoning_content&lt;/code&gt; of every earlier assistant turn must be sent back, "even for turns where the model did not perform a tool call". If it isn't, "the API will return a 400 error". Without tools, sending it back is optional and ignored. Clients trip on this because their message serialiser keeps &lt;code&gt;content&lt;/code&gt; and &lt;code&gt;tool_calls&lt;/code&gt; and drops the extra field.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reproduce.&lt;/strong&gt; Turn two of a tool loop, with the assistant message stripped of &lt;code&gt;reasoning_content&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://aihubmix.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 &lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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": "deepseek-v4.1-flash-1017",
    "tools": [{"type": "function", "function": {"name": "get_weather",
      "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}],
    "messages": [
      {"role": "user", "content": "What is the temperature in Hangzhou? Use the tool."},
      {"role": "assistant", "content": null, "tool_calls": [{"id": "call_00_example", "type": "function",
        "function": {"name": "get_weather", "arguments": "{\"city\": \"Hangzhou\"}"}}]},
      {"role": "tool", "tool_call_id": "call_00_example", "content": "{\"celsius\": 18}"}
    ]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On DeepSeek's own API, this is the shape that returns the 400 in the public reports. Through AIHubMix, the same shape returned HTTP 200 and a normal answer in the October 19 run. That was one request, and the response doesn't show which upstream channel served it, so treat it as an observation, not a contract.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix.&lt;/strong&gt; Keep the field, whichever route you use:&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="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;resp&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="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# carries content, reasoning_content, and tool_calls over
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In your own code, append the whole assistant message, not a hand-built copy of it.&lt;/li&gt;
&lt;li&gt;In frameworks, upgrade: opencode fixed the round trip in later releases, and opencodex merged its fix on October 16.&lt;/li&gt;
&lt;li&gt;As a last resort, set &lt;code&gt;{"thinking": {"type": "disabled"}}&lt;/code&gt; for tool loops. That avoids the error but gives up the reasoning that makes the model good at agent work.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Failure 2: no error, different model
&lt;/h2&gt;

&lt;p&gt;DeepSeek's &lt;a href="https://api-docs.deepseek.com/updates" rel="noopener noreferrer"&gt;changelog&lt;/a&gt; for October 17: "The API calling method and pricing remain unchanged — simply use &lt;code&gt;deepseek-flash&lt;/code&gt; to access the latest model." There is no pinned name for the September checkpoint, and the two older Flash names run on 1017 too.&lt;/p&gt;

&lt;p&gt;Nothing throws, but three things can shift under your tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Output length.&lt;/strong&gt; 1017 was trained to produce shorter outputs. Parsers, UI layouts, and prompts that expected the September model's long explanations may get less text. DeepSeek hasn't put a number on how much shorter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluation baselines.&lt;/strong&gt; Scores and costs recorded on the September checkpoint no longer describe what &lt;code&gt;deepseek-flash&lt;/code&gt; returns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Behaviour.&lt;/strong&gt; DeepSeek retrained 1017 for end-to-end project work, so agents may take different paths to the same result.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Detect it.&lt;/strong&gt; The response tells you which checkpoint answered. Through AIHubMix, every response in the test carried &lt;code&gt;"model": "deepseek-v4-1-flash-261017"&lt;/code&gt;. Store that field and the date with every evaluation run, rerun your regression set now, and an unannounced swap shows up the day it happens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure 3: the bill doubles at weekday peak
&lt;/h2&gt;

&lt;p&gt;DeepSeek charges full price 01:00–04:00 and 06:00–10:00 UTC on weekdays, and half price at every other hour, all weekend, and on Chinese public holidays. AIHubMix uses the same windows and prices each request at the time it was submitted, so a long streaming request that starts off-peak stays off-peak.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Peak&lt;/th&gt;
&lt;th&gt;Off-peak&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Input, cache miss&lt;/td&gt;
&lt;td&gt;$0.3098&lt;/td&gt;
&lt;td&gt;$0.155&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input, cache hit&lt;/td&gt;
&lt;td&gt;$0.0062&lt;/td&gt;
&lt;td&gt;$0.0031&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output&lt;/td&gt;
&lt;td&gt;$1.2392&lt;/td&gt;
&lt;td&gt;$0.62&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;AIHubMix list prices per 1M tokens for deepseek-v4.1-flash-1017. A limited-time 30% discount is running on top.&lt;/p&gt;

&lt;p&gt;A worked example, under stated assumptions: one agent session of 40 calls, 1.2M input tokens with 90% cache hits, and 60K output tokens.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Peak: 0.12M × $0.3098 + 1.08M × $0.0062 + 0.06M × $1.2392 = $0.118&lt;/li&gt;
&lt;li&gt;Off-peak: the same tokens at half the rate = $0.059&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Three levers move that number:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Schedule.&lt;/strong&gt; Moving batch runs off-peak is the single biggest saving.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache.&lt;/strong&gt; Hits are 50 times cheaper than misses. Agents resend the same system prompt, tool definitions, and history on every call; keep that prefix stable and put anything that changes per call at the end.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thinking.&lt;/strong&gt; It's on by default, and reasoning tokens count toward both the bill and &lt;code&gt;max_tokens&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One date to put in the calendar: DeepSeek opened its new Search and Fetch APIs on October 17 at $0.75 per 1,000 successful calls each. Server-side calls made through DeepSeek Harness, Claude Code, or Codex on DeepSeek's API are free until October 31, 2026, 16:00 UTC. After that, an agent that searches on every turn adds a per-call cost on top of tokens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure 4: settings that cost more than they return
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Effort.&lt;/strong&gt; The API offers &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt; (default), and &lt;code&gt;max&lt;/code&gt;. DeepSeek's V4.1 Flash paper maps them to internal effort values of 50, 75, and 100, and reports that the step to max "lengthens agent trajectories by 1.6–1.8× for only marginal improvements". DeepSeek's own Claude Code setup guide still sets &lt;code&gt;CLAUDE_CODE_EFFORT_LEVEL=max&lt;/code&gt;. For everyday agent work, &lt;code&gt;high&lt;/code&gt; is the better default.&lt;/p&gt;

&lt;p&gt;Other effort names get folded in: &lt;code&gt;minimal&lt;/code&gt; becomes &lt;code&gt;low&lt;/code&gt;, while &lt;code&gt;medium&lt;/code&gt; and &lt;code&gt;xhigh&lt;/code&gt; both become &lt;code&gt;high&lt;/code&gt;. A tool that offers five levels effectively gives you two or three. In the October 19 test, AIHubMix accepted &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;, and &lt;code&gt;max&lt;/code&gt; on Chat Completions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;max_tokens.&lt;/strong&gt; The model card recommends at least 256K for long agent runs, because thinking shares the output budget. With a small cap, a hard step can spend the whole budget thinking. Alert on &lt;code&gt;finish_reason: "length"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sampling.&lt;/strong&gt; In thinking mode, &lt;code&gt;temperature&lt;/code&gt;, &lt;code&gt;presence_penalty&lt;/code&gt;, and &lt;code&gt;frequency_penalty&lt;/code&gt; are accepted without error and have no effect. &lt;code&gt;top_p&lt;/code&gt; is clamped to 0.95–1.0. A pipeline that relied on low temperature for deterministic output no longer gets it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you give it shell access
&lt;/h2&gt;

&lt;p&gt;1017 was trained with reinforcement learning on whole projects, so it tends to keep building until the job looks done. Its answers are also shorter, which means less narration of what it changed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Review diffs and command logs, not the model's summary of them.&lt;/li&gt;
&lt;li&gt;Run it in a sandbox with an allowlist of commands, and require approval for anything destructive: deletes, force pushes, migrations, outbound network calls.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DeepSeek itself flags the Flash line's strength on security tasks; the September checkpoint scored 88.1 on CyberGym in DeepSeek's own table. That's useful for defensive work, and another reason to scope its permissions tightly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wiring the coding tools
&lt;/h2&gt;

&lt;p&gt;AIHubMix serves &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt; on all three protocols these tools need: Claude Code speaks Anthropic Messages, Codex the Responses API, DeepSeek Harness Chat Completions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude Code.&lt;/strong&gt; Point it at AIHubMix as in the &lt;a href="https://docs.aihubmix.com/en/api/Claude-Code" rel="noopener noreferrer"&gt;Claude Code guide&lt;/a&gt; and set the model:&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://aihubmix.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;"&lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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;"deepseek-v4.1-flash-1017"&lt;/span&gt;
&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;&lt;span class="s2"&gt;"deepseek-v4.1-flash-1017"&lt;/span&gt;
&lt;span class="nb"&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;"deepseek-v4.1-flash-1017"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CLAUDE_CODE_EFFORT_LEVEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"high"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep an effort level set.&lt;/strong&gt; In the test, a Messages request with no effort setting came back without a thinking block, while one with &lt;code&gt;output_config.effort&lt;/code&gt; returned thinking. Check the request logs to confirm 1017 is reasoning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;code&gt;[1m]&lt;/code&gt; suffix.&lt;/strong&gt; DeepSeek's guide adds it to the model name for its own endpoint; it wasn't tested through AIHubMix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Known issue.&lt;/strong&gt; Through some routers, Claude Code has dropped thinking content and hit the 400 above (claude-code-router issue 1378). The two-turn tool test through AIHubMix's Messages endpoint didn't hit it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Codex.&lt;/strong&gt; Follow the &lt;a href="https://docs.aihubmix.com/en/api/Codex-CLI" rel="noopener noreferrer"&gt;Codex CLI guide&lt;/a&gt;: an &lt;code&gt;aihubmix&lt;/code&gt; provider with &lt;code&gt;base_url = "https://aihubmix.com/v1"&lt;/code&gt; and &lt;code&gt;wire_api = "responses"&lt;/code&gt;, and &lt;code&gt;model = "deepseek-v4.1-flash-1017"&lt;/code&gt;. To pick it from &lt;code&gt;/model&lt;/code&gt;, add it to a &lt;code&gt;model_catalog_json&lt;/code&gt; file with &lt;code&gt;context_window&lt;/code&gt; set to 1,000,000.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The guide's catalog script offers &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, and &lt;code&gt;high&lt;/code&gt;. Under DeepSeek's mapping, &lt;code&gt;medium&lt;/code&gt; and &lt;code&gt;high&lt;/code&gt; both land on DeepSeek's &lt;code&gt;high&lt;/code&gt;, so you get two real levels.&lt;/li&gt;
&lt;li&gt;Newer Codex versions discard the whole catalog if a single required field is missing. The guide's script avoids that.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;DeepSeek Harness.&lt;/strong&gt; DeepSeek says 1017 works best with Harness 0.2.1-rc.1 or later. Add AIHubMix as an OpenAI-compatible provider following the &lt;a href="https://docs.aihubmix.com/en/api/DeepSeek-Harness" rel="noopener noreferrer"&gt;DeepSeek Harness guide&lt;/a&gt;, then add &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt; as a model. The guide was written against an earlier Harness release, so check field names if the UI has changed.&lt;/p&gt;

&lt;h3&gt;
  
  
  A 15-minute smoke test
&lt;/h3&gt;

&lt;p&gt;Create a tiny repo with one failing 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;mkdir &lt;/span&gt;flash-smoke &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;flash-smoke &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git init &lt;span class="nt"&gt;-q&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'def mean(xs):\n    return sum(xs) / len(xs)\n'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; stats.py
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'from stats import mean\n\ndef test_mean():\n    assert mean([1, 2, 3]) == 2\n\ndef test_empty():\n    assert mean([]) == 0\n'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; test_stats.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start your tool in that folder and ask: "Run pytest, fix the failing test by changing stats.py only, then run pytest again." It passes if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the agent makes at least two tool calls (run the tests, edit the file) with no 400;&lt;/li&gt;
&lt;li&gt;both tests pass at the end;&lt;/li&gt;
&lt;li&gt;the AIHubMix request log shows &lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;, and the session cost is a few cents at most.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What this doesn't tell you
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The 200 on the stripped tool turn.&lt;/strong&gt; One request, upstream channel not visible. DeepSeek's rule still stands; send the field.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Effort cost.&lt;/strong&gt; The effort check used a trivial prompt, and its reasoning token counts (68, 39, and 54 for low, high, and max) don't separate the levels. The cost argument for &lt;code&gt;high&lt;/code&gt; rests on DeepSeek's paper, not on this test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context suffix.&lt;/strong&gt; The &lt;code&gt;[1m]&lt;/code&gt; model-name suffix from DeepSeek's Claude Code guide is untested through AIHubMix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Harness UI.&lt;/strong&gt; The AIHubMix Harness guide predates 0.2.1-rc.1.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Shorter outputs".&lt;/strong&gt; DeepSeek doesn't quantify it. Compare &lt;code&gt;completion_tokens&lt;/code&gt; on your own prompts with what you logged on the September checkpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the DeepSeek V4.1 Flash 1017 series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Want the benchmark and cost case before touching your integration? The upgrade post compares 1017 with the September checkpoint: &lt;a href="https://dev.to/aihubmix/deepseek-v41-flash-1017-same-price-shorter-outputs-should-you-switch-1nj5"&gt;DeepSeek V4.1 Flash 1017: Same Price, Shorter Outputs, and AIHubMix vs OpenRouter Pricing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Wiring Claude Code anyway? See how 1017 compares with the model Claude Code uses for its own subagents: &lt;a href="https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-claude-haiku-55-which-cheap-model-for-terminal-coding-agents-1jcp"&gt;DeepSeek V4.1 Flash 1017 vs Claude Haiku 5.5: Which Cheap Model for Terminal Coding Agents?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Migrating from V4 Pro rather than the old Flash? This one checks whether you still need Pro at all: &lt;a href="https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-v4-pro-is-the-flash-enough-now-3chb"&gt;DeepSeek V4.1 Flash 1017 vs V4 Pro: Is the Flash Enough Now?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://api-docs.deepseek.com/guides/thinking_mode" rel="noopener noreferrer"&gt;Thinking Mode&lt;/a&gt; (DeepSeek)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://api-docs.deepseek.com/updates" rel="noopener noreferrer"&gt;Change Log&lt;/a&gt; (DeepSeek)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://api-docs.deepseek.com/guides/coding_agents" rel="noopener noreferrer"&gt;Integrate with AI Tools&lt;/a&gt; (DeepSeek)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/model/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;DeepSeek V4.1 Flash 1017 on AIHubMix&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/lidge-jun/opencodex/issues/7118" rel="noopener noreferrer"&gt;DeepSeek V4.1 Flash returns reasoning_content 400 after tool calls, issue 7118&lt;/a&gt; (GitHub)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>deepseek</category>
      <category>api</category>
    </item>
    <item>
      <title>DeepSeek V4.1 Flash 1017 vs Claude Haiku 5.5: Which Cheap Model for Terminal Coding Agents?</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Mon, 19 Oct 2026 05:35:05 +0000</pubDate>
      <link>https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-claude-haiku-55-which-cheap-model-for-terminal-coding-agents-1jcp</link>
      <guid>https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-claude-haiku-55-which-cheap-model-for-terminal-coding-agents-1jcp</guid>
      <description>&lt;p&gt;Take one Claude Code session: 40 model calls, a prompt that grows from 20K to 176K tokens. At AIHubMix list prices, DeepSeek V4.1 Flash 1017 runs it for $0.152 at peak hours ($0.076 off-peak) and Claude Haiku 5.5 for $0.288. Stop the same session after 21 calls, before the prompt crosses 100K tokens, and the order flips: Haiku 5.5 costs $0.040, 1017 costs $0.077 at peak and $0.039 off-peak. On capability, the one benchmark both vendors report for this kind of work, Terminal-Bench 4.0, has them roughly level: 42.3 for 1017 and 39.2 for Haiku 5.5, both vendor-reported.&lt;/p&gt;

&lt;p&gt;That is the engineering problem. You have a cheap slot in your agent setup, either the main loop for long runs or a subagent for short calls, and two candidates released ten days apart: Haiku 5.5 on October 7 and 1017 on October 17, 2026. Their cost curves cross at Haiku's 100K-token price tier. Their benchmark numbers come from different harnesses and settings. Each one returns 400s if you migrate carelessly. This post gives the published numbers, a script to redo the cost math with your own token counts, a one-key setup for running both in Claude Code, and the failure modes on each side.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An AIHubMix API key exported as &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt;. Both models are on AIHubMix: &lt;a href="https://aihubmix.com/model/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;&lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://aihubmix.com/model/claude-haiku-5-5" rel="noopener noreferrer"&gt;&lt;code&gt;claude-haiku-5-5&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Claude Code installed.&lt;/li&gt;
&lt;li&gt;One failing test or small task from your own repo, to run through both models.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Run both models in Claude Code with one key
&lt;/h2&gt;

&lt;p&gt;Point Claude Code at AIHubMix, as in the &lt;a href="https://docs.aihubmix.com/en/api/Claude-Code" rel="noopener noreferrer"&gt;AIHubMix Claude Code guide&lt;/a&gt;:&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://aihubmix.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;"&lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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;"deepseek-v4.1-flash-1017"&lt;/span&gt;
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things to do once it's running:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep an effort level set&lt;/strong&gt;, for example &lt;code&gt;CLAUDE_CODE_EFFORT_LEVEL=high&lt;/code&gt;. In AIHubMix's October 19 test over the Anthropic Messages protocol (the one Claude Code uses), 1017 completed a two-turn tool call, but the request with no effort setting came back with text and a tool call and no thinking block. A request with an effort level returned one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Switch models inside the session&lt;/strong&gt; with &lt;code&gt;/model claude-haiku-5-5&lt;/code&gt;. Same key, same repo state. Run the same failing test through both, then compare the diffs and the request logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For specs and prices side by side, the &lt;a href="https://aihubmix.com/compare/deepseek-v4.1-flash-1017/claude-haiku-5-5" rel="noopener noreferrer"&gt;AIHubMix compare page&lt;/a&gt; lists both models.&lt;/p&gt;

&lt;h2&gt;
  
  
  The benchmark picture
&lt;/h2&gt;

&lt;p&gt;Terminal-Bench 4.0 scores long shell sessions with real tools on whether the agent finishes the job, which is the closest public match to a Claude Code session. DeepSeek's figures come from its &lt;a href="https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash-1017" rel="noopener noreferrer"&gt;model card&lt;/a&gt; and Anthropic's from the &lt;a href="https://www.anthropic.com/news/claude-haiku-5-5" rel="noopener noreferrer"&gt;Haiku 5.5 announcement&lt;/a&gt;. Nobody has run both models under the same harness and settings yet.&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;Terminal-Bench 4.0&lt;/th&gt;
&lt;th&gt;Reported by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Sonnet 5.5&lt;/td&gt;
&lt;td&gt;70.6&lt;/td&gt;
&lt;td&gt;Anthropic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepSeek V4.1 Flash 1017&lt;/td&gt;
&lt;td&gt;42.3&lt;/td&gt;
&lt;td&gt;DeepSeek&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Haiku 5.5&lt;/td&gt;
&lt;td&gt;39.2&lt;/td&gt;
&lt;td&gt;Anthropic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepSeek V4.1 Flash (Sept)&lt;/td&gt;
&lt;td&gt;31.2&lt;/td&gt;
&lt;td&gt;DeepSeek&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;DeepSeek ran Terminal-Bench 4.0 in the Claude Code harness. Anthropic does not state Haiku's effort level in the headline table.&lt;/p&gt;

&lt;p&gt;Three points between two vendor numbers with different settings is not a decisive win; read it as "roughly level, 1017 slightly ahead". The independent Haiku 5.5 runs published so far come in below Anthropic's figure and disagree with each other, and AIHubMix has not found an independent Terminal-Bench 4.0 result for 1017 yet. Anthropic's own guidance puts both cheap models below the top tier for this work: "Sonnet 5.5 and Opus 5.5 remain better choices for complex agentic coding tasks like those measured by Terminal-Bench 4.0."&lt;/p&gt;

&lt;p&gt;Beyond Terminal-Bench, the vendors publish almost no shared numbers. DeepSeek reports DeepSWE v1.1 (77.0) and ProgramBench (29.1); Anthropic reports FrontierCode 1.1 (46.4) and OSWorld 2.1 (72.4). None of those has a published score for the other model. What the spec sheets do let you compare:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Area&lt;/th&gt;
&lt;th&gt;V4.1 Flash 1017&lt;/th&gt;
&lt;th&gt;Claude Haiku 5.5&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Terminal-Bench 4.0&lt;/td&gt;
&lt;td&gt;42.3&lt;/td&gt;
&lt;td&gt;39.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HLE, no tools&lt;/td&gt;
&lt;td&gt;42.6&lt;/td&gt;
&lt;td&gt;45.9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context window&lt;/td&gt;
&lt;td&gt;1M&lt;/td&gt;
&lt;td&gt;1M&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Max output&lt;/td&gt;
&lt;td&gt;384K&lt;/td&gt;
&lt;td&gt;128K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input types&lt;/td&gt;
&lt;td&gt;Text, images&lt;/td&gt;
&lt;td&gt;Text, images, PDF&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Price above 100K prompt&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;td&gt;5x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Effort levels&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open weights&lt;/td&gt;
&lt;td&gt;Yes, MIT&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Vendor-reported benchmark figures. DeepSeek's effort levels are low, high, and max; Haiku's are low, medium (default), high, xhigh, and max.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cost model
&lt;/h2&gt;

&lt;p&gt;No published test gives per-task token counts for either model, so the numbers above come from stated assumptions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;40 model calls. The prompt starts at 20K tokens and grows by 4K per call (tool output plus the previous answer), ending at 176K.&lt;/li&gt;
&lt;li&gt;Each call reads the earlier prompt from cache and adds 4K new tokens.&lt;/li&gt;
&lt;li&gt;Each call produces 1.5K output tokens, thinking included.&lt;/li&gt;
&lt;li&gt;Both models get the same token counts, although their tokenizers differ.&lt;/li&gt;
&lt;li&gt;AIHubMix list prices. &lt;strong&gt;1017:&lt;/strong&gt; new tokens at the cache-miss rate, the cached prefix at the cache-hit rate, peak or off-peak. &lt;strong&gt;Haiku 5.5:&lt;/strong&gt; new tokens written to the 5-minute cache, the prefix read from it, and any call whose prompt exceeds 100K billed entirely at the higher tier ($0.50 input, $2.50 output, $0.05 cache read, $0.625 cache write per 1M tokens).&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Session&lt;/th&gt;
&lt;th&gt;1017 peak&lt;/th&gt;
&lt;th&gt;1017 off-peak&lt;/th&gt;
&lt;th&gt;Haiku 5.5&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First 21 calls, prompt up to 100K&lt;/td&gt;
&lt;td&gt;$0.077&lt;/td&gt;
&lt;td&gt;$0.039&lt;/td&gt;
&lt;td&gt;$0.040&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full 40 calls, prompt up to 176K&lt;/td&gt;
&lt;td&gt;$0.152&lt;/td&gt;
&lt;td&gt;$0.076&lt;/td&gt;
&lt;td&gt;$0.288&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On Haiku 5.5, the 19 calls above 100K cost $0.248 of the $0.288. For 1017 at peak, the full session is 176K new × $0.3098 + 3.744M cached × $0.0062 + 60K output × $1.2392 = $0.152 (prices per 1M tokens).&lt;/p&gt;

&lt;p&gt;The script below reproduces the table. Replace the call count, prompt growth, and output size with numbers from your own request logs; your real token counts will differ between the two models because the tokenizers do.&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="c1"&gt;# Cost of one Claude Code session at AIHubMix list prices (USD per 1M tokens).
# Assumptions: 40 calls; the prompt starts at 20K tokens and grows 4K per call;
# each call reads the earlier prompt from cache, adds 4K new tokens, and writes 1.5K output.
&lt;/span&gt;&lt;span class="n"&gt;M&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1_000_000&lt;/span&gt;
&lt;span class="n"&gt;FLASH&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;peak&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="mf"&gt;0.3098&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0062&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.2392&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;off-peak&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="mf"&gt;0.155&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0031&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.62&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;  &lt;span class="c1"&gt;# miss, hit, out
&lt;/span&gt;&lt;span class="n"&gt;HAIKU&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;short&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="mf"&gt;0.125&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;long&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="mf"&gt;0.625&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.50&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;  &lt;span class="c1"&gt;# 5-min write, read, out
&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20_000&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;4_000&lt;/span&gt;
        &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1_500&lt;/span&gt;  &lt;span class="c1"&gt;# prompt, cached, new, output
&lt;/span&gt;        &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;4_000&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;flash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;miss&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FLASH&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;miss&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;cached&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;calls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;haiku&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;calls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;HAIKU&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;long&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;100_000&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;short&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# whole request
&lt;/span&gt;        &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;write&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;cached&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;read&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;M&lt;/span&gt;


&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&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="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; calls: 1017 peak $&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;flash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;peak&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
          &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;off-peak $&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;flash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;off-peak&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, Haiku 5.5 $&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;haiku&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;21 calls: 1017 peak $0.077, off-peak $0.039, Haiku 5.5 $0.040
40 calls: 1017 peak $0.152, off-peak $0.076, Haiku 5.5 $0.288
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two levers move these numbers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;On Haiku 5.5,&lt;/strong&gt; keep each request under 100K. Claude Code's &lt;code&gt;/compact&lt;/code&gt; and short-lived subagents do that. The same 40 calls billed entirely at the short-prompt rate would cost $0.089.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On 1017,&lt;/strong&gt; schedule batch and overnight agent runs outside 01:00–04:00 and 06:00–10:00 UTC on weekdays, which halves the bill. AIHubMix is also running a limited-time 30% discount on 1017, not included above.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Failure modes and fixes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Haiku 5.5 returns 400 on parameters that worked before
&lt;/h3&gt;

&lt;p&gt;The API rejects &lt;code&gt;temperature&lt;/code&gt; values other than 1, any &lt;code&gt;top_k&lt;/code&gt;, manual &lt;code&gt;budget_tokens&lt;/code&gt; thinking, and assistant prefill, all with a 400. Strip them from the request and control depth with the effort level instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Haiku 5.5 bill jumps once sessions get long
&lt;/h3&gt;

&lt;p&gt;Past 100K prompt tokens, input, output, and cache prices for the whole request rise to five times the short-prompt rate. In the example above, the 19 calls over the line cost $0.248 of the session's $0.288. Compact or hand work to short-lived subagents before the prompt reaches 100K, or put long-running loops on 1017.&lt;/p&gt;

&lt;h3&gt;
  
  
  1017 fails after the first tool call on DeepSeek's own API
&lt;/h3&gt;

&lt;p&gt;DeepSeek's &lt;a href="https://api-docs.deepseek.com/guides/thinking_mode" rel="noopener noreferrer"&gt;thinking mode guide&lt;/a&gt; requires every earlier assistant turn's &lt;code&gt;reasoning_content&lt;/code&gt; to go back to the API when tools are in use; otherwise the request fails with a 400. Public GitHub reports quote the error as &lt;code&gt;[invalid_request_error] The `reasoning_content` in the thinking mode must be passed back to the API.&lt;/code&gt; A client that drops the field breaks right after its first tool call. Keep the whole assistant message, &lt;code&gt;reasoning_content&lt;/code&gt; included, when you append it to the history. In AIHubMix's October 19 test, the same turn sent without &lt;code&gt;reasoning_content&lt;/code&gt; returned 200. The migration post in this series covers this error and the peak-hour billing rules in detail.&lt;/p&gt;

&lt;h3&gt;
  
  
  1017 answers without thinking
&lt;/h3&gt;

&lt;p&gt;Over the Messages protocol, a request with no effort setting returned no thinking block in AIHubMix's test. Set &lt;code&gt;CLAUDE_CODE_EFFORT_LEVEL&lt;/code&gt; (or the effort field in your own requests) so 1017 reasons before acting.&lt;/p&gt;

&lt;h3&gt;
  
  
  Haiku 5.5 refuses security work
&lt;/h3&gt;

&lt;p&gt;ComputingForGeeks' review notes that Haiku 5.5 over-refused more than any other model in an automated behavioural audit, and that stricter cyber classifiers block some security work. If your agent does security tooling, test those steps first and keep another model available for them. The same review reports the upside: in Gray Swan coding scenarios, prompt-injection success fell from 58.4% on Haiku 4.5 to 0.08%.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this comparison can't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Benchmarks:&lt;/strong&gt; every score here is vendor-reported, under different harnesses and settings. A same-harness run of both models doesn't exist yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token counts:&lt;/strong&gt; the session is a model, not a measurement. Neither vendor publishes per-task token counts, and the two tokenizers count the same text differently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The AIHubMix test:&lt;/strong&gt; one run per check on October 19, 2026. The channel that served each request isn't visible, so the 200 on the missing-&lt;code&gt;reasoning_content&lt;/code&gt; turn shows what happened in that run, not a guarantee for every route.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which one goes where
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1017:&lt;/strong&gt; main-loop coding agents with long contexts, overnight or batch runs you can schedule off-peak, and tasks that build a program from a spec.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Haiku 5.5:&lt;/strong&gt; short, scoped subagent calls under 100K tokens, document-heavy steps, computer use, and pipelines that read untrusted web or repo content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Both:&lt;/strong&gt; in one Claude Code setup, a stronger model plans, 1017 does long execution, and Haiku 5.5 handles quick lookups and summaries. Neither replaces Sonnet 5.5 or Opus 5.5 for the hardest shell sessions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the DeepSeek V4.1 Flash 1017 series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Before 1017 takes the main-loop slot, see what the October checkpoint changed and how much shorter its outputs made each task: &lt;a href="https://dev.to/aihubmix/deepseek-v41-flash-1017-same-price-shorter-outputs-should-you-switch-1nj5"&gt;DeepSeek V4.1 Flash 1017: Same Price, Shorter Outputs, and AIHubMix vs OpenRouter Pricing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;reasoning_content&lt;/code&gt; failure mode above gets the full treatment there, with fixes for your own code and for agent frameworks, plus the peak-hour billing rules: &lt;a href="https://dev.to/aihubmix/migrating-to-deepseek-v41-flash-1017-the-reasoningcontent-400-the-silent-alias-swap-and-3hl"&gt;Migrating to DeepSeek V4.1 Flash 1017: The reasoning_content 400, the Silent Alias Swap, and Peak-Hour Billing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If 1017 wins your side-by-side run, the same test can tell you whether DeepSeek's pricier tier still earns its place: &lt;a href="https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-v4-pro-is-the-flash-enough-now-3chb"&gt;DeepSeek V4.1 Flash 1017 vs V4 Pro: Is the Flash Enough Now?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash-1017" rel="noopener noreferrer"&gt;DeepSeek-V4.1-Flash-1017 model card&lt;/a&gt; (Hugging Face)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.anthropic.com/news/claude-haiku-5-5" rel="noopener noreferrer"&gt;Introducing Claude Haiku 5.5&lt;/a&gt; (Anthropic)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/compare/deepseek-v4.1-flash-1017/claude-haiku-5-5" rel="noopener noreferrer"&gt;DeepSeek V4.1 Flash 1017 vs Claude Haiku 5.5&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://computingforgeeks.com/claude-haiku-5-5-released-features-benchmarks/" rel="noopener noreferrer"&gt;Claude Haiku 5.5: Pricing, Benchmarks, Tested&lt;/a&gt; (ComputingForGeeks)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://kingy.ai/blog/deepseek-v4-1-flash-1017-specs-benchmarks-pricing/" rel="noopener noreferrer"&gt;DeepSeek V4.1 Flash 1017 Tested: Specs, Benchmarks &amp;amp; Price&lt;/a&gt; (Kingy.ai)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>deepseek</category>
      <category>api</category>
    </item>
    <item>
      <title>DeepSeek V4.1 Flash 1017 vs V4 Pro: Is the Flash Enough Now?</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Mon, 19 Oct 2026 05:34:49 +0000</pubDate>
      <link>https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-v4-pro-is-the-flash-enough-now-3chb</link>
      <guid>https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-v4-pro-is-the-flash-enough-now-3chb</guid>
      <description>&lt;p&gt;DeepSeek's cheaper model now beats its pricier one. On every coding and agent benchmark DeepSeek publishes for both, V4.1 Flash 1017 (October 17) scores higher than V4 Pro 0813: 42.3 against 12.4 on Terminal-Bench 4.0, 77.0 against 62.7 on DeepSWE v1.1. Pro still costs 3.3 times as much per output token, and on a costed agent session it comes out at about four times the Flash's bill.&lt;/p&gt;

&lt;p&gt;On paper that settles it. In practice, if you run a pipeline that was tuned on &lt;code&gt;deepseek-v4-pro-0813&lt;/code&gt;, those are DeepSeek's numbers, not yours. The engineering problem is verifying the switch on your own workload: pass rate, output length, and cost per run, measured the same way on both models. This post collects the published numbers, gives a short script that calls both models with one key, and lists what skews the comparison.&lt;/p&gt;

&lt;h2&gt;
  
  
  The published numbers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Price
&lt;/h3&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;Input, peak&lt;/th&gt;
&lt;th&gt;Output, peak&lt;/th&gt;
&lt;th&gt;Cache hit, peak&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;V4.1 Flash 1017&lt;/td&gt;
&lt;td&gt;$0.30&lt;/td&gt;
&lt;td&gt;$1.20&lt;/td&gt;
&lt;td&gt;$0.006&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V4 Pro 0813&lt;/td&gt;
&lt;td&gt;$1.32&lt;/td&gt;
&lt;td&gt;$3.96&lt;/td&gt;
&lt;td&gt;$0.044&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;USD per 1M tokens, from the &lt;a href="https://api-docs.deepseek.com/quick_start/pricing" rel="noopener noreferrer"&gt;DeepSeek pricing page&lt;/a&gt;. Off-peak is half price for both models. AIHubMix lists Flash 1017 at $0.3098 / $1.2392 and Pro 0813 at $1.3944 / $4.1832 (input / output, peak).&lt;/p&gt;

&lt;p&gt;The ratios: Pro is 4.4× on input, 3.3× on output, and over 7× on cache hits. On DeepSeek's own API, Pro's concurrency limit is also a fifth of the Flash's: 500 against 2,500.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benchmarks
&lt;/h3&gt;

&lt;p&gt;Pro figures come from Table 3 of DeepSeek's &lt;a href="https://arxiv.org/abs/2609.19969" rel="noopener noreferrer"&gt;V4.1 Flash paper&lt;/a&gt;, all at max effort; 1017 figures come from the &lt;a href="https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash-1017" rel="noopener noreferrer"&gt;model card&lt;/a&gt;. All of them are DeepSeek's measurements, and nobody has reproduced them.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Benchmark&lt;/th&gt;
&lt;th&gt;V4 Pro&lt;/th&gt;
&lt;th&gt;Flash (Sept)&lt;/th&gt;
&lt;th&gt;Flash 1017&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Terminal-Bench 4.0&lt;/td&gt;
&lt;td&gt;12.4&lt;/td&gt;
&lt;td&gt;31.2&lt;/td&gt;
&lt;td&gt;42.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepSWE v1.1&lt;/td&gt;
&lt;td&gt;62.7&lt;/td&gt;
&lt;td&gt;74.2&lt;/td&gt;
&lt;td&gt;77.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ProgramBench&lt;/td&gt;
&lt;td&gt;15.5&lt;/td&gt;
&lt;td&gt;20.3&lt;/td&gt;
&lt;td&gt;29.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NL2Repo-Bench&lt;/td&gt;
&lt;td&gt;61.5&lt;/td&gt;
&lt;td&gt;65.4&lt;/td&gt;
&lt;td&gt;68.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automation-Bench&lt;/td&gt;
&lt;td&gt;43.2&lt;/td&gt;
&lt;td&gt;54.8&lt;/td&gt;
&lt;td&gt;60.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agents' Last Exam&lt;/td&gt;
&lt;td&gt;25.7&lt;/td&gt;
&lt;td&gt;31.8&lt;/td&gt;
&lt;td&gt;35.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HLE, text-only subset&lt;/td&gt;
&lt;td&gt;42.7&lt;/td&gt;
&lt;td&gt;39.1&lt;/td&gt;
&lt;td&gt;44.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPQA Diamond&lt;/td&gt;
&lt;td&gt;92.4&lt;/td&gt;
&lt;td&gt;90.9&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A dash means DeepSeek has not published that score for 1017.&lt;/p&gt;

&lt;p&gt;The September Flash had already passed Pro on every coding and agent row; 1017 widened the gap. On the text-only HLE subset, 1017 (44.0) is now ahead of Pro (42.7) too. Pro's one possible remaining lead is GPQA Diamond. Artificial Analysis reached the same verdict independently on its general index in September, calling V4.1 Flash DeepSeek's "new flagship" ahead of V4 Pro 0813.&lt;/p&gt;

&lt;h3&gt;
  
  
  One session, costed
&lt;/h3&gt;

&lt;p&gt;No published test gives per-task token counts for either model, so this is an estimate from stated assumptions: an agent bug-fix session with 40 model calls, 1.2M input tokens in total (90% cache hits), and 60K output tokens including thinking. Same token counts on both models, AIHubMix list prices:&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;Peak&lt;/th&gt;
&lt;th&gt;Off-peak&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;V4.1 Flash 1017&lt;/td&gt;
&lt;td&gt;$0.118&lt;/td&gt;
&lt;td&gt;$0.059&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V4 Pro 0813&lt;/td&gt;
&lt;td&gt;$0.469&lt;/td&gt;
&lt;td&gt;$0.233&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pro, peak:   0.12M × $1.3944 + 1.08M × $0.0465 + 0.06M × $4.1832 = $0.469
Flash, peak: 0.12M × $0.3098 + 1.08M × $0.0062 + 0.06M × $1.2392 = $0.118
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pro costs about four times as much per session. To break even, Pro would have to finish the same job with roughly a quarter of the Flash's tokens. The only published verbosity measurement says otherwise: &lt;a href="https://artificialanalysis.ai/models/deepseek-v4-1-flash" rel="noopener noreferrer"&gt;Artificial Analysis&lt;/a&gt; found the September Flash used 1.62 times Pro 0813's output tokens on its index, so Pro needed about 62% as many, not 25%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An AIHubMix API key exported as &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt;. The &lt;a href="https://docs.aihubmix.com/en/quick-start" rel="noopener noreferrer"&gt;AIHubMix quick start&lt;/a&gt; walks through creating one.&lt;/li&gt;
&lt;li&gt;The OpenAI Python SDK (&lt;code&gt;pip install openai&lt;/code&gt;), pointed at &lt;code&gt;https://aihubmix.com/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Both model IDs: &lt;a href="https://aihubmix.com/model/deepseek-v4.1-flash-1017" rel="noopener noreferrer"&gt;&lt;code&gt;deepseek-v4.1-flash-1017&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;deepseek-v4-pro-0813&lt;/code&gt;. One key covers both.&lt;/li&gt;
&lt;li&gt;An eval set from your real workload, with a pass/fail check you already trust.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The script uses Chat Completions (&lt;code&gt;/v1/chat/completions&lt;/code&gt;), the endpoint AIHubMix's model listing shows for 1017.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run both models on the same prompt
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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://aihubmix.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-v4-pro-0813&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;deepseek-v4.1-flash-1017&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;resp&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="n"&gt;model&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;Find the bug: def mean(xs): return sum(xs) / len(xs) - 1&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;16000&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;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;resp&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;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each line of output is the model ID, its &lt;code&gt;completion_tokens&lt;/code&gt;, and the first 200 characters of the answer. Replace the single prompt with your eval set and record three things per model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pass rate&lt;/strong&gt; on your own checks. The benchmarks say the Flash should win on coding and agent work; your eval set says whether that holds for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;completion_tokens&lt;/code&gt; per prompt.&lt;/strong&gt; This is the number that decides cost. 1017 was trained for shorter outputs, but nobody has measured it against Pro yet, so your logs are the first measurement that applies to your workload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost per run&lt;/strong&gt;, read from the AIHubMix request logs rather than estimated from list prices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Failure modes that skew the comparison
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Flash prints more tokens, so it looks more expensive
&lt;/h3&gt;

&lt;p&gt;Token counts alone don't decide cost. At the prices above, Pro only breaks even if it uses about a quarter of the Flash's tokens. Multiply by price before you compare.&lt;/p&gt;

&lt;h3&gt;
  
  
  The same eval costs twice as much on one run as on another
&lt;/h3&gt;

&lt;p&gt;Off-peak is half price for both models. If one model's run lands at peak and the other's off-peak, the cost gap halves or doubles. Run the two back to back, in the same price window.&lt;/p&gt;

&lt;h3&gt;
  
  
  Image cases can't be scored on Pro
&lt;/h3&gt;

&lt;p&gt;Pro does not take images at all; 1017 does. Split screenshot, chart, and UI cases out of the shared eval set. If your workflow has any of them, that decides the question on its own.&lt;/p&gt;

&lt;h3&gt;
  
  
  No 1017 score for your science-QA workload
&lt;/h3&gt;

&lt;p&gt;GPQA Diamond is the one benchmark where Pro (92.4) beat the September Flash (90.9), and DeepSeek has not published a 1017 score. If science QA is your main workload, test it on your own questions before moving.&lt;/p&gt;

&lt;h2&gt;
  
  
  What nobody has verified yet
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Every benchmark number above is DeepSeek's own; no third party has reproduced them.&lt;/li&gt;
&lt;li&gt;The paper's Pro column does not name the 0813 build. Its Terminal-Bench 2.1 score matches the 0813 card, which is why it's read as 0813 here.&lt;/li&gt;
&lt;li&gt;1017's output length against Pro. Artificial Analysis's 62% figure is for the September Flash, and no third party has re-measured 1017.&lt;/li&gt;
&lt;li&gt;Per-task token counts for either model. The session cost above is an estimate from assumptions, not a measurement.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Decision rules
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep Pro&lt;/strong&gt; if you have a production pipeline validated on Pro 0813 and no time to re-run evaluations this month, or a science-QA workload where the GPQA gap has shown up in your own tests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Move to the Flash&lt;/strong&gt; for coding agents, terminal automation, tool-calling pipelines, anything with images, and anything high-volume where concurrency matters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test before moving&lt;/strong&gt; long-form writing and analysis where you have relied on Pro's shorter, denser answers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no deadline forcing the move: DeepSeek's &lt;a href="https://api-docs.deepseek.com/updates" rel="noopener noreferrer"&gt;changelog&lt;/a&gt; says it will keep serving V4 Pro, and no retirement date has been announced. The &lt;a href="https://aihubmix.com/compare/deepseek-v4.1-flash-1017/deepseek-v4-pro-0813" rel="noopener noreferrer"&gt;AIHubMix compare page&lt;/a&gt; lists both models' specs and prices side by side while you run the evals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the DeepSeek V4.1 Flash 1017 series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Your eval results describe one checkpoint, and DeepSeek updates the Flash in place; here's what changed in 1017: &lt;a href="https://dev.to/aihubmix/deepseek-v41-flash-1017-same-price-shorter-outputs-should-you-switch-1nj5"&gt;DeepSeek V4.1 Flash 1017: Same Price, Shorter Outputs, and AIHubMix vs OpenRouter Pricing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If the evals pass and you move the integration, this covers the thinking-mode 400 and the billing rules that apply to both models: &lt;a href="https://dev.to/aihubmix/migrating-to-deepseek-v41-flash-1017-the-reasoningcontent-400-the-silent-alias-swap-and-3hl"&gt;Migrating to DeepSeek V4.1 Flash 1017: The reasoning_content 400, the Silent Alias Swap, and Peak-Hour Billing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Once the Flash replaces Pro, the next comparison is outside DeepSeek's lineup: &lt;a href="https://dev.to/aihubmix/deepseek-v41-flash-1017-vs-claude-haiku-55-which-cheap-model-for-terminal-coding-agents-1jcp"&gt;DeepSeek V4.1 Flash 1017 vs Claude Haiku 5.5: Which Cheap Model for Terminal Coding Agents?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://api-docs.deepseek.com/quick_start/pricing" rel="noopener noreferrer"&gt;DeepSeek models and pricing&lt;/a&gt; (DeepSeek)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://arxiv.org/abs/2609.19969" rel="noopener noreferrer"&gt;DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression&lt;/a&gt; (DeepSeek-AI, arXiv)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/compare/deepseek-v4.1-flash-1017/deepseek-v4-pro-0813" rel="noopener noreferrer"&gt;DeepSeek V4.1 Flash 1017 vs DeepSeek V4 Pro 0813&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://artificialanalysis.ai/models/deepseek-v4-1-flash" rel="noopener noreferrer"&gt;DeepSeek V4.1 Flash (max): Intelligence, Performance &amp;amp; Price Analysis&lt;/a&gt; (Artificial Analysis)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://kingy.ai/blog/deepseek-v4-1-flash-1017-specs-benchmarks-pricing/" rel="noopener noreferrer"&gt;DeepSeek V4.1 Flash 1017 Tested: Specs, Benchmarks &amp;amp; Price&lt;/a&gt; (Kingy.ai)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>deepseek</category>
      <category>api</category>
    </item>
    <item>
      <title>Qwen3.8 Max Free vs Qwen3.8 Flash Free: Is Flash Enough?</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Fri, 16 Oct 2026 06:34:37 +0000</pubDate>
      <link>https://dev.to/aihubmix/qwen38-max-free-vs-qwen38-flash-free-is-flash-enough-2o9p</link>
      <guid>https://dev.to/aihubmix/qwen38-max-free-vs-qwen38-flash-free-is-flash-enough-2o9p</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Route to Flash by default and escalate to Max only when Flash's output fails a check. Both are free on AIHubMix until around November 13, 2026 (Pacific Time), or until the campaign credits run out, but they draw on one shared 1M-token daily pool. On the free route, Max takes about 11x longer to start answering and generates about a quarter as fast, and its tokens are worth about 14x as much at paid rates. On Qwen's own numbers, Flash is within about a point of Max on office tasks and graduate-level science questions; Max pulls ahead on repo-level coding and very hard reasoning.&lt;/p&gt;

&lt;h2&gt;
  
  
  The engineering problem
&lt;/h2&gt;

&lt;p&gt;Two free model IDs, &lt;code&gt;qwen3.8-max-free&lt;/code&gt; and &lt;code&gt;qwen3.8-flash-free&lt;/code&gt;, same endpoint, same price ($0). The constraints that actually matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One pool.&lt;/strong&gt; After a top-up of $1 or more, all AIHubMix free models share 100 requests a day, 10 a minute and 1M tokens a day. Every Max call is a call you can't make on Flash.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Very different speeds.&lt;/strong&gt; On AIHubMix's own measurement of the free route, Max shows about 55 s latency and about 9 tok/s; Flash shows about 5 s and about 36 tok/s.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A cliff on November 13.&lt;/strong&gt; After the campaign, Max's output costs 13.3x Flash's on AIHubMix ($5.07 against $0.38 per million tokens).&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Qwen3.8 Max (free)&lt;/th&gt;
&lt;th&gt;Qwen3.8 Flash (free)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Free price (in / out)&lt;/td&gt;
&lt;td&gt;$0 / $0&lt;/td&gt;
&lt;td&gt;$0 / $0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Paid price on AIHubMix (in / out)&lt;/td&gt;
&lt;td&gt;$1.69 / $5.07&lt;/td&gt;
&lt;td&gt;$0.1126 / $0.38&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parameters&lt;/td&gt;
&lt;td&gt;2.4T total, ~95B active&lt;/td&gt;
&lt;td&gt;125B total, 6B active&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context / max output&lt;/td&gt;
&lt;td&gt;1M / 131K&lt;/td&gt;
&lt;td&gt;1M / 131K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency, free route&lt;/td&gt;
&lt;td&gt;about 55 s&lt;/td&gt;
&lt;td&gt;about 5 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Throughput, free route&lt;/td&gt;
&lt;td&gt;about 9 tok/s&lt;/td&gt;
&lt;td&gt;about 36 tok/s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Prices are per million tokens. Latency and throughput come from the &lt;a href="https://aihubmix.com/model/qwen3.8-max-free" rel="noopener noreferrer"&gt;Qwen3.8 Max (free)&lt;/a&gt; and &lt;a href="https://aihubmix.com/model/qwen3.8-flash-free" rel="noopener noreferrer"&gt;Qwen3.8 Flash (free)&lt;/a&gt; pages on October 16, 2026, and move with load. Flash's parameter count is for the open-weight Flash-Next release. Side-by-side pages: &lt;a href="https://aihubmix.com/compare/qwen3.8-max-free/qwen3.8-flash-free" rel="noopener noreferrer"&gt;free pair&lt;/a&gt;, &lt;a href="https://aihubmix.com/compare/qwen3.8-max/qwen3.8-flash" rel="noopener noreferrer"&gt;paid pair&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the benchmarks say (self-reported)
&lt;/h2&gt;

&lt;p&gt;These are Qwen's launch figures as compiled by DataCamp (&lt;a href="https://www.datacamp.com/blog/qwen3-8-max" rel="noopener noreferrer"&gt;Max&lt;/a&gt;, &lt;a href="https://www.datacamp.com/blog/qwen3-8-flash-next" rel="noopener noreferrer"&gt;Flash-Next&lt;/a&gt;). Nobody has reproduced them independently.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Benchmark&lt;/th&gt;
&lt;th&gt;Qwen3.8 Max&lt;/th&gt;
&lt;th&gt;Qwen3.8 Flash&lt;/th&gt;
&lt;th&gt;Ahead&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CoWorkBench&lt;/td&gt;
&lt;td&gt;74.8&lt;/td&gt;
&lt;td&gt;73.9&lt;/td&gt;
&lt;td&gt;Max by 0.9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPQA Diamond&lt;/td&gt;
&lt;td&gt;92.6&lt;/td&gt;
&lt;td&gt;91.7&lt;/td&gt;
&lt;td&gt;Max by 0.9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JobBench&lt;/td&gt;
&lt;td&gt;53.4&lt;/td&gt;
&lt;td&gt;55.7&lt;/td&gt;
&lt;td&gt;Flash by 2.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-bench Pro&lt;/td&gt;
&lt;td&gt;67.7&lt;/td&gt;
&lt;td&gt;62.5&lt;/td&gt;
&lt;td&gt;Max by 5.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HLE&lt;/td&gt;
&lt;td&gt;43.6&lt;/td&gt;
&lt;td&gt;35.9&lt;/td&gt;
&lt;td&gt;Max by 7.7&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Max's numbers come from its August launch table; the 0902 update raised CoWorkBench to 76.1 and JobBench to 64.0, by Qwen's numbers. Flash's come from the Flash-Next table, and the hosted Flash may score slightly differently.&lt;/p&gt;

&lt;p&gt;Practical reading: treat sub-2-point gaps as ties. The real gaps are repository fixes (SWE-bench Pro, 5 points) and very hard expert questions (HLE, almost 8 points).&lt;/p&gt;

&lt;h2&gt;
  
  
  Sizing one task: a PR review
&lt;/h2&gt;

&lt;p&gt;Assumptions: a 1,500-line pull request plus touched files is about 30K input tokens; the model writes about 6K output tokens (thinking plus comments). The same 6K is assumed for both. &lt;a href="https://artificialanalysis.ai/models/qwen3-8-max" rel="noopener noreferrer"&gt;Artificial Analysis&lt;/a&gt; measured Max using more than twice the median output tokens on its test suite, so Max's numbers here are on the low side.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Qwen3.8 Max&lt;/th&gt;
&lt;th&gt;Qwen3.8 Flash&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tokens from the free daily pool&lt;/td&gt;
&lt;td&gt;36K&lt;/td&gt;
&lt;td&gt;36K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reviews that fit in 1M tokens&lt;/td&gt;
&lt;td&gt;about 27&lt;/td&gt;
&lt;td&gt;about 27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time at free-route speeds&lt;/td&gt;
&lt;td&gt;about 12 min&lt;/td&gt;
&lt;td&gt;about 3 min&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost after the campaign&lt;/td&gt;
&lt;td&gt;$0.081&lt;/td&gt;
&lt;td&gt;$0.0057&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Time = latency (55 s / 5 s) + 6K tokens at 9 / 36 tok/s. Cost = 30K input + 6K output at AIHubMix paid prices: $0.0507 + $0.0304 for Max, $0.0034 + $0.0023 for Flash.&lt;/p&gt;

&lt;p&gt;Same pool cost today, about 4x the wall-clock for Max, and after the campaign the Flash review costs under a fourteenth of the Max one. A CI gate someone is waiting on belongs on Flash; an overnight review of payment-code PRs is where Max's 5-point SWE-bench Pro lead earns the wait.&lt;/p&gt;

&lt;h2&gt;
  
  
  The routing pattern
&lt;/h2&gt;

&lt;p&gt;Same base URL, same SDK, so routing is a model-ID swap. Flash first, Max only on failure:&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&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;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://aihubmix.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;900&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;resp&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="n"&gt;model&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="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;resp&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="n"&gt;answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;qwen3.8-flash-free&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;passes_checks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;  &lt;span class="c1"&gt;# your tests, a schema check, or a reviewer
&lt;/span&gt;    &lt;span class="n"&gt;answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;qwen3.8-max-free&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;passes_checks&lt;/code&gt; is whatever you already trust: a test run, a JSON schema validation, a linter, a human approval step. The &lt;code&gt;timeout=900&lt;/code&gt; covers Max's long answers on the free route.&lt;/p&gt;

&lt;p&gt;Where each task type should start:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Start with&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Chat, Q&amp;amp;A, drafting&lt;/td&gt;
&lt;td&gt;Flash&lt;/td&gt;
&lt;td&gt;Seconds to answer, office scores near Max&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extraction, tagging, summaries&lt;/td&gt;
&lt;td&gt;Flash&lt;/td&gt;
&lt;td&gt;High volume; Max adds wait, not accuracy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;In-editor help, small fixes&lt;/td&gt;
&lt;td&gt;Flash&lt;/td&gt;
&lt;td&gt;Interactive work needs fast replies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-file bugs, deep code review&lt;/td&gt;
&lt;td&gt;Max&lt;/td&gt;
&lt;td&gt;Widest coding gap on Qwen's numbers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hard math and expert questions&lt;/td&gt;
&lt;td&gt;Max&lt;/td&gt;
&lt;td&gt;Nearly 8 points ahead on HLE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overnight and batch jobs&lt;/td&gt;
&lt;td&gt;Max&lt;/td&gt;
&lt;td&gt;The wait costs nothing there&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Failure modes to plan for
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Max as an interactive default.&lt;/strong&gt; At about 55 s before the first token, Max makes chat UIs and editor assistants feel broken. Keep it off the interactive path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Escalating everything.&lt;/strong&gt; If your check is too strict, every request goes to Max and you pay twice from the shared pool (Flash's tokens plus Max's). Log the escalation rate; if most requests escalate, call Max directly for that task type.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Planning for after November 13 with free-route numbers.&lt;/strong&gt; Max's output is 13.3x Flash's price on the paid IDs. A routing pattern that's free today has a real bill later, and Flash-first keeps it low.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What this post can't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The benchmark gaps are Qwen's own, and the Flash column is from the open-weight Flash-Next release, not the hosted model.&lt;/li&gt;
&lt;li&gt;AIHubMix doesn't state which Max snapshot (launch or 0902) the free ID serves.&lt;/li&gt;
&lt;li&gt;Latency and throughput are point-in-time readings from the model pages and change with load.&lt;/li&gt;
&lt;li&gt;The PR-review numbers are estimates from stated assumptions, not a measured run.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the Qwen3.8 Free series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If you haven't set up the free IDs yet, start with the limits, the end date and a first request: &lt;a href="https://dev.to/aihubmix/free-qwen38-max-and-flash-api-on-aihubmix-limits-end-date-and-your-first-call-5e08"&gt;Free Qwen3.8 Max and Flash API on AIHubMix: Limits, End Date, and Your First Call&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Max's long waits and the shared pool cause most of the errors people hit, and there's a fallback that covers them: &lt;a href="https://dev.to/aihubmix/qwen38-free-on-aihubmix-fix-429s-rate-limited-by-provider-and-a-drained-token-pool-4a2b"&gt;Qwen3.8 Free on AIHubMix: Fix 429s, "Rate Limited by Provider", and a Drained Token Pool&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/compare/qwen3.8-max-free/qwen3.8-flash-free" rel="noopener noreferrer"&gt;Qwen3.8 Max (free) vs Qwen3.8 Flash (free)&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/models/free" rel="noopener noreferrer"&gt;Free AI models and quotas&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.datacamp.com/blog/qwen3-8-max" rel="noopener noreferrer"&gt;Qwen3.8-Max: Features, Benchmarks, and Pricing&lt;/a&gt; (DataCamp)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.datacamp.com/blog/qwen3-8-flash-next" rel="noopener noreferrer"&gt;Qwen3.8-Flash-Next: Features, Benchmarks, and Pricing&lt;/a&gt; (DataCamp)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://artificialanalysis.ai/models/qwen3-8-max" rel="noopener noreferrer"&gt;Qwen3.8 Max (0902): Intelligence, Performance &amp;amp; Price Analysis&lt;/a&gt; (Artificial Analysis)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>qwen</category>
      <category>llm</category>
      <category>api</category>
    </item>
    <item>
      <title>Qwen3.8 Free on AIHubMix: Fix 429s, "Rate Limited by Provider", and a Drained Token Pool</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Fri, 16 Oct 2026 06:34:30 +0000</pubDate>
      <link>https://dev.to/aihubmix/qwen38-free-on-aihubmix-fix-429s-rate-limited-by-provider-and-a-drained-token-pool-4a2b</link>
      <guid>https://dev.to/aihubmix/qwen38-free-on-aihubmix-fix-429s-rate-limited-by-provider-and-a-drained-token-pool-4a2b</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; If you're calling &lt;code&gt;qwen3.8-max-free&lt;/code&gt; or &lt;code&gt;qwen3.8-flash-free&lt;/code&gt; on AIHubMix, almost every failure comes from one of three sources: the free-tier caps (10 requests a minute, 100 a day, 1M tokens a day, all shared across the free catalog), the upstream campaign capacity GMI Cloud has reserved, or thinking tokens and agent context draining the daily pool. The single most useful fix is key-level fallback to the paid &lt;code&gt;qwen3.8-max&lt;/code&gt; and &lt;code&gt;qwen3.8-flash&lt;/code&gt;. It also covers the end of the free window, around November 13, 2026 (Pacific Time). The everyday API errors still apply on top of that: a wrong key or model ID, a context that's too long, a broken tool-call history, JSON mode, content moderation, and images that are too small. Failure 5 covers them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An AIHubMix account with a top-up of $1 or more. Before that you only get 10 trial calls, shared across every free model.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt; exported in your shell.&lt;/li&gt;
&lt;li&gt;The OpenAI Python SDK, or curl. Base URL: &lt;code&gt;https://aihubmix.com/v1&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&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;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://aihubmix.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;900&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The long timeout is there for long streamed answers from Max. It won't rescue a non-streaming one: a non-streaming request that runs past about 125 seconds gets a 524 whatever your timeout is. See failure 4.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure 1: 429 "Sorry, you have reached the limit of the free model quota"
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://aihubmix.com/models/free" rel="noopener noreferrer"&gt;free models page&lt;/a&gt; says: "Past a cap the API returns 429 until the next minute or day starts." The caps are per account, so a batch job on any other free model spends the same minute and the same day. In AIHubMix's gateway logs, a request past a cap comes back with this message and a top-up link:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sorry, you have reached the limit of the free model quota. Please switch to a paid model to enjoy unlimited concurrency.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It doesn't say which cap you hit. AIHubMix's &lt;a href="https://docs.aihubmix.com/en/FAQs/HTTP-Codes" rel="noopener noreferrer"&gt;HTTP status code reference&lt;/a&gt; gives a different frequency-limit message, "The xx model Too many requests; please try again later.", so match on the 429 status, not the text.&lt;/p&gt;

&lt;p&gt;Reproduce it with 11 quick requests. This costs 11 of your 100 daily requests:&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="k"&gt;for &lt;/span&gt;i &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;seq &lt;/span&gt;1 11&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /dev/null &lt;span class="nt"&gt;-w&lt;/span&gt; &lt;span class="s2"&gt;"%{http_code}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; https://aihubmix.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 &lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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":"qwen3.8-flash-free","messages":[{"role":"user","content":"hi"}],"max_tokens":16}'&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside one minute, the first ten print 200 and the eleventh prints 429.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; rate-limit batch jobs to under 10 requests a minute. For the daily cap, wait for the reset or let fallback absorb the overflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure 2: "Rate limited by provider"
&lt;/h2&gt;

&lt;p&gt;On October 16, AIHubMix's own test call to &lt;code&gt;qwen3.8-max-free&lt;/code&gt; came back as HTTP 429 with this body, while the same key kept working on &lt;code&gt;qwen3.8-flash-free&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="nl"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Model qwen3.8-max-free rate limited by provider – contact support to request higher concurrency or try again later. (tid: …)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"service_unavailable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"param"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"rate_limit_exceeded"&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;The status code reference lists the same message under 503, so match on both codes, or on &lt;code&gt;code: rate_limit_exceeded&lt;/code&gt; plus the message.&lt;/p&gt;

&lt;p&gt;The free IDs run on capacity GMI Cloud has set aside for the campaign. When many callers hit Max at once, that pool fills up for a while. Your quota isn't the problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; exponential backoff, then fallback for anything that can't wait. Log the &lt;code&gt;tid&lt;/code&gt;; support can use it to find the request.&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;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&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;RateLimitError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;InternalServerError&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call_with_backoff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;delay&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&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="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;except &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;RateLimitError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;InternalServerError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;524&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="c1"&gt;# long non-streaming request cut off upstream; a retry fails the same way
&lt;/span&gt;                &lt;span class="k"&gt;raise&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;retrying in &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;delay&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;s: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&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="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Failure 3: no error, but the reply says your trial is used up
&lt;/h2&gt;

&lt;p&gt;This one doesn't throw. After the 10th trial call on an account that hasn't topped up, the API keeps answering, but the answer is a note that the trial is used up. If your app renders model output, your users will see that note. Top up $1 or more and the account switches permanently to daily quotas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure 4: 524 "bad response status code 524" on non-streaming requests
&lt;/h2&gt;

&lt;p&gt;A non-streaming request hangs for about two minutes, then fails with HTTP 524. AIHubMix's gateway records it as:&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="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"bad response status code 524"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"upstream_error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"param"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"524"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"bad_response_status_code"&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;In AIHubMix's gateway logs for October 18–19, this was the most frequent error on &lt;code&gt;qwen3.8-max-free&lt;/code&gt;, and it shows up on &lt;code&gt;qwen3.8-flash-free&lt;/code&gt; too, less often.&lt;/p&gt;

&lt;p&gt;The free route's upstream sits behind Cloudflare, which closes a request after about 125 seconds without a response and returns 524 ("A timeout occurred"). Every 524 AIHubMix traced was a non-streaming request that got nothing back in those 125 seconds. Non-streaming means no response until the whole answer is ready, and Max is slow to finish: about 55 seconds of latency and about 9 tokens a second on the free route, per AIHubMix. That leaves roughly 70 seconds, or about 600 tokens including thinking, before the cutoff (an estimate from those two figures). A bigger client timeout doesn't help, since the cutoff is upstream, and resending the same request hits it again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; stream Max requests and long Flash requests, and keep Max off interactive paths.&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="n"&gt;stream&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;qwen3.8-max-free&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;Review this diff for bugs: ...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;chunk&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;delta&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;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&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;delta&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;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Failure 5: everyday API errors
&lt;/h2&gt;

&lt;p&gt;Not every error on the free IDs is about quotas. These hit the free and paid IDs alike. Per AIHubMix's status code reference, most 400s are passed through from the upstream model. The free IDs run on GMI Cloud and the paid ones on Alibaba Cloud, so 400 wording can differ between routes. Messages below are quoted from AIHubMix's reference, &lt;a href="https://www.alibabacloud.com/help/en/model-studio/error-code" rel="noopener noreferrer"&gt;Alibaba Cloud's error code reference&lt;/a&gt;, and AIHubMix's gateway logs.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;th&gt;Error&lt;/th&gt;
&lt;th&gt;Usual cause&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;401&lt;/td&gt;
&lt;td&gt;Unauthorized&lt;/td&gt;
&lt;td&gt;Wrong or missing key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;503&lt;/td&gt;
&lt;td&gt;Incorrect model ID&lt;/td&gt;
&lt;td&gt;Typo, or another platform's ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;403&lt;/td&gt;
&lt;td&gt;Key not authorized for the model&lt;/td&gt;
&lt;td&gt;Model not enabled on the key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Range of input length&lt;/td&gt;
&lt;td&gt;Context over the limit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Role "tool" without "tool_calls"&lt;/td&gt;
&lt;td&gt;Broken tool-call history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;JSON mode errors&lt;/td&gt;
&lt;td&gt;Prompt wording or thinking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Inappropriate content&lt;/td&gt;
&lt;td&gt;Content moderation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Image length and width&lt;/td&gt;
&lt;td&gt;Image 10px or less on a side&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  401: "Unauthorized – access token is invalid or expired."
&lt;/h3&gt;

&lt;p&gt;Wrong, revoked or expired key. With no Authorization header at all, you get "Unauthorized – no access token supplied; please log in and include a valid token." Usual causes: the env var isn't set in the shell running the code, so an empty key goes out, or a QwenCloud or GMI Cloud key gets sent to AIHubMix.&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;echo&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;AIHUBMIX_API_KEY&lt;/span&gt;:0:3&lt;span class="k"&gt;}&lt;/span&gt;   &lt;span class="c"&gt;# should print sk-&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AIHubMix keys only work on &lt;code&gt;https://aihubmix.com/v1&lt;/code&gt;; other platforms' keys don't work there.&lt;/p&gt;

&lt;h3&gt;
  
  
  503: "Incorrect model ID. Please request to view the model page or you do not have permission to use this model"
&lt;/h3&gt;

&lt;p&gt;IDs must match exactly: &lt;code&gt;qwen3.8-max-free&lt;/code&gt; and &lt;code&gt;qwen3.8-flash-free&lt;/code&gt;, all lowercase, hyphen before &lt;code&gt;free&lt;/code&gt;. GMI Cloud's &lt;code&gt;Qwen/Qwen3.8-Max&lt;/code&gt; doesn't exist on AIHubMix. The quiet variant: QwenCloud's &lt;code&gt;qwen3.8-max&lt;/code&gt; is a valid AIHubMix ID, but it's the paid model, so the request bills you without any error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://aihubmix.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 &lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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":"qwen-3.8-max-free","messages":[{"role":"user","content":"hi"}]}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the ID from the model page. And because this is a 503, retry logic that treats every 5xx as transient will retry a typo forever. Treat this message as permanent.&lt;/p&gt;

&lt;h3&gt;
  
  
  403: "Forbidden – key(last 6 digits of request key) not authorized to access the requested model."
&lt;/h3&gt;

&lt;p&gt;Keys can be restricted to a model list. A key made for another project won't reach the Qwen3.8 free IDs until you add &lt;code&gt;qwen3.8-max-free&lt;/code&gt; and &lt;code&gt;qwen3.8-flash-free&lt;/code&gt; in API key management. If you use fallback, add the paid backups too: fallback skips models outside the key's list.&lt;/p&gt;

&lt;h3&gt;
  
  
  400: "Range of input length should be [1, xxx]"
&lt;/h3&gt;

&lt;p&gt;Alibaba's message for input over the context limit; xxx is the limit. Agent sessions are the usual cause. Alibaba also notes that long prompts with thinking on "may cause response truncation or request timeout." Trim history, start a new session, or turn on compaction, but trim carefully, or you hit the next error.&lt;/p&gt;

&lt;h3&gt;
  
  
  400: messages with role "tool" must be a response to a preceeding message with "tool_calls"
&lt;/h3&gt;

&lt;p&gt;Alibaba's reference lists this message, typo included, plus its mirror: "An assistant message with "tool_calls" must be followed by tool messages responding to each "tool_call_id"". Qwen Code users hit the first one in &lt;a href="https://github.com/QwenLM/qwen-code/issues/2360" rel="noopener noreferrer"&gt;issue #2360&lt;/a&gt;. The cause is a tool result whose call was trimmed, or a call whose result is missing, usually from hand-rolled trimming or compaction. Keep each call and its results together:&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="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="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;What&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s the weather in Hangzhou?&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="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;assistant&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="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_calls&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&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;call_1&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;type&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;function&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;function&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&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;get_weather&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;arguments&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;{&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;city&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;Hangzhou&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;}&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="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;tool&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;tool_call_id&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;call_1&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;{&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;temp_c&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;: 21}&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="c1"&gt;# When trimming, drop messages[1] and messages[2] together, never just one of them.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  400: JSON mode
&lt;/h3&gt;

&lt;p&gt;Two messages from Alibaba's reference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"'messages' must contain the word 'json' in some form, to use 'response_format' of type 'json_object'."&lt;/li&gt;
&lt;li&gt;"Json mode response is not supported when enable_thinking is true"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first is OpenAI's JSON-mode rule too. The second matters for Qwen3.8 because thinking is on by default, so a &lt;code&gt;json_object&lt;/code&gt; request that works elsewhere can fail here. Alibaba doesn't list which models return it, so test on your ID. Fix both 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 &lt;span class="nt"&gt;-s&lt;/span&gt; https://aihubmix.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 &lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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": "qwen3.8-flash-free",
    "messages": [{"role": "user", "content": "Reply in JSON with the city and date: meet in Hangzhou on Nov 3."}],
    "response_format": {"type": "json_object"},
    "enable_thinking": false
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  400: "Input text data may contain inappropriate content."
&lt;/h3&gt;

&lt;p&gt;Content moderation, on the free IDs as well as the paid ones. In AIHubMix's gateway logs for October 18–19, it was the error the most people hit on the free IDs, with exactly this text. On the paid route, Alibaba prefixes its code: "InternalError.Algo.DataInspectionFailed: Input text data may contain inappropriate content." Alibaba's reference lists the code as &lt;code&gt;data_inspection_failed&lt;/code&gt;, with output variants "Output data may contain inappropriate content." and "Input or output data may contain inappropriate content." User-generated text in the prompt (scraped pages, support tickets) is the usual trigger. Fallback won't route around it: the paid IDs screen the same way. Bisect the input to find the passage, then filter or rephrase it; resending gets the same answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  400: "The image length and width do not meet the model restrictions."
&lt;/h3&gt;

&lt;p&gt;Every image in the request must be more than 10 pixels on each side. The message ends with the rejected size, for example "[height:8 or width:8 must be larger than 10]". AIHubMix's gateway logs show it on both free IDs. Images that small usually slip in by accident: icons or tracking pixels picked up with a scraped page. Check sizes before sending, and drop or upscale anything 10 pixels or less on either side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure 6: the token pool drains quietly
&lt;/h2&gt;

&lt;p&gt;There are no errors until the 1M-token pool is empty; then every free call returns 429 at once. Three things drain it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thinking tokens.&lt;/strong&gt; Both models think by default, and Alibaba bills thinking as output tokens; on the free route they count toward your pool. In AIHubMix's test, a two-sentence answer from &lt;code&gt;qwen3.8-flash-free&lt;/code&gt; used 89 output tokens, 36 of them on thinking. &lt;a href="https://artificialanalysis.ai/models/qwen3-8-max" rel="noopener noreferrer"&gt;Artificial Analysis&lt;/a&gt; measured Max at 190M output tokens on its index, against an 87M median. Turn thinking off with &lt;code&gt;enable_thinking&lt;/code&gt;, &lt;a href="https://www.alibabacloud.com/help/en/model-studio/deep-thinking" rel="noopener noreferrer"&gt;Alibaba's documented switch&lt;/a&gt;, passed through &lt;code&gt;extra_body&lt;/code&gt;:&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="n"&gt;resp&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;qwen3.8-flash-free&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;Return only the invoice number: INV-2026-0042, due Nov 3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="n"&gt;extra_body&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;enable_thinking&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;False&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;resp&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;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens_details&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that &lt;code&gt;reasoning_tokens&lt;/code&gt; is 0. If it isn't, the switch didn't reach the model on that route.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent context.&lt;/strong&gt; Agents resend the whole conversation every turn. A session at 40K tokens, run for 20 more turns, sends 800K input tokens. Cap the context, start new sessions, and use compaction where the tool has it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One big request.&lt;/strong&gt; The 1M context window is the same size as the daily pool. One full-window request spends the day.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix that covers most of it: key-level fallback
&lt;/h2&gt;

&lt;p&gt;AIHubMix can switch models at the gateway, per API key, with no client change (&lt;a href="https://docs.aihubmix.com/en/api/Model-Mapping-Fallback" rel="noopener noreferrer"&gt;model mapping and fallback&lt;/a&gt;):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the console's API key management, edit the key your app uses.&lt;/li&gt;
&lt;li&gt;Under "Fallback models on error", add &lt;code&gt;qwen3.8-max&lt;/code&gt;, then &lt;code&gt;qwen3.8-flash&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Keep requesting &lt;code&gt;qwen3.8-max-free&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Don't list free IDs as backups: a free model can only be the primary model, and the backup list skips it silently.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;th&gt;Falls back?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Free model hits a quota or rate limit&lt;/td&gt;
&lt;td&gt;Yes, to a paid backup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Every upstream channel fails before the reply starts&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The stream has already started&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your client timed out&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your own key is invalid or out of balance&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Fallback requests are billed at the answering model's price, so keep a balance. If fallback requests start failing with 403 "Your account balance is insufficient. Please recharge your account to continue using the API.", top up: fallback doesn't route around your own balance. Below -$1, the free models stop working too until you top up.&lt;/p&gt;

&lt;p&gt;Check which model answered:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; https://aihubmix.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 &lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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":"qwen3.8-max-free","messages":[{"role":"user","content":"hi"}]}'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'x-aihubmix-(model|fallback)'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;X-Aihubmix-Fallback: true&lt;/code&gt; means it fell back; &lt;code&gt;X-Aihubmix-Model&lt;/code&gt; is the model that answered and was billed. After the window closes around November 13 (or earlier if GMI Cloud's credits run out), the same setup keeps your app running. Without it, drop &lt;code&gt;-free&lt;/code&gt; from the model ID.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coding tools
&lt;/h2&gt;

&lt;p&gt;OpenCode, Cline, Kilo Code, Qwen Code and Hermes Agent all work with the free IDs as an OpenAI-compatible provider; the &lt;a href="https://docs.aihubmix.com/en/api/Opencode" rel="noopener noreferrer"&gt;OpenCode guide&lt;/a&gt; shows the pattern.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Provider type&lt;/td&gt;
&lt;td&gt;OpenAI-compatible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Base URL&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aihubmix.com/v1" rel="noopener noreferrer"&gt;https://aihubmix.com/v1&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model ID&lt;/td&gt;
&lt;td&gt;qwen3.8-flash-free or qwen3.8-max-free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context window&lt;/td&gt;
&lt;td&gt;Up to 1M; set lower to save the pool&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Max output&lt;/td&gt;
&lt;td&gt;Up to 131K&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Agent loops drain the pool, and Max is slow as an interactive main model. Where a tool splits planning and editing models (Cline's Plan and Act modes, for example), put Max on planning and Flash on edits.&lt;/p&gt;

&lt;p&gt;Smoke test, about 15 minutes: point the tool at &lt;code&gt;qwen3.8-flash-free&lt;/code&gt;, ask it to add one unit test for a small function in a real repo, and run it. Pass means it reads the file, writes the test, runs it via a tool call, and the AIHubMix usage log shows the requests under the free model at $0. Then rerun the planning step on &lt;code&gt;qwen3.8-max-free&lt;/code&gt; and compare time and tokens.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this post can't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The behaviour of the &lt;code&gt;-free&lt;/code&gt; IDs after the campaign ends: AIHubMix hasn't published the exact response.&lt;/li&gt;
&lt;li&gt;Whether &lt;code&gt;enable_thinking&lt;/code&gt; passes through on every route. Check &lt;code&gt;reasoning_tokens&lt;/code&gt; yourself, as shown above.&lt;/li&gt;
&lt;li&gt;The exact 400 wording on the free route, beyond the moderation and image-size messages taken from AIHubMix's gateway logs. The other quotes come from AIHubMix's and Alibaba Cloud's references, and GMI Cloud may word them differently; Alibaba doesn't say which models return the JSON-mode thinking error.&lt;/li&gt;
&lt;li&gt;That streaming avoids the 524. It follows from how Cloudflare's timeout works (it waits for the first response, and a stream starts responding early), but every 524 AIHubMix traced was non-streaming, and no streamed request was timed against the cutoff.&lt;/li&gt;
&lt;li&gt;The provider rate limit is load-dependent. A single test on October 16 doesn't tell you how often it happens.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the Qwen3.8 Free series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For the quota rules, the end date and a working first request: &lt;a href="https://dev.to/aihubmix/free-qwen38-max-and-flash-api-on-aihubmix-limits-end-date-and-your-first-call-5e08"&gt;Free Qwen3.8 Max and Flash API on AIHubMix: Limits, End Date, and Your First Call&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;To stop hitting Max's waits on work Flash can handle: &lt;a href="https://dev.to/aihubmix/qwen38-max-free-vs-qwen38-flash-free-is-flash-enough-2o9p"&gt;Qwen3.8 Max Free vs Qwen3.8 Flash Free: Is Flash Enough?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.aihubmix.com/en/FAQs/HTTP-Codes" rel="noopener noreferrer"&gt;HTTP status codes&lt;/a&gt; (AIHubMix docs)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aihubmix.com/en/api/Model-Mapping-Fallback" rel="noopener noreferrer"&gt;Model mapping and fallback&lt;/a&gt; (AIHubMix docs)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/models/free" rel="noopener noreferrer"&gt;Free AI models and quotas&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.alibabacloud.com/help/en/model-studio/error-code" rel="noopener noreferrer"&gt;Error codes&lt;/a&gt; (Alibaba Cloud Model Studio)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.alibabacloud.com/help/en/model-studio/deep-thinking" rel="noopener noreferrer"&gt;Use deep thinking models via API&lt;/a&gt; (Alibaba Cloud Model Studio)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>qwen</category>
      <category>llm</category>
      <category>api</category>
    </item>
    <item>
      <title>Free Qwen3.8 Max and Flash API on AIHubMix: Limits, End Date, and Your First Call</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Fri, 16 Oct 2026 06:34:06 +0000</pubDate>
      <link>https://dev.to/aihubmix/free-qwen38-max-and-flash-api-on-aihubmix-limits-end-date-and-your-first-call-5e08</link>
      <guid>https://dev.to/aihubmix/free-qwen38-max-and-flash-api-on-aihubmix-limits-end-date-and-your-first-call-5e08</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;code&gt;qwen3.8-max-free&lt;/code&gt; and &lt;code&gt;qwen3.8-flash-free&lt;/code&gt; are $0 per million tokens on AIHubMix's OpenAI-compatible endpoint until around November 13, 2026 (Pacific Time), or until GMI Cloud's campaign credits run out. You get 10 trial calls, or after a $1+ top-up, 100 requests a day, 10 a minute and 1M tokens a day, shared across all free models. Stream Max, budget for thinking tokens, and plan the one-line switch to the paid IDs.&lt;/p&gt;

&lt;p&gt;GMI Cloud is funding a 30-day campaign that went live on October 14, 2026 (Pacific Time). It puts Alibaba's flagship Qwen3.8 Max and its fast sibling Qwen3.8 Flash on AIHubMix at no cost. This post covers what you need to call them today and keep your code working after the window closes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An AIHubMix account and API key (&lt;a href="https://docs.aihubmix.com/en/quick-start" rel="noopener noreferrer"&gt;quick start&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;The key exported as &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Optional: a top-up of $1 or more, to switch from 10 trial calls to daily quotas&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;curl&lt;/code&gt;, or Python with the &lt;code&gt;openai&lt;/code&gt; package&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The model IDs and what they replace
&lt;/h2&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;Free ID&lt;/th&gt;
&lt;th&gt;Paid ID&lt;/th&gt;
&lt;th&gt;AIHubMix paid (in / out)&lt;/th&gt;
&lt;th&gt;Qwen list (in / out)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.8 Max&lt;/td&gt;
&lt;td&gt;qwen3.8-max-free&lt;/td&gt;
&lt;td&gt;qwen3.8-max&lt;/td&gt;
&lt;td&gt;$1.69 / $5.07&lt;/td&gt;
&lt;td&gt;$2.00 / $6.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.8 Flash&lt;/td&gt;
&lt;td&gt;qwen3.8-flash-free&lt;/td&gt;
&lt;td&gt;qwen3.8-flash&lt;/td&gt;
&lt;td&gt;$0.1126 / $0.38&lt;/td&gt;
&lt;td&gt;$0.16 / $0.47&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Prices are per million tokens; Qwen list prices are QwenCloud's.&lt;/p&gt;

&lt;p&gt;The free IDs carry the standard capabilities of the paid ones: 1M-token context, up to 131K output tokens, tool calling, and thinking on by default. They're served by GMI Cloud instead of Alibaba Cloud, so latency differs. The &lt;a href="https://aihubmix.com/model/qwen3.8-max-free" rel="noopener noreferrer"&gt;Qwen3.8 Max (free)&lt;/a&gt; and &lt;a href="https://aihubmix.com/model/qwen3.8-flash-free" rel="noopener noreferrer"&gt;Qwen3.8 Flash (free)&lt;/a&gt; pages show live latency and uptime for the free route.&lt;/p&gt;

&lt;h2&gt;
  
  
  First request
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://aihubmix.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 &lt;/span&gt;&lt;span class="nv"&gt;$AIHUBMIX_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&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": "qwen3.8-flash-free",
    "messages": [{"role": "user", "content": "In two sentences, what is a mixture-of-experts model?"}]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response is a normal Chat Completions object. Because thinking is on, the message also carries a &lt;code&gt;reasoning_content&lt;/code&gt; field, and &lt;code&gt;usage.completion_tokens_details.reasoning_tokens&lt;/code&gt; counts what the model spent thinking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calling Max: stream it
&lt;/h2&gt;

&lt;p&gt;Max thinks before its first visible token. AIHubMix's own measurement of the free route puts latency at about 55 seconds, against about 5 seconds for Flash. Stream the response and raise the client timeout:&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&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;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://aihubmix.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AIHUBMIX_API_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;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;stream&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;qwen3.8-max-free&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;Find the bug in this function:&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s"&gt;def mean(xs):&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;    return sum(xs) / len(xs) - 1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;chunk&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;delta&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;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&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;delta&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;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thinking arrives in &lt;code&gt;delta.reasoning_content&lt;/code&gt;, so this loop prints only the answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quotas, and how they bite
&lt;/h2&gt;

&lt;p&gt;From the &lt;a href="https://aihubmix.com/models/free" rel="noopener noreferrer"&gt;AIHubMix free models page&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Before any top-up:&lt;/strong&gt; 10 trial calls in total, shared across every free model, no expiry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;After a top-up of $1 or more:&lt;/strong&gt; 100 requests/day, 10 requests/minute, 1M tokens/day, shared across the whole free catalog, reset daily. The switch is permanent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Past a cap:&lt;/strong&gt; HTTP 429 until the next minute or day starts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Failure modes worth handling in code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The trial runs out silently.&lt;/strong&gt; After the tenth trial call, the API keeps replying with a note that the trial is used up, not an error. If you pipe output straight to users, they'll see that note.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thinking eats the pool.&lt;/strong&gt; Alibaba bills thinking as output tokens, and every token counts toward the 1M/day pool. In a test on October 16, a two-sentence answer from &lt;code&gt;qwen3.8-flash-free&lt;/code&gt; used 89 output tokens, 36 of them on thinking. For simple requests, pass &lt;code&gt;extra_body={"enable_thinking": False}&lt;/code&gt;, which is &lt;a href="https://www.alibabacloud.com/help/en/model-studio/deep-thinking" rel="noopener noreferrer"&gt;Alibaba's documented switch&lt;/a&gt; for Qwen3.8.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One request can drain the day.&lt;/strong&gt; The context window (1M) is as large as the daily token pool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The pool is shared.&lt;/strong&gt; Calls to any other free model come out of the same 1M tokens and 100 requests.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which model gets your tokens
&lt;/h2&gt;

&lt;p&gt;Benchmark figures here are Qwen's own launch numbers as compiled by &lt;a href="https://www.datacamp.com/blog/qwen3-8-max" rel="noopener noreferrer"&gt;DataCamp&lt;/a&gt;; nobody has reproduced them independently.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Qwen3.8 Max&lt;/strong&gt; (Aug 3, 2026): 2.4T-parameter MoE, about 95B active. SWE-bench Pro 67.7, CoWorkBench 74.8, GPQA Diamond 92.6. A 0902 post-training update shipped on September 2. &lt;a href="https://artificialanalysis.ai/models/qwen3-8-max" rel="noopener noreferrer"&gt;Artificial Analysis&lt;/a&gt; ranks it 33rd of 217 and flags it as "very verbose" (190M output tokens on its index vs an 87M median).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen3.8 Flash&lt;/strong&gt; (Aug 26, 2026): the hosted version of open-weight Flash-Next (125B total, 6B active). SWE-bench Pro 62.5, CoWorkBench 73.9.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Priced at AIHubMix's paid rates, a full day's 1M tokens (750K in, 250K out) is worth:&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;750K input&lt;/th&gt;
&lt;th&gt;250K output&lt;/th&gt;
&lt;th&gt;Per day&lt;/th&gt;
&lt;th&gt;Full 30 days&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.8 Max&lt;/td&gt;
&lt;td&gt;$1.27&lt;/td&gt;
&lt;td&gt;$1.27&lt;/td&gt;
&lt;td&gt;$2.54&lt;/td&gt;
&lt;td&gt;about $76&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.8 Flash&lt;/td&gt;
&lt;td&gt;$0.08&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;td&gt;$0.18&lt;/td&gt;
&lt;td&gt;about $5.40&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A Max token is worth about 14 Flash tokens. Spend the shared pool on Max where quality matters, and use Flash where latency matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  After the window closes
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;-free&lt;/code&gt; IDs stop being free around November 13, 2026 (Pacific Time), or earlier if the campaign credits run out. Either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;change &lt;code&gt;qwen3.8-max-free&lt;/code&gt; to &lt;code&gt;qwen3.8-max&lt;/code&gt; (or &lt;code&gt;qwen3.8-flash-free&lt;/code&gt; to &lt;code&gt;qwen3.8-flash&lt;/code&gt;); nothing else changes, or&lt;/li&gt;
&lt;li&gt;configure key-level fallback in AIHubMix now, so a free model that hits a quota or rate limit falls back to a paid one with no code change. The third post in this series has the setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What this post doesn't verify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Latency figures are AIHubMix's own measurements of the free route; they move with load.&lt;/li&gt;
&lt;li&gt;Benchmarks are vendor-reported.&lt;/li&gt;
&lt;li&gt;Whether &lt;code&gt;enable_thinking&lt;/code&gt; takes effect on the free route is something to check per request: look for &lt;code&gt;reasoning_tokens&lt;/code&gt; dropping to 0.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the Qwen3.8 Free series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The pool is shared, so it pays to know which model deserves your tokens: &lt;a href="https://dev.to/aihubmix/qwen38-max-free-vs-qwen38-flash-free-is-flash-enough-2o9p"&gt;Qwen3.8 Max Free vs Qwen3.8 Flash Free: Is Flash Enough?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Once you're calling it every day, here's what goes wrong and the one setting that covers most of it: &lt;a href="https://dev.to/aihubmix/qwen38-free-on-aihubmix-fix-429s-rate-limited-by-provider-and-a-drained-token-pool-4a2b"&gt;Qwen3.8 Free on AIHubMix: Fix 429s, "Rate Limited by Provider", and a Drained Token Pool&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/model/qwen3.8-max-free" rel="noopener noreferrer"&gt;Qwen3.8 Max (free) model page&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/models/free" rel="noopener noreferrer"&gt;Free AI models and quotas&lt;/a&gt; (AIHubMix)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.alibabacloud.com/help/en/model-studio/deep-thinking" rel="noopener noreferrer"&gt;Use deep thinking models via API&lt;/a&gt; (Alibaba Cloud Model Studio)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.datacamp.com/blog/qwen3-8-max" rel="noopener noreferrer"&gt;Qwen3.8-Max: Features, Benchmarks, and Pricing&lt;/a&gt; (DataCamp)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://artificialanalysis.ai/models/qwen3-8-max" rel="noopener noreferrer"&gt;Qwen3.8 Max (0902): Intelligence, Performance &amp;amp; Price Analysis&lt;/a&gt; (Artificial Analysis)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>qwen</category>
      <category>llm</category>
      <category>api</category>
    </item>
  </channel>
</rss>
