<?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>Gemini 4 Carbon vs Hydrogen vs Argon: Which Model for Which Job?</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Fri, 13 Nov 2026 08:51:47 +0000</pubDate>
      <link>https://dev.to/aihubmix/gemini-4-carbon-vs-hydrogen-vs-argon-which-model-for-which-job-13mo</link>
      <guid>https://dev.to/aihubmix/gemini-4-carbon-vs-hydrogen-vs-argon-which-model-for-which-job-13mo</guid>
      <description>&lt;p&gt;The migration between the three Gemini 4 models is one line of code; the routing decision is not. On Google's API the request schema does not change and the model string is the switch, so the cost of trying each model is small. What differs is the envelope — the ceiling, the price and the latency — and, on AIHubMix, which protocols each model documents.&lt;/p&gt;

&lt;p&gt;The measured picture first. At &lt;code&gt;high&lt;/code&gt;, &lt;a href="https://aihubmix.com/model/gemini-4-hydrogen" rel="noopener noreferrer"&gt;Hydrogen&lt;/a&gt; scores 51 on Artificial Analysis's Intelligence Index at $1.87 per task and 8.3 minutes. &lt;a href="https://aihubmix.com/model/gemini-4-argon" rel="noopener noreferrer"&gt;Argon&lt;/a&gt; at &lt;code&gt;high&lt;/code&gt; scores 50 at $4.97 and 30.6 minutes. &lt;a href="https://aihubmix.com/model/gemini-4-carbon" rel="noopener noreferrer"&gt;Carbon&lt;/a&gt; at &lt;code&gt;high&lt;/code&gt; scores 60 at $5.48, with 63.37 seconds to the first answer token. Carbon's $5.48 per task buys the highest score; Argon's $4.97 buys 50.&lt;/p&gt;

&lt;h2&gt;
  
  
  One schema, three ceilings
&lt;/h2&gt;

&lt;p&gt;All three models take a 1,048,576-token window that includes input, thinking and output. All three support long decode up to that window minus the input, and all three use implicit caching only, with a 4,096-token minimum. On Google's API, the request schema does not change when the model ID does.&lt;/p&gt;

&lt;p&gt;The limits inside that shared shape are where the models part.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;Carbon&lt;/th&gt;
&lt;th&gt;Hydrogen&lt;/th&gt;
&lt;th&gt;Argon&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;1,048,576 tokens, input + thinking + output&lt;/td&gt;
&lt;td&gt;1,048,576 tokens, input + thinking + output&lt;/td&gt;
&lt;td&gt;1,048,576 tokens, input + thinking + output&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Long decode&lt;/td&gt;
&lt;td&gt;up to window minus input&lt;/td&gt;
&lt;td&gt;up to window minus input&lt;/td&gt;
&lt;td&gt;up to window minus input&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Per-hop output&lt;/td&gt;
&lt;td&gt;65,536 / 32,768&lt;/td&gt;
&lt;td&gt;65,536 / 65,536&lt;/td&gt;
&lt;td&gt;65,536 / 32,768&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Effort ceiling&lt;/td&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;td&gt;xhigh&lt;/td&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Implicit cache minimum&lt;/td&gt;
&lt;td&gt;4,096 tokens&lt;/td&gt;
&lt;td&gt;4,096 tokens&lt;/td&gt;
&lt;td&gt;4,096 tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two rows carry migration risk. &lt;code&gt;xhigh&lt;/code&gt; exists only on Hydrogen; Carbon and Argon stop at &lt;code&gt;high&lt;/code&gt; and default to &lt;code&gt;medium&lt;/code&gt;, so a configuration pinned to &lt;code&gt;xhigh&lt;/code&gt; is not portable as a model-string change. And the decode ceiling is the window minus the input, which puts prompt size and answer length in competition for the same 1,048,576 tokens.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gateway is where the shared schema stops
&lt;/h2&gt;

&lt;p&gt;On AIHubMix the three are documented differently, and that is the first thing an integration meets.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;On AIHubMix&lt;/th&gt;
&lt;th&gt;Carbon&lt;/th&gt;
&lt;th&gt;Hydrogen&lt;/th&gt;
&lt;th&gt;Argon&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Documented input&lt;/td&gt;
&lt;td&gt;text, image, audio, video, PDF&lt;/td&gt;
&lt;td&gt;text, image, audio, video, PDF&lt;/td&gt;
&lt;td&gt;text, image, audio, video, PDF&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Documented protocols&lt;/td&gt;
&lt;td&gt;Chat Completions, Responses, Anthropic Messages, native Gemini&lt;/td&gt;
&lt;td&gt;Chat Completions&lt;/td&gt;
&lt;td&gt;Chat Completions, Responses, Anthropic Messages, native Gemini&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All three list multimodal input. Carbon and Argon document all four protocol surfaces; Hydrogen is documented on Chat Completions only. An existing Anthropic Messages client, or a Responses-based tool loop, has a documented home on Carbon and Argon and no documented equivalent on Hydrogen. That is a contract difference rather than a quality difference, and it settles integrations before the benchmark is consulted.&lt;/p&gt;

&lt;h2&gt;
  
  
  The measured trade
&lt;/h2&gt;

&lt;p&gt;Artificial Analysis's live snapshot at 2026-11-13T02:40Z covers eight configurations. It is Intelligence Index v5.0.1 with 78 ranked models, at standard list prices. The costs below are AA task costs, not AIHubMix bills.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model / effort&lt;/th&gt;
&lt;th&gt;AA rank&lt;/th&gt;
&lt;th&gt;AA Index&lt;/th&gt;
&lt;th&gt;$/task&lt;/th&gt;
&lt;th&gt;Min/task&lt;/th&gt;
&lt;th&gt;First answer token&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Carbon high&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;5.48&lt;/td&gt;
&lt;td&gt;28.1&lt;/td&gt;
&lt;td&gt;63.37 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Carbon medium&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;58&lt;/td&gt;
&lt;td&gt;4.68&lt;/td&gt;
&lt;td&gt;24.3&lt;/td&gt;
&lt;td&gt;21.82 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Carbon low&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;5.22&lt;/td&gt;
&lt;td&gt;24.7&lt;/td&gt;
&lt;td&gt;13.61 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen xhigh&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;3.16&lt;/td&gt;
&lt;td&gt;13.5&lt;/td&gt;
&lt;td&gt;37.77 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen high&lt;/td&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;51&lt;/td&gt;
&lt;td&gt;1.87&lt;/td&gt;
&lt;td&gt;8.3&lt;/td&gt;
&lt;td&gt;18.89 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen medium&lt;/td&gt;
&lt;td&gt;39&lt;/td&gt;
&lt;td&gt;41&lt;/td&gt;
&lt;td&gt;0.80&lt;/td&gt;
&lt;td&gt;3.7&lt;/td&gt;
&lt;td&gt;11.80 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen low&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;0.29&lt;/td&gt;
&lt;td&gt;1.3&lt;/td&gt;
&lt;td&gt;5.71 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Argon high&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;td&gt;4.97&lt;/td&gt;
&lt;td&gt;30.6&lt;/td&gt;
&lt;td&gt;41.30 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Three comparisons carry most of the routing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Carbon high against Hydrogen xhigh.&lt;/strong&gt; Carbon is six index points ahead, costs $2.32 more per task (73.4% more), takes 28.1 minutes against 13.5, and waits 63.37 seconds for its first token against 37.77. The &lt;a href="https://aihubmix.com/compare/gemini-4-carbon/gemini-4-hydrogen" rel="noopener noreferrer"&gt;compare page&lt;/a&gt; has both listings side by side.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hydrogen high against Argon high.&lt;/strong&gt; Hydrogen is one point ahead, costs $3.10 less per task (62.4% less), and finishes in 8.3 minutes against 30.6; its first token arrives at 18.89 seconds against 41.30. On this text-heavy index, the cheaper model is ahead on all three axes; the &lt;a href="https://aihubmix.com/compare/gemini-4-hydrogen/gemini-4-argon" rel="noopener noreferrer"&gt;compare page&lt;/a&gt; is the cost check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Carbon high against Argon high.&lt;/strong&gt; Carbon is ten points ahead for $0.51 more per task (10.3% more), and finishes slightly faster, 28.1 minutes against 30.6, even though its first token is slower.&lt;/p&gt;

&lt;p&gt;Two anomalies matter when routing rules get written. Carbon low scores the same 54 as Hydrogen xhigh, but at $5.22 per task against $3.16 and 24.7 minutes against 13.5; it also scores below Carbon medium (54 against 58) at a higher cost per task ($5.22 against $4.68). And the same Hydrogen covers 27 to 54 across its own settings. A rule keyed on the model name without the effort level is under-specified.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bill changes on December 1
&lt;/h2&gt;

&lt;p&gt;Google's &lt;a href="https://aistudio.google.com/docs/pricing" rel="noopener noreferrer"&gt;pricing page&lt;/a&gt; lists Hydrogen at $1.50 input, $7.50 output and $0.075 cached input, flat across the full context window. Carbon and Argon are $2 input, $10 output and $0.10 cached through November 30, then double. Hydrogen has no announced change.&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;Input&lt;/th&gt;
&lt;th&gt;Cached input&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;When&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen&lt;/td&gt;
&lt;td&gt;$1.50&lt;/td&gt;
&lt;td&gt;$0.075&lt;/td&gt;
&lt;td&gt;$7.50&lt;/td&gt;
&lt;td&gt;now, flat across 1M&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Carbon / Argon&lt;/td&gt;
&lt;td&gt;$2.00&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;td&gt;$10.00&lt;/td&gt;
&lt;td&gt;through 2026-11-30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Carbon / Argon&lt;/td&gt;
&lt;td&gt;$4.00&lt;/td&gt;
&lt;td&gt;$0.20&lt;/td&gt;
&lt;td&gt;$20.00&lt;/td&gt;
&lt;td&gt;from 2026-12-01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen Batch / Flex&lt;/td&gt;
&lt;td&gt;$0.75&lt;/td&gt;
&lt;td&gt;$0.0375&lt;/td&gt;
&lt;td&gt;$3.75&lt;/td&gt;
&lt;td&gt;now&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Carbon / Argon Batch / Flex&lt;/td&gt;
&lt;td&gt;$1.00&lt;/td&gt;
&lt;td&gt;$0.05&lt;/td&gt;
&lt;td&gt;$5.00&lt;/td&gt;
&lt;td&gt;through 2026-11-30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Carbon / Argon Batch / Flex&lt;/td&gt;
&lt;td&gt;$2.00&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;td&gt;$10.00&lt;/td&gt;
&lt;td&gt;from 2026-12-01&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Official prices in USD per million tokens. The current gap is 25% per token; from December 1 it is 62.5% for input and output. If Carbon and Argon double while Hydrogen holds, their AA task costs would also roughly double at the same token mix — about $10.96 for Carbon high and $9.94 for Argon high. That is a computed estimate, not an AA measurement and not an AIHubMix bill.&lt;/p&gt;

&lt;p&gt;AIHubMix lists all three at Google's current prices. The free tier is Google's only; the gateway is a paid route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Routing: plan on one, execute on the other
&lt;/h2&gt;

&lt;p&gt;Google's &lt;a href="https://aistudio.google.com/docs/whats-new-gemini-4-hydrogen" rel="noopener noreferrer"&gt;release notes&lt;/a&gt; give the division directly: "Route planning turns to &lt;code&gt;gemini-4-carbon&lt;/code&gt; and execution turns to &lt;code&gt;gemini-4-hydrogen&lt;/code&gt;."&lt;/p&gt;

&lt;p&gt;Antigravity's Orchestrator is that sentence shipped as a product: "a dynamic, bidirectional approach between Carbon and Gemini 4 Hydrogen within the evolution of a single trajectory." Carbon explores dependencies, resolves ambiguity and plans; Hydrogen handles edits, package updates and tests; when Hydrogen gets stuck, the work returns to Carbon to repair the plan. Google reports "near-Carbon task success rates" with 24% less quota consumed and 19% faster completion on average. The benchmark is Terminal-Bench 4.0 in the launch post and 4.1 in Antigravity's post, so the version is unsettled. Orchestrator is not available through AIHubMix.&lt;/p&gt;

&lt;p&gt;The portable form:&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;Route&lt;/th&gt;
&lt;th&gt;Reason&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hard debugging and architecture&lt;/td&gt;
&lt;td&gt;Carbon high&lt;/td&gt;
&lt;td&gt;60 index, the ceiling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution turns, tool loops, tests&lt;/td&gt;
&lt;td&gt;Hydrogen high&lt;/td&gt;
&lt;td&gt;51 at $1.87, 8.3 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High-volume text&lt;/td&gt;
&lt;td&gt;Hydrogen medium&lt;/td&gt;
&lt;td&gt;41 at $0.80 per task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image, audio, video or PDF input&lt;/td&gt;
&lt;td&gt;Any of the three&lt;/td&gt;
&lt;td&gt;all list the same inputs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Responses or Anthropic Messages clients&lt;/td&gt;
&lt;td&gt;Carbon or Argon&lt;/td&gt;
&lt;td&gt;both list four protocols&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Planning and execution in one trajectory&lt;/td&gt;
&lt;td&gt;Carbon plus Hydrogen&lt;/td&gt;
&lt;td&gt;Google's routing advice&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;"Hard debugging" is not a precise threshold. The honest test is whether Hydrogen &lt;code&gt;high&lt;/code&gt; or &lt;code&gt;xhigh&lt;/code&gt; passes your evaluation, not whether the task sounds hard.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is documented, what is not
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The AA figures are a single live snapshot: v5.0.1, 78 ranked models, 2026-11-13T02:40Z. They drift; re-check before routing production traffic.&lt;/li&gt;
&lt;li&gt;The snapshot covers Argon at &lt;code&gt;high&lt;/code&gt; only, so Argon's other effort levels cannot be compared with Carbon or Hydrogen from these figures.&lt;/li&gt;
&lt;li&gt;AA task costs are measured at standard list prices, not AIHubMix bills.&lt;/li&gt;
&lt;li&gt;Vendor benchmarks are self-reported. Hydrogen's model card reports Terminal-Bench 4.1; Carbon's reports Terminal-Bench 4.0. Do not compare the two rows directly.&lt;/li&gt;
&lt;li&gt;AIHubMix's protocol coverage differs by model. All three list multimodal input; Hydrogen is chat-completions-only in the current documentation.&lt;/li&gt;
&lt;li&gt;Hydrogen is a "short-term generally available (GA) release subject to a minimum 45-day retirement notice policy." Carbon and Argon have no listed shutdown date.&lt;/li&gt;
&lt;li&gt;No live tests were run for this post.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the Gemini 4 Hydrogen series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If the routing question starts with leaving Gemini 3.8 Flash, the first post covers the launch, the price change and the benchmark trade-offs: &lt;a href="https://dev.to/aihubmix/gemini-4-hydrogen-vs-gemini-38-flash-is-the-upgrade-worth-it-1j5g"&gt;Gemini 4 Hydrogen vs Gemini 3.8 Flash: Is the Upgrade Worth It?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If you are choosing an effort setting before committing to a tier, the second post measures all four Hydrogen levels: &lt;a href="https://dev.to/aihubmix/gemini-4-hydrogen-thinking-levels-low-medium-high-xhigh-958"&gt;Gemini 4 Hydrogen Thinking Levels: low, medium, high, xhigh&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Google AI Studio, &lt;a href="https://aistudio.google.com/docs/whats-new-gemini-4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen: what's new&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google, &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/4-carbon" rel="noopener noreferrer"&gt;Gemini 4 Carbon model page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google, &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/4-argon" rel="noopener noreferrer"&gt;Gemini 4 Argon model page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google Antigravity, &lt;a href="https://antigravity.google/blog/gemini-4-hydrogen-in-google-antigravity/" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen and Orchestrator&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Artificial Analysis, &lt;a href="https://artificialanalysis.ai/models/gemini-4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen&lt;/a&gt; — live snapshot 2026-11-13T02:40Z, Intelligence Index v5.0.1&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>gemini</category>
      <category>api</category>
    </item>
    <item>
      <title>Gemini 4 Hydrogen Thinking Levels: low, medium, high, xhigh</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Fri, 13 Nov 2026 08:51:25 +0000</pubDate>
      <link>https://dev.to/aihubmix/gemini-4-hydrogen-thinking-levels-low-medium-high-xhigh-958</link>
      <guid>https://dev.to/aihubmix/gemini-4-hydrogen-thinking-levels-low-medium-high-xhigh-958</guid>
      <description>&lt;p&gt;&lt;a href="https://aihubmix.com/model/gemini-4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen&lt;/a&gt; exposes four thinking levels, and the request surface is narrower than the list suggests. &lt;code&gt;thinking_level&lt;/code&gt; accepts &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt; and &lt;code&gt;xhigh&lt;/code&gt;; the default is &lt;code&gt;high&lt;/code&gt;. &lt;code&gt;thinking_budget&lt;/code&gt; is not an alternative: on any Gemini 4 model it returns &lt;code&gt;400: INVALID_ARGUMENT&lt;/code&gt;. &lt;code&gt;MINIMAL&lt;/code&gt; is rejected, custom sampling values are ignored, and AIHubMix does not document how to set a thinking level for any Gemini 4 model.&lt;/p&gt;

&lt;p&gt;The spread is wide enough to plan around. On &lt;a href="https://artificialanalysis.ai/models/gemini-4-hydrogen" rel="noopener noreferrer"&gt;Artificial Analysis's live measurements&lt;/a&gt;, the same model scores 27 at &lt;code&gt;low&lt;/code&gt;, 41 at &lt;code&gt;medium&lt;/code&gt;, 51 at &lt;code&gt;high&lt;/code&gt; and 54 at &lt;code&gt;xhigh&lt;/code&gt; — 27 index points inside one model ID. &lt;code&gt;high&lt;/code&gt; is the knee: the last step where the quality gain is large relative to the added cost. &lt;code&gt;xhigh&lt;/code&gt; is for work where &lt;code&gt;high&lt;/code&gt; fails.&lt;/p&gt;

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

&lt;p&gt;A working request needs the AIHubMix base URL, a key in &lt;code&gt;AIHUBMIX_API_KEY&lt;/code&gt; and the model ID &lt;code&gt;gemini-4-hydrogen&lt;/code&gt;. The documented route is &lt;code&gt;POST https://aihubmix.com/v1/chat/completions&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The parameter is &lt;code&gt;thinking_level&lt;/code&gt; in snake_case. Google's Python sample sets it inside &lt;code&gt;thinking_config&lt;/code&gt;; the Node sample nests it under &lt;code&gt;thinkingConfig&lt;/code&gt; in camelCase. The model page lists the values as &lt;code&gt;LOW&lt;/code&gt;, &lt;code&gt;MEDIUM&lt;/code&gt;, &lt;code&gt;HIGH&lt;/code&gt; and &lt;code&gt;XHIGH&lt;/code&gt;; the &lt;a href="https://aistudio.google.com/docs/whats-new-gemini-4-hydrogen" rel="noopener noreferrer"&gt;release notes&lt;/a&gt; write them lowercase. Use the SDK's enum or the documented string rather than hand-typing a case variant.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;MINIMAL&lt;/code&gt; is not part of the set. The &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/thinking" rel="noopener noreferrer"&gt;Gemini 4 thinking documentation&lt;/a&gt; says MINIMAL is "not supported on Gemini 4 models," and there is no documented off switch for thinking on this model.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Surface&lt;/th&gt;
&lt;th&gt;Documented behaviour&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;thinking_level&lt;/td&gt;
&lt;td&gt;low, medium, high, xhigh; default high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;thinking_budget&lt;/td&gt;
&lt;td&gt;400: INVALID_ARGUMENT on any Gemini 4 model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;thinking_level with thinking_budget&lt;/td&gt;
&lt;td&gt;error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;thinking_level=MINIMAL&lt;/td&gt;
&lt;td&gt;not supported; Hydrogen rejects it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;temperature, top_p, top_k&lt;/td&gt;
&lt;td&gt;ignored; fixed at 1.0, 0.95 and 64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;max_output_tokens&lt;/td&gt;
&lt;td&gt;caps thinking and output together&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The shape AIHubMix documents leaves the level out:&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&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="s2"&gt;"https://aihubmix.com/v1"&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="s2"&gt;"AIHUBMIX_API_KEY"&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="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"gemini-4-hydrogen"&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="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Summarise this stack trace and name the likely fix."&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="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;16384&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="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;Whether &lt;code&gt;thinking_level&lt;/code&gt; passes through the gateway is not documented. Verify it with a small request before it goes into a production client.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed in the family
&lt;/h2&gt;

&lt;p&gt;Google's release notes put it plainly: "The model defaults to &lt;code&gt;high&lt;/code&gt; and introduces &lt;code&gt;xhigh&lt;/code&gt;." The same release notes say the model "rejects &lt;code&gt;minimal&lt;/code&gt; with an error."&lt;/p&gt;

&lt;p&gt;That is two changes against &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-8-flash" rel="noopener noreferrer"&gt;Gemini 3.8 Flash&lt;/a&gt;, which defaults to &lt;code&gt;medium&lt;/code&gt; and stops at &lt;code&gt;high&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aihubmix.com/model/gemini-4-carbon" rel="noopener noreferrer"&gt;Gemini 4 Carbon&lt;/a&gt; and Argon did not move. Both support &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt; and &lt;code&gt;high&lt;/code&gt;, with &lt;code&gt;medium&lt;/code&gt; as the default. Hydrogen is the only Gemini 4 model with a setting above &lt;code&gt;high&lt;/code&gt;.&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;Levels&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;Gemini 4 Hydrogen&lt;/td&gt;
&lt;td&gt;low, medium, high, xhigh&lt;/td&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 4 Carbon&lt;/td&gt;
&lt;td&gt;low, medium, high&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 4 Argon&lt;/td&gt;
&lt;td&gt;low, medium, high&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What the four levels score
&lt;/h2&gt;

&lt;p&gt;Artificial Analysis measured all four levels. The run is Intelligence Index v5.0.1, 78 ranked models, accessed at 2026-11-13T02:40Z, at standard list prices. These are AA task costs, not AIHubMix bills.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Level&lt;/th&gt;
&lt;th&gt;AA rank&lt;/th&gt;
&lt;th&gt;AA Index&lt;/th&gt;
&lt;th&gt;$/task&lt;/th&gt;
&lt;th&gt;Min/task&lt;/th&gt;
&lt;th&gt;First answer token&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;60&lt;/td&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;0.29&lt;/td&gt;
&lt;td&gt;1.3&lt;/td&gt;
&lt;td&gt;5.71 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;39&lt;/td&gt;
&lt;td&gt;41&lt;/td&gt;
&lt;td&gt;0.80&lt;/td&gt;
&lt;td&gt;3.7&lt;/td&gt;
&lt;td&gt;11.80 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;51&lt;/td&gt;
&lt;td&gt;1.87&lt;/td&gt;
&lt;td&gt;8.3&lt;/td&gt;
&lt;td&gt;18.89 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;xhigh&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;3.16&lt;/td&gt;
&lt;td&gt;13.5&lt;/td&gt;
&lt;td&gt;37.77 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The step sizes are the useful part:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;low&lt;/code&gt; to &lt;code&gt;medium&lt;/code&gt;: +14 index points, +$0.51 per task, +2.4 minutes, +6.1 seconds to the first token.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;medium&lt;/code&gt; to &lt;code&gt;high&lt;/code&gt;: +10 index points, +$1.07 per task, +4.6 minutes, +7.1 seconds to the first token.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;high&lt;/code&gt; to &lt;code&gt;xhigh&lt;/code&gt;: +3 index points, +$1.29 per task, +5.2 minutes, +18.9 seconds to the first token.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;high&lt;/code&gt; is the knee. It is the last step where the quality gain is large relative to the added bill; &lt;code&gt;xhigh&lt;/code&gt; is the step where the first-token wait nearly doubles for a small index gain. That does not make &lt;code&gt;xhigh&lt;/code&gt; a bad setting. It makes it a setting for tasks where &lt;code&gt;high&lt;/code&gt; fails, which is how Google describes it.&lt;/p&gt;

&lt;p&gt;For context in the same snapshot: Carbon high scores 60 at $5.48 per task and 28.1 minutes, Carbon medium 58 at $4.68, Carbon low 54 at $5.22, and Argon high 50 at $4.97 and 30.6 minutes. Hydrogen &lt;code&gt;xhigh&lt;/code&gt; matches Carbon low's 54 at 39.5% lower cost per task ($3.16 against $5.22), though its first token takes 37.77 seconds against 13.61. Hydrogen &lt;code&gt;high&lt;/code&gt; beats Argon high by one index point at 62.4% lower cost per task.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where requests fail
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A &lt;code&gt;thinking_budget&lt;/code&gt; fails the request.&lt;/strong&gt; Any Gemini 4 model returns &lt;code&gt;400: INVALID_ARGUMENT&lt;/code&gt;, and setting both &lt;code&gt;thinking_level&lt;/code&gt; and &lt;code&gt;thinking_budget&lt;/code&gt; also returns an error. A client library that sends a budget by default fails the request before the model runs. These are Google's documented responses; no live test was run against AIHubMix for this post.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;MINIMAL&lt;/code&gt; does not fall back.&lt;/strong&gt; Hydrogen rejects it with an error, so a config that treats MINIMAL as "off" breaks rather than degrades.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sampling values are ignored.&lt;/strong&gt; &lt;code&gt;temperature&lt;/code&gt;, &lt;code&gt;top_p&lt;/code&gt; and &lt;code&gt;top_k&lt;/code&gt; are accepted and discarded; the fixed defaults are temperature 1.0, topP 0.95 and topK 64. A prompt tuned against a low temperature does not behave the same way after migration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Long output hits a hop limit.&lt;/strong&gt; A synchronous request generates up to 65,536 tokens per hop, streaming or not. Longer output needs background execution or continuation tokens, and &lt;code&gt;max_output_tokens&lt;/code&gt; caps combined thinking and output. If &lt;code&gt;background=true&lt;/code&gt; is set without a &lt;code&gt;max_output_tokens&lt;/code&gt;, the server stops after 65,536 tokens. Google's suggested long-decode budgets are 131,072 or 262,144, up to 1,048,576 minus the input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;xhigh&lt;/code&gt; can overthink.&lt;/strong&gt; Google says "Using &lt;code&gt;xhigh&lt;/code&gt; increases latency and token use and can cause overthinking on simpler prompts," and the measured figures show the shape of that: $3.16 per task, 13.5 minutes and a 37.77-second first-token wait.&lt;/p&gt;

&lt;h2&gt;
  
  
  How thinking becomes the bill
&lt;/h2&gt;

&lt;p&gt;On Google's rate card, Hydrogen costs $1.50 per million input tokens, $7.50 per million output tokens and $0.075 per million cached input tokens. Output includes thinking tokens, so the level changes the bill through the tokens it writes, not through a surcharge on the level name.&lt;/p&gt;

&lt;p&gt;Three rules matter at migration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The default changed.&lt;/strong&gt; Gemini 3.8 Flash defaulted to &lt;code&gt;medium&lt;/code&gt;; Hydrogen defaults to &lt;code&gt;high&lt;/code&gt;. A workload that never set a level spends more output tokens per turn after migration, at the same per-token price. That is a budget change disguised as a model swap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caching is implicit only.&lt;/strong&gt; Hydrogen supports implicit caching with a 4,096-token minimum and a 95% discount on cache hits; explicit caching is not supported. Google's enterprise page says "cache writes are billed at 1.25x the standard input token price by default." That is Google's billing wording; AIHubMix's cache billing is not documented for this model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verbosity is part of the bill.&lt;/strong&gt; Artificial Analysis describes Hydrogen as "very verbose": the &lt;code&gt;xhigh&lt;/code&gt; run generated 304 million output tokens to complete the index, rank #76 of 77, against a median of 72.8 million. Output is billed at $7.50 per million. A higher level does not just think longer; it produces more billable tokens.&lt;/p&gt;

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

&lt;p&gt;AIHubMix's documented route for Hydrogen is &lt;code&gt;POST https://aihubmix.com/v1/chat/completions&lt;/code&gt; with &lt;code&gt;model="gemini-4-hydrogen"&lt;/code&gt;. The model page lists text, image, audio, video and PDF input with text output; &lt;code&gt;llms.txt&lt;/code&gt; still carries an older text-only line, so treat the page as the newer source. The capability flags for tool use, structured output and reasoning are "not published." The model is not in the model index generated on 2026-11-11, and no protocol schema is published.&lt;/p&gt;

&lt;p&gt;The gap is specific: AIHubMix does not document how to set a thinking level for any Gemini 4 model. Its &lt;a href="https://docs.aihubmix.com/en/api/Gemini-Guides" rel="noopener noreferrer"&gt;Gemini guide&lt;/a&gt; covers &lt;code&gt;reasoning_effort&lt;/code&gt; for Gemini 2.5-era models, not &lt;code&gt;thinking_level&lt;/code&gt; or &lt;code&gt;xhigh&lt;/code&gt; for Gemini 4. Do not assume that either parameter passes through the gateway, and do not assume the default observed on Google's API is the default you get on AIHubMix.&lt;/p&gt;

&lt;p&gt;If level control is a hard requirement, call Google's API directly or verify the gateway's behaviour with a small request before routing production traffic. The &lt;a href="https://aihubmix.com/compare/gemini-4-carbon/gemini-4-hydrogen" rel="noopener noreferrer"&gt;AIHubMix compare page&lt;/a&gt; is a cost-side check while you decide. No live test was run for this post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting points by workload
&lt;/h2&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 and why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Fast chat, routing, classification&lt;/td&gt;
&lt;td&gt;medium, test low; low scores 27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Interactive coding, UI prototyping&lt;/td&gt;
&lt;td&gt;high; AA's medium is 41&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent execution, tool loops&lt;/td&gt;
&lt;td&gt;high; xhigh only if stuck&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hard debugging, architecture, planning&lt;/td&gt;
&lt;td&gt;xhigh or Carbon; 3 points for 69% more&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High-volume batch after evaluation&lt;/td&gt;
&lt;td&gt;low or medium; cheapest, but 27/41 index&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Strict latency budget under 15 seconds&lt;/td&gt;
&lt;td&gt;medium or low; high waits 18.89 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are starting points, not routing rules. The right level is the lowest one that passes your own evaluation, and Google's advice is to run that evaluation at all four levels with a high &lt;code&gt;max_output_tokens&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the Gemini 4 Hydrogen series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If the question is whether Hydrogen is worth the move from Gemini 3.8 Flash at all, the first post covers the launch, the price change and the benchmark trade-offs: &lt;a href="https://dev.to/aihubmix/gemini-4-hydrogen-vs-gemini-38-flash-is-the-upgrade-worth-it-1j5g"&gt;Gemini 4 Hydrogen vs Gemini 3.8 Flash: Is the Upgrade Worth It?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If the question is Hydrogen against the rest of the family, the third post puts Carbon, Hydrogen and Argon side by side with prices, latency and a workload table: &lt;a href="https://dev.to/aihubmix/gemini-4-carbon-vs-hydrogen-vs-argon-which-model-for-which-job-13mo"&gt;Gemini 4 Carbon vs Hydrogen vs Argon: Which Model for Which Job?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Google AI Studio, &lt;a href="https://aistudio.google.com/docs/whats-new-gemini-4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen: what's new&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google, &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/thinking" rel="noopener noreferrer"&gt;Gemini 4 thinking&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google, &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen model page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google AI Studio, &lt;a href="https://aistudio.google.com/docs/pricing" rel="noopener noreferrer"&gt;Gemini API pricing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Artificial Analysis, &lt;a href="https://artificialanalysis.ai/models/gemini-4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen&lt;/a&gt; — live snapshot 2026-11-13T02:40Z, Intelligence Index v5.0.1&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>gemini</category>
      <category>api</category>
    </item>
    <item>
      <title>Gemini 4 Hydrogen vs Gemini 3.8 Flash: Is the Upgrade Worth It?</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Fri, 13 Nov 2026 08:51:21 +0000</pubDate>
      <link>https://dev.to/aihubmix/gemini-4-hydrogen-vs-gemini-38-flash-is-the-upgrade-worth-it-1j5g</link>
      <guid>https://dev.to/aihubmix/gemini-4-hydrogen-vs-gemini-38-flash-is-the-upgrade-worth-it-1j5g</guid>
      <description>&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; migrating from Gemini 3.8 Flash to Gemini 4 Hydrogen cuts the measured cost per completed Artificial Analysis task from $7.77 to $1.87, 75.9% lower, while raising the index from 31 to 51. The token price doubles. The engineering problem is everything else.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aihubmix.com/model/gemini-4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen&lt;/a&gt; is not a Flash refresh. Its &lt;a href="https://deepmind.google/models/model-cards/gemini-4-hydrogen/" rel="noopener noreferrer"&gt;model card&lt;/a&gt; says: "Gemini 4 Hydrogen is adapted from Gemini 4 Carbon." Google recommends it as the upgrade from &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-8-flash" rel="noopener noreferrer"&gt;Gemini 3.8 Flash&lt;/a&gt; and earlier Gemini 3 and 2.5 models. It inherits a long-decode output path, adds a fourth thinking level called &lt;code&gt;xhigh&lt;/code&gt;, and defaults to &lt;code&gt;high&lt;/code&gt; rather than 3.8 Flash's &lt;code&gt;medium&lt;/code&gt;. On AIHubMix its protocol surface is narrower than Carbon's, and Google calls it a short-term GA release on a 45-day retirement notice policy. A pipeline that changes only the model ID will usually spend more per turn and can still hit documented gaps in protocol support.&lt;/p&gt;

&lt;p&gt;Hydrogen went generally available on 2026-11-12, according to the Gemini API changelog; the model card is dated the same day. Google's &lt;a href="https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-hydrogen/" rel="noopener noreferrer"&gt;launch post&lt;/a&gt; describes it as the daily driver for agentic workflows and positions Carbon and Argon as the models built for deep, long-horizon reasoning.&lt;/p&gt;

&lt;p&gt;Below: what changes at the API boundary, the request shape, the failure modes, the measured and vendor-published numbers, and what remains unverified.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes at the API boundary
&lt;/h2&gt;

&lt;p&gt;On Google's API, both models take a 1,048,576-token context, accept text, image, audio and video input, and offer a free tier. The differences that reach code are output headroom, the default thinking level, the gateway's documented protocols and caching.&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;Gemini 4 Hydrogen&lt;/th&gt;
&lt;th&gt;Gemini 3.8 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;1,048,576 tokens&lt;/td&gt;
&lt;td&gt;1,048,576 tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maximum output&lt;/td&gt;
&lt;td&gt;1,048,576 tokens via long decode&lt;/td&gt;
&lt;td&gt;65,536 tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Synchronous output&lt;/td&gt;
&lt;td&gt;65,536 tokens per hop, streaming or not&lt;/td&gt;
&lt;td&gt;65,536 tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Thinking levels&lt;/td&gt;
&lt;td&gt;low, medium, high (default), xhigh&lt;/td&gt;
&lt;td&gt;low, medium (default), high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input modalities&lt;/td&gt;
&lt;td&gt;text, image, audio, video, PDF, Office&lt;/td&gt;
&lt;td&gt;text, image, audio, video, PDF&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free tier&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;Caching&lt;/td&gt;
&lt;td&gt;implicit only, 4,096-token minimum&lt;/td&gt;
&lt;td&gt;implicit and explicit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Hydrogen's 65,536-token synchronous hop applies in both streaming and non-streaming mode. Carbon and Argon allow 65,536 only when streaming and 32,768 otherwise. Beyond a hop, Hydrogen uses the same background or continuation-token path as the rest of the Gemini 4 family and can reach 1,048,576 tokens minus the input.&lt;/p&gt;

&lt;p&gt;The default matters more than the table suggests. Hydrogen spends more thinking tokens per turn than a model defaulting to medium, and output tokens include thinking. A workload migrated without setting a level will usually spend more per turn than it did on 3.8 Flash, even before the per-token price difference. Dropping to medium to hold the old cost is not free: Hydrogen medium scores 41 on AA and low 27, against 51 at high, so the quality loss is larger than the token saving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Request shape
&lt;/h2&gt;

&lt;p&gt;The documented route on AIHubMix is the OpenAI-compatible chat-completions endpoint. The model page lists two providers, VertexAI and Google AI Studio, with automatic retry. The sample assumes the OpenAI Python SDK and an &lt;code&gt;AIHUBMIX_API_KEY&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="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&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="s2"&gt;"https://aihubmix.com/v1"&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="s2"&gt;"AIHUBMIX_API_KEY"&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="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"gemini-4-hydrogen"&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="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Summarise this incident report and list the follow-ups."&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="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;16384&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="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;The endpoint is &lt;code&gt;POST /v1/chat/completions&lt;/code&gt;. AIHubMix lists text, image, audio, video and PDF input for Hydrogen, publishes no capability flags for reasoning, tool use or structured output, and its &lt;a href="https://docs.aihubmix.com/en/api/Gemini-Guides" rel="noopener noreferrer"&gt;Gemini guide&lt;/a&gt; covers Gemini 2.5-era thinking controls rather than Gemini 4 levels. Do not assume Google's &lt;code&gt;thinking_level&lt;/code&gt; parameter or the new &lt;code&gt;xhigh&lt;/code&gt; value passes through the gateway. Keep &lt;code&gt;max_tokens&lt;/code&gt; within the 65,536 synchronous limit unless long decode is confirmed for the route. No live test was run for this post, so the sample shows the request shape rather than a verified response.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Multimodal input is now listed.&lt;/strong&gt; Google's enterprise page lists text, image, audio, video, PDF, Office and OpenDocument input. AIHubMix's model page lists text, image, audio, video and PDF with text output; its &lt;code&gt;llms.txt&lt;/code&gt; still carries an older text-only line, so treat the page as the newer source. Office and OpenDocument are not listed on the gateway page. A pipeline that sends screenshots or PDFs can migrate; one that depends on Office files should keep Carbon or Argon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The protocol surface is narrower.&lt;/strong&gt; Carbon and Argon have schema entries for Chat Completions, Responses, Anthropic Messages and native Gemini. Hydrogen has no schema entry in the 2026-11-11 model-index snapshot, and only &lt;code&gt;POST /v1/chat/completions&lt;/code&gt; is documented. Codex-style Responses clients and Claude Code-style Anthropic clients should not assume it works without a check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thinking controls may not pass through.&lt;/strong&gt; No reasoning capability flag is published, and the Gemini guide stops at 2.5-era controls. A request that relies on &lt;code&gt;thinking_level&lt;/code&gt; or &lt;code&gt;xhigh&lt;/code&gt; needs a test before it goes into a pipeline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Long output needs a confirmed route.&lt;/strong&gt; The synchronous ceiling is 65,536 tokens. The 1,048,576-token output path depends on long decode, which is unconfirmed for this gateway route. Treat it as untested.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The release is short-lived.&lt;/strong&gt; Google's enterprise documentation calls Hydrogen "a short-term generally available (GA) release subject to a minimum 45-day retirement notice policy." The deprecations page lists no shutdown date. Keep the model ID in configuration rather than in code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some platform features are absent.&lt;/strong&gt; Gemini Live API, RAG Engine, Tuning and fixed quota are marked not supported; Batch inference is supported.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Safety is mixed.&lt;/strong&gt; The model card reports better text safety than Gemini 3.8 Flash (+0.80pp text-to-text, +1.10pp multilingual) but 5.57 percentage points more unjustified refusals, particularly on multimodal prompts, and tone 0.65 points worse. These are automated evaluations, not red teaming.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measured against Gemini 3.8 Flash
&lt;/h2&gt;

&lt;p&gt;Artificial Analysis measured Hydrogen at high and Gemini 3.8 Flash at high on its live index. The snapshot is 2026-11-13T02:40Z, Intelligence Index v5.0.1, with 78 ranked models. The figures use standard list prices and are not AIHubMix bills.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model / effort&lt;/th&gt;
&lt;th&gt;AA rank&lt;/th&gt;
&lt;th&gt;AA Index&lt;/th&gt;
&lt;th&gt;$/task&lt;/th&gt;
&lt;th&gt;Min/task&lt;/th&gt;
&lt;th&gt;First answer token&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen high&lt;/td&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;51&lt;/td&gt;
&lt;td&gt;1.87&lt;/td&gt;
&lt;td&gt;8.3&lt;/td&gt;
&lt;td&gt;18.89 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen xhigh&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;3.16&lt;/td&gt;
&lt;td&gt;13.5&lt;/td&gt;
&lt;td&gt;37.77 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 3.8 Flash high&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;td&gt;7.77&lt;/td&gt;
&lt;td&gt;14.7&lt;/td&gt;
&lt;td&gt;17.53 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The comparison is matched at high, which is Hydrogen's default but not Flash's. Flash at its default medium scores 30 at $6.26 per task, so a default-vs-default comparison changes the numbers without changing the direction.&lt;/p&gt;

&lt;p&gt;Hydrogen's first answer token arrives at 18.89 seconds, about 1.4 seconds slower than Flash's 17.53, and it finishes the task in 8.3 minutes against 14.7. At &lt;code&gt;xhigh&lt;/code&gt; it scores 54 for $3.16 per task and 13.5 minutes, with the first token at 37.77 seconds. That is four points above Gemini 4 Argon high (50) and six below Carbon high (60) in the same snapshot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Price and migration arithmetic
&lt;/h2&gt;

&lt;p&gt;Official prices in USD per million tokens, from &lt;a href="https://aistudio.google.com/docs/pricing" rel="noopener noreferrer"&gt;Google's pricing page&lt;/a&gt;, accessed 2026-11-13. Hydrogen has no announced future change, and its price is flat across the full context window.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model / tier&lt;/th&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Cached input&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;When&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen Standard&lt;/td&gt;
&lt;td&gt;$1.50&lt;/td&gt;
&lt;td&gt;$0.075&lt;/td&gt;
&lt;td&gt;$7.50&lt;/td&gt;
&lt;td&gt;Now&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen Batch / Flex&lt;/td&gt;
&lt;td&gt;$0.75&lt;/td&gt;
&lt;td&gt;$0.0375&lt;/td&gt;
&lt;td&gt;$3.75&lt;/td&gt;
&lt;td&gt;Now&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hydrogen Priority&lt;/td&gt;
&lt;td&gt;$2.70&lt;/td&gt;
&lt;td&gt;$0.135&lt;/td&gt;
&lt;td&gt;$13.50&lt;/td&gt;
&lt;td&gt;Now&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 3.8 Flash Standard&lt;/td&gt;
&lt;td&gt;$0.75&lt;/td&gt;
&lt;td&gt;$0.075&lt;/td&gt;
&lt;td&gt;$3.75&lt;/td&gt;
&lt;td&gt;Through 2026-12-31&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 3.8 Flash Standard&lt;/td&gt;
&lt;td&gt;$1.50&lt;/td&gt;
&lt;td&gt;$0.15&lt;/td&gt;
&lt;td&gt;$7.50&lt;/td&gt;
&lt;td&gt;From 2027-01-01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 4 Carbon / Argon&lt;/td&gt;
&lt;td&gt;$2.00&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;td&gt;$10.00&lt;/td&gt;
&lt;td&gt;Through 2026-11-30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 4 Carbon / Argon&lt;/td&gt;
&lt;td&gt;$4.00&lt;/td&gt;
&lt;td&gt;$0.20&lt;/td&gt;
&lt;td&gt;$20.00&lt;/td&gt;
&lt;td&gt;From 2026-12-01&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two consequences follow. Hydrogen's input and output rates are exactly Gemini 3.8 Flash's standard rates from 2027-01-01, so the "twice as expensive" gap disappears on New Year's Day. Against Carbon and Argon, Hydrogen is 25% cheaper per token through November 30 and 62.5% cheaper once their prices double on December 1.&lt;/p&gt;

&lt;p&gt;AIHubMix lists Hydrogen at $1.50, $7.50 and $0.075, matching Google's standard price. The free tier is Google's, not the gateway's: AIHubMix is a paid route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Google's benchmark card: seven wins, three losses
&lt;/h2&gt;

&lt;p&gt;Google's model card is vendor-reported, published on 2026-11-12, and built around two rivals rather than the previous Gemini model. Hydrogen leads 7 of the 10 listed comparisons. The three losses are the useful rows.&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;Hydrogen&lt;/th&gt;
&lt;th&gt;Claude Sonnet 5.5&lt;/th&gt;
&lt;th&gt;GPT-6.1 Terra&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Terminal-Bench 4.1&lt;/td&gt;
&lt;td&gt;57.0%&lt;/td&gt;
&lt;td&gt;63.9%&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OSWorld-2.1&lt;/td&gt;
&lt;td&gt;77.6%&lt;/td&gt;
&lt;td&gt;83.9%&lt;/td&gt;
&lt;td&gt;74.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Terminal-Bench-Science 0.1&lt;/td&gt;
&lt;td&gt;51.4%&lt;/td&gt;
&lt;td&gt;59.9%&lt;/td&gt;
&lt;td&gt;58.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Terminal-Bench 4.1 is marked "cheating-adjusted" in the model card. Sonnet 5.5 wins all three. Those are the rows where a more expensive model still buys something. &lt;a href="https://platform.claude.com/docs/en/about-claude/pricing" rel="noopener noreferrer"&gt;Anthropic's price list&lt;/a&gt; has Sonnet 5.5 at $2 input and $10 output, so Hydrogen is 25% cheaper per token and wins most of the card while losing those rows.&lt;/p&gt;

&lt;p&gt;Do not put Carbon's numbers beside this table. Carbon's model card reports Terminal-Bench 4.0 at 65.2; Hydrogen's card reports Terminal-Bench 4.1 at 57.0. Different benchmark versions, different comparison sets, no valid column.&lt;/p&gt;

&lt;p&gt;The launch post adds claims the model card does not repeat: Hydrogen finishes tasks "2.5 times faster at its high default setting" than Gemini 3.8 Flash and cuts fabricated claims by "more than 5x." It also claims #5 on Agent Arena, first place on the Vals Tax Agent Bench (52.3%) and a tie for first on the Vals Legal Research Bench (55.8%). These are vendor-reported and not independently reproduced here.&lt;/p&gt;

&lt;h2&gt;
  
  
  What remains unverified
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No live test was run for this post. The request sample shows shape, not a response.&lt;/li&gt;
&lt;li&gt;AIHubMix publishes no reasoning, tool-use or structured-output capability flag for Hydrogen, and does not document &lt;code&gt;thinking_level&lt;/code&gt; or &lt;code&gt;xhigh&lt;/code&gt; pass-through.&lt;/li&gt;
&lt;li&gt;The long-decode path to 1,048,576 output tokens is not confirmed for the gateway route.&lt;/li&gt;
&lt;li&gt;Image, audio, video and PDF input are listed on AIHubMix's Hydrogen page; Office and OpenDocument are not.&lt;/li&gt;
&lt;li&gt;Responses and Anthropic Messages support is not documented; only &lt;code&gt;POST /v1/chat/completions&lt;/code&gt; is.&lt;/li&gt;
&lt;li&gt;Artificial Analysis figures use standard list prices, not AIHubMix bills.&lt;/li&gt;
&lt;li&gt;The vendor claims (2.5x faster, more than 5x fewer fabricated claims, Agent Arena #5, Vals Tax 52.3%, Vals Legal 55.8%) have not been independently reproduced.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Migration checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Keep the model ID in configuration. Google's 45-day retirement notice policy makes the string a deployment variable.&lt;/li&gt;
&lt;li&gt;Set the thinking level explicitly. The default moved from medium to high, and output tokens include thinking, so an inherited default usually costs more per turn.&lt;/li&gt;
&lt;li&gt;Keep &lt;code&gt;max_tokens&lt;/code&gt; at or below 65,536 until long decode is confirmed for the route.&lt;/li&gt;
&lt;li&gt;Test multimodal input on your own traffic. Image, audio, video and PDF input are listed for Hydrogen on AIHubMix; Office and OpenDocument are not, so keep those on Carbon or Argon.&lt;/li&gt;
&lt;li&gt;Check the client protocol. Only &lt;code&gt;POST /v1/chat/completions&lt;/code&gt; is documented; Responses and Anthropic Messages clients need a test.&lt;/li&gt;
&lt;li&gt;Run 20 to 50 real requests on Hydrogen high and Gemini 3.8 Flash at its default, and compare cost per completed task rather than cost per token.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;a href="https://aihubmix.com/compare/gemini-4-carbon/gemini-4-hydrogen" rel="noopener noreferrer"&gt;AIHubMix compare page&lt;/a&gt; covers the Carbon side of the decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the Gemini 4 Hydrogen series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If the next question is which thinking level to run, the second post measures all four levels on the same index and shows where the ladder stops paying: &lt;a href="https://dev.to/aihubmix/gemini-4-hydrogen-thinking-levels-low-medium-high-xhigh-958"&gt;Gemini 4 Hydrogen Thinking Levels: low, medium, high, xhigh&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If the next question is whether to run Hydrogen beside Carbon or Argon, the third post sets the three models side by side with prices, latency and a workload table: &lt;a href="https://dev.to/aihubmix/gemini-4-carbon-vs-hydrogen-vs-argon-which-model-for-which-job-13mo"&gt;Gemini 4 Carbon vs Hydrogen vs Argon: Which Model for Which Job?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Google, &lt;a href="https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-hydrogen/" rel="noopener noreferrer"&gt;Introducing Gemini 4 Hydrogen&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google AI Studio, &lt;a href="https://aistudio.google.com/docs/whats-new-gemini-4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen: what's new&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google DeepMind, &lt;a href="https://deepmind.google/models/model-cards/gemini-4-hydrogen/" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen model card&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;AIHubMix, &lt;a href="https://aihubmix.com/model/gemini-4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Artificial Analysis, &lt;a href="https://artificialanalysis.ai/models/gemini-4-hydrogen" rel="noopener noreferrer"&gt;Gemini 4 Hydrogen&lt;/a&gt; — live snapshot 2026-11-13T02:40Z, Intelligence Index v5.0.1&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>gemini</category>
      <category>api</category>
    </item>
    <item>
      <title>Seedream 5.5 vs GPT Image 2.6: editing controls before integration</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Thu, 12 Nov 2026 15:00:17 +0000</pubDate>
      <link>https://dev.to/aihubmix/seedream-55-vs-gpt-image-26-editing-controls-before-integration-bfk</link>
      <guid>https://dev.to/aihubmix/seedream-55-vs-gpt-image-26-editing-controls-before-integration-bfk</guid>
      <description>&lt;p&gt;&lt;strong&gt;GPT Image 2.6 Sunburst (max) has the stronger published general editing-preference result.&lt;/strong&gt; GPT is also the first candidate for schema-documented region controls. Consider &lt;a href="https://aihubmix.com/model/doubao-seedream-5-5" rel="noopener noreferrer"&gt;Seedream 5.5&lt;/a&gt; for successive natural-language revisions, but its vendor demonstration is not comparative proof.&lt;/p&gt;

&lt;p&gt;Our engineering problem is narrower: change a red mug to cobalt blue and replace a price label without disturbing the ad. No primary comparative test reviewed settles that task. We ran no generation requests; the &lt;a href="https://aihubmix.com/compare/doubao-seedream-5-5/gpt-image-2.6-sunburst" rel="noopener noreferrer"&gt;AIHubMix comparison page&lt;/a&gt; is navigation, not evidence of a task or equal-setting cost winner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Specify acceptance before requests
&lt;/h2&gt;

&lt;p&gt;Start with an owned 2048×2048 PNG. Require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A cobalt-blue mug with unchanged geometry and material appearance.&lt;/li&gt;
&lt;li&gt;Exactly &lt;code&gt;US$19.99&lt;/code&gt;, with the label's position and shape preserved.&lt;/li&gt;
&lt;li&gt;Unchanged logo, other text, shadows, props, background, and crop, inspected at full resolution.&lt;/li&gt;
&lt;li&gt;Each accepted intermediate image checked against the original if successive revisions matter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are proposed checks, not results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate benchmark variants from workflow evidence
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://seed.bytedance.com/en/blog/more-realistic-images-more-stable-editing-across-100-rounds-introducing-seedream-5-5" rel="noopener noreferrer"&gt;ByteDance's November 9, 2026 launch post&lt;/a&gt; demonstrates 100 successive edits and claims better preservation outside edited areas. It is vendor evidence, not an independent reproduction. Its named external comparators are GPT Image 2.5 Sunburst and Nano Banana 2.1—not GPT Image 2.6.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://artificialanalysis.ai/image/leaderboard/editing" rel="noopener noreferrer"&gt;AA-Image-Editing v2.1&lt;/a&gt; measures blind human pairwise preferences for outputs using the same source image and instruction. Overall editing snapshot: &lt;strong&gt;2026-11-12 06:24:03 UTC&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model variant&lt;/th&gt;
&lt;th&gt;Rank&lt;/th&gt;
&lt;th&gt;Elo&lt;/th&gt;
&lt;th&gt;95% CI&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GPT Image 2.6 Sunburst (max)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1210&lt;/td&gt;
&lt;td&gt;1197–1223&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Seedream 5.5&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;1159&lt;/td&gt;
&lt;td&gt;1145–1173&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This establishes neither exact-task success nor a 100-revision winner. We infer no statistical significance from these intervals alone. Default settings and the &lt;code&gt;high&lt;/code&gt; example below cannot inherit the &lt;code&gt;(max)&lt;/code&gt; result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspect the gateway contract
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://aihubmix.com/call/schema/models/doubao-seedream-5-5/endpoints" rel="noopener noreferrer"&gt;Seedream schema&lt;/a&gt; and &lt;a href="https://aihubmix.com/call/schema/models/gpt-image-2.6-sunburst/endpoints" rel="noopener noreferrer"&gt;GPT schema&lt;/a&gt;, inspected November 12, 2026, document &lt;code&gt;POST /ai/v1/images/generations&lt;/code&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Control&lt;/th&gt;
&lt;th&gt;Seedream 5.5&lt;/th&gt;
&lt;th&gt;GPT Image 2.6 Sunburst&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Reference input&lt;/td&gt;
&lt;td&gt;image / images&lt;/td&gt;
&lt;td&gt;image / images&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Region guidance&lt;/td&gt;
&lt;td&gt;Not exposed&lt;/td&gt;
&lt;td&gt;mask or markup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Quality selector&lt;/td&gt;
&lt;td&gt;Not exposed&lt;/td&gt;
&lt;td&gt;Top-level quality&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Planning control&lt;/td&gt;
&lt;td&gt;Not exposed&lt;/td&gt;
&lt;td&gt;complexity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Background selector&lt;/td&gt;
&lt;td&gt;Not exposed&lt;/td&gt;
&lt;td&gt;extra.background&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;GPT lists top-level &lt;code&gt;quality&lt;/code&gt;: &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;, &lt;code&gt;max&lt;/code&gt;, &lt;code&gt;auto&lt;/code&gt;. Deprecated &lt;code&gt;extra.quality&lt;/code&gt; is overridden by it. Separate &lt;code&gt;complexity&lt;/code&gt; lists &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;. Allowed values depend on the model; acceptance of every value was not verified.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;markup&lt;/code&gt; is a transparent PNG annotation layer matching the first source image's dimensions; it cannot accompany &lt;code&gt;mask&lt;/code&gt;. These are documented controls, not tested fidelity guarantees: a mask does not prove unselected pixels remain unchanged.&lt;/p&gt;

&lt;p&gt;Seedream also exposes no &lt;code&gt;layer_decomposition&lt;/code&gt; here. Missing gateway fields do not prove model-level inability or imply unsupported fields pass through. ByteDance describes native full and partial transparency, but PNG alone proves no alpha output through this route. GPT documents &lt;code&gt;extra.background="transparent"&lt;/code&gt; with PNG or WebP; inspect actual alpha when required. Neither output was verified.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calculate costs without inventing usage
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developers.openai.com/api/docs/models/gpt-image-2.6-sunburst" rel="noopener noreferrer"&gt;OpenAI's official rates&lt;/a&gt; are USD per million tokens: &lt;strong&gt;$5 text input, $8 image input, $30 image output&lt;/strong&gt;, not a fixed image price.&lt;/p&gt;

&lt;p&gt;Hypothetically, 1,000 text-input, 1,000 uncached image-input, and 2,000 image-output tokens cost &lt;strong&gt;$0.005 + $0.008 + $0.060 = $0.073&lt;/strong&gt;. This uses uncached official token rates and is not measured usage, an AIHubMix quote, or a resolution/&lt;code&gt;high&lt;/code&gt;/&lt;code&gt;max&lt;/code&gt; estimate; retries are excluded. No complete official Seedream 5.5 rate table was found in the reviewed material, so no equal-setting cost winner or savings ratio follows. Compare accepted-edit costs, including retries, after requirements and usage are known.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting requests, not a benchmark
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://docs.aihubmix.com/en/api/aihubmix-image-generation.md" rel="noopener noreferrer"&gt;unified image API guide&lt;/a&gt; documents reference inputs. Use Bash, &lt;code&gt;curl&lt;/code&gt;, &lt;code&gt;jq&lt;/code&gt;, &lt;code&gt;base64&lt;/code&gt;, an environment key, and an owned &lt;code&gt;./source-ad.png&lt;/code&gt;. &lt;strong&gt;These unexecuted examples submit billable requests.&lt;/strong&gt; They share input, prompt, &lt;code&gt;n=1&lt;/code&gt;, dimensions, and output format; GPT's additional &lt;code&gt;quality="high"&lt;/code&gt; has no Seedream equivalent here. Equal dimensions do not mean equal compute effort or reproduce AA's &lt;code&gt;(max)&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;&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail
: &lt;span class="s2"&gt;"${AIHUBMIX_API_KEY:?Set AIHUBMIX_API_KEY first}"&lt;/span&gt;
&lt;span class="nv"&gt;SOURCE_IMAGE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"./source-ad.png"&lt;/span&gt;
&lt;span class="nb"&gt;test&lt;/span&gt; -r &lt;span class="s2"&gt;"$SOURCE_IMAGE"&lt;/span&gt;
&lt;span class="nv"&gt;SOURCE_DATA_URI&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"data:image/png;base64,$(base64 &amp;lt; "&lt;/span&gt;&lt;span class="nv"&gt;$SOURCE_IMAGE&lt;/span&gt;&lt;span class="s2"&gt;" | tr -d '\r\n')"&lt;/span&gt;
&lt;span class="nv"&gt;PROMPT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'Change only the red mug to cobalt blue and replace the price label text with exactly "US$19.99". Preserve the label position and shape, logo, shadows, other objects, background, framing, and all other text.'&lt;/span&gt;

&lt;span class="c"&gt;# Seedream 5.5: no quality field on this route.&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s'&lt;/span&gt; &lt;span class="s2"&gt;"$SOURCE_DATA_URI"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
  jq -Rs --arg prompt &lt;span class="s2"&gt;"$PROMPT"&lt;/span&gt; &lt;span class="s1"&gt;'{
    model: "doubao-seedream-5-5", prompt: $prompt, image: .,
    n: 1, size: "2048x2048", output_format: "png",
    extra: {watermark: false}
  }'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
  curl --fail-with-body --silent --show-error \
    https://aihubmix.com/ai/v1/images/generations \
    -H &lt;span class="s2"&gt;"Authorization: Bearer $AIHUBMIX_API_KEY"&lt;/span&gt; \
    -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; --data-binary @-

&lt;span class="c"&gt;# GPT Image 2.6 Sunburst: high is not the leaderboard's max.&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s'&lt;/span&gt; &lt;span class="s2"&gt;"$SOURCE_DATA_URI"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
  jq -Rs --arg prompt &lt;span class="s2"&gt;"$PROMPT"&lt;/span&gt; &lt;span class="s1"&gt;'{
    model: "gpt-image-2.6-sunburst", prompt: $prompt, image: .,
    n: 1, size: "2048x2048", output_format: "png", quality: "high"
  }'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
  curl --fail-with-body --silent --show-error \
    https://aihubmix.com/ai/v1/images/generations \
    -H &lt;span class="s2"&gt;"Authorization: Bearer $AIHUBMIX_API_KEY"&lt;/span&gt; \
    -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; --data-binary @-
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Watermarks and protected task URLs
&lt;/h3&gt;

&lt;p&gt;Seedream's schema declares a visible-watermark default of &lt;code&gt;true&lt;/code&gt;; &lt;code&gt;extra.watermark=false&lt;/code&gt; requests omission, but that behavior was not output-tested.&lt;/p&gt;

&lt;p&gt;Both schemas permit optional asynchronous execution. Check account-level task-feature activation first; &lt;code&gt;403 async_not_enabled&lt;/code&gt; means activation is required. Download a returned &lt;code&gt;content_url&lt;/code&gt; using the same API key/Bearer token that created the task. It is not a public reference-image URL: download the accepted image and build a fresh data URI for another revision.&lt;/p&gt;

&lt;p&gt;Choose candidates by requirements, then inspect outputs. If exact label text fails acceptance, retain the label as an editable design element rather than approving a plausible mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the Seedream 5.5 series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Replacing an existing workflow? Read &lt;a href="https://dev.to/aihubmix/seedream-55-vs-50-pro-check-the-output-contract-before-migrating-ajh"&gt;Seedream 5.5 vs 5.0 Pro: check the output contract before migrating&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Implementing generation or migration? Read &lt;a href="https://dev.to/aihubmix/seedream-55-api-with-python-generate-save-then-edit-1hi5"&gt;Seedream 5.5 API with Python: generate, save, then edit&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://seed.bytedance.com/en/blog/more-realistic-images-more-stable-editing-across-100-rounds-introducing-seedream-5-5" rel="noopener noreferrer"&gt;Introducing Seedream 5.5&lt;/a&gt; — ByteDance Seed.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://artificialanalysis.ai/image/leaderboard/editing" rel="noopener noreferrer"&gt;AA-Image-Editing v2.1 leaderboard&lt;/a&gt; — Artificial Analysis; snapshot 2026-11-12 06:24:03 UTC.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developers.openai.com/api/docs/models/gpt-image-2.6-sunburst" rel="noopener noreferrer"&gt;GPT Image 2.6 Sunburst model page and official pricing&lt;/a&gt; — OpenAI.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/call/schema/models/doubao-seedream-5-5/endpoints" rel="noopener noreferrer"&gt;Seedream 5.5 endpoint schema&lt;/a&gt; — AIHubMix.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/call/schema/models/gpt-image-2.6-sunburst/endpoints" rel="noopener noreferrer"&gt;GPT Image 2.6 Sunburst endpoint schema&lt;/a&gt; — AIHubMix.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>tutorial</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Seedream 5.5 API with Python: generate, save, then edit</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Thu, 12 Nov 2026 15:00:15 +0000</pubDate>
      <link>https://dev.to/aihubmix/seedream-55-api-with-python-generate-save-then-edit-1hi5</link>
      <guid>https://dev.to/aihubmix/seedream-55-api-with-python-generate-save-then-edit-1hi5</guid>
      <description>&lt;p&gt;The implementation problem is not just changing a model string. For &lt;a href="https://aihubmix.com/model/doubao-seedream-5-5" rel="noopener noreferrer"&gt;Seedream 5.5 on AIHubMix&lt;/a&gt;, the workflow is a task lifecycle: submit one request, inspect its status, save the returned image, then send those saved bytes as the reference for a separate edit.&lt;/p&gt;

&lt;p&gt;This example requests a blue ceramic-mug product image and then a color-only edit to forest green. It uses &lt;code&gt;doubao-seedream-5-5&lt;/code&gt; with &lt;code&gt;POST /ai/v1/images/generations&lt;/code&gt; and flat JSON—not a legacy &lt;code&gt;input&lt;/code&gt; envelope or &lt;code&gt;data[0].url&lt;/code&gt; response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verification boundary:&lt;/strong&gt; documentation checked on November 12, 2026. Code received local syntax and offline helper checks only; no generation request was executed. Nothing here establishes image quality, editing fidelity, latency, or an actual bill.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lock down the request contract first
&lt;/h2&gt;

&lt;p&gt;Read the &lt;a href="https://aihubmix.com/call/schema/models/doubao-seedream-5-5/endpoints" rel="noopener noreferrer"&gt;current endpoint schema&lt;/a&gt;, selecting the entry by &lt;code&gt;path&lt;/code&gt;, not array position. Its model-specific constraints take precedence over a shared parameter list.&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 used here&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;doubao-seedream-5-5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Route&lt;/td&gt;
&lt;td&gt;POST /ai/v1/images/generations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Body&lt;/td&gt;
&lt;td&gt;Flat JSON&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Size&lt;/td&gt;
&lt;td&gt;2048x2048&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image count&lt;/td&gt;
&lt;td&gt;n = 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;File format&lt;/td&gt;
&lt;td&gt;png&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Response format&lt;/td&gt;
&lt;td&gt;url&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The schema requires &lt;code&gt;model&lt;/code&gt; and a nonempty &lt;code&gt;prompt&lt;/code&gt;, restricts &lt;code&gt;n&lt;/code&gt; to 1, and lists &lt;code&gt;png&lt;/code&gt; and &lt;code&gt;jpeg&lt;/code&gt; output. The &lt;code&gt;image&lt;/code&gt; field accepts a URL, Base64 input, or a &lt;code&gt;{url}&lt;/code&gt; object. The &lt;code&gt;images&lt;/code&gt; array has a published maximum of 14 references; that limit has not been runtime-tested here. This example uses one reference and sets the default size explicitly, without an outer &lt;code&gt;input&lt;/code&gt; object or &lt;code&gt;extra&lt;/code&gt; extensions.&lt;/p&gt;

&lt;p&gt;Use Python 3.10+ and &lt;code&gt;requests&lt;/code&gt;. In Bash, install the dependency and enter the key without putting its value into shell history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 -m pip install requests
&lt;span class="nb"&gt;read&lt;/span&gt; -r -s -p &lt;span class="s1"&gt;'AIHubMix API key: '&lt;/span&gt; AIHUBMIX_API_KEY
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'\n'&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; AIHUBMIX_API_KEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For deployed code, inject the environment variable through your secret manager. Keep the key out of source files, examples, logs, notebooks, and browser-side code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before either creation POST, enable the account's task feature&lt;/strong&gt;, as required by the &lt;a href="https://docs.aihubmix.com/en/api/async-tasks.md" rel="noopener noreferrer"&gt;async task guide&lt;/a&gt;. This prerequisite applies to native &lt;code&gt;/ai/v1&lt;/code&gt; media task endpoints even when waiting synchronously. It is not the same as choosing background execution; only the latter is optional.&lt;/p&gt;

&lt;h3&gt;
  
  
  Remove legacy assumptions before sending anything
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://docs.aihubmix.com/en/api/Image-Gen.md" rel="noopener noreferrer"&gt;legacy Doubao adapter documentation&lt;/a&gt; lists older IDs under &lt;code&gt;/v1/models/doubao/&amp;lt;id&amp;gt;/predictions&lt;/code&gt; with an &lt;code&gt;input&lt;/code&gt; envelope. Its inventory does not list 5.5. Use the current discoverable route and flat body; no legacy-generation failure was tested. Copy the hyphenated model ID exactly rather than assuming a dotted spelling is an alias.&lt;/p&gt;

&lt;p&gt;Do not carry over top-level &lt;code&gt;quality&lt;/code&gt;, &lt;code&gt;background&lt;/code&gt;, &lt;code&gt;aspect_ratio&lt;/code&gt;, or &lt;code&gt;seed&lt;/code&gt;: they are absent from this model's current schema. &lt;a href="https://seed.bytedance.com/en/blog/more-realistic-images-more-stable-editing-across-100-rounds-introducing-seedream-5-5" rel="noopener noreferrer"&gt;ByteDance's launch announcement&lt;/a&gt; describes native transparent RGBA output, but the gateway schema exposes neither &lt;code&gt;background&lt;/code&gt; nor &lt;code&gt;layer_decomposition&lt;/code&gt;. PNG alone is not a verified transparency recipe.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generate once, then save the completed result
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://docs.aihubmix.com/en/api/aihubmix-image-generation.md" rel="noopener noreferrer"&gt;unified image API documentation&lt;/a&gt; defines a task response with &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;object: image&lt;/code&gt;, &lt;code&gt;model&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;output&lt;/code&gt;, and &lt;code&gt;error&lt;/code&gt;. Do not read it as legacy &lt;code&gt;data[0].url&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Read the short workflow first; the full setup and download helper is in the folded &lt;strong&gt;Appendix&lt;/strong&gt; below. &lt;strong&gt;Before executing these examples, load that appendix block once into the same Python session.&lt;/strong&gt; It defines &lt;code&gt;settings&lt;/code&gt;, &lt;code&gt;api_json&lt;/code&gt;, and &lt;code&gt;collect&lt;/code&gt; without submitting an image request. Then run the short blocks in order. Each POST is a separate paid action; do not rerun it to repair a missing response or failed download.&lt;/p&gt;

&lt;h3&gt;
  
  
  Submit the image request once
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;generation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Product photograph of one matte blue ceramic mug on a cream tabletop, "&lt;/span&gt;
              &lt;span class="s2"&gt;"soft side lighting, plain warm-gray background, no text or logos."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;api_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;IMAGES&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"/generations"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;generation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Inspect the task, then save the PNG
&lt;/h3&gt;

&lt;p&gt;Omitting &lt;code&gt;async&lt;/code&gt; means synchronous waiting. HTTP 200 can still contain &lt;code&gt;status: failed&lt;/code&gt;. The helper saves the task ID before inspecting status: only &lt;code&gt;completed&lt;/code&gt; proceeds to downloading; &lt;code&gt;failed&lt;/code&gt;, &lt;code&gt;cancelled&lt;/code&gt;, and unknown states stop it. &lt;code&gt;pending&lt;/code&gt; and &lt;code&gt;in_progress&lt;/code&gt; need existing-task inspection, not another generation.&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="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mug-blue"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This single call uses the creating key to retrieve the completed output, checks PNG bytes, and saves &lt;code&gt;mug-blue.png&lt;/code&gt;. It makes no automatic creation retry and refuses unexpected download hosts or redirects before forwarding the key. The full implementation is in the appendix; this is documentation-based behavior, not a verified generation result.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://aihubmix.com/model/doubao-seedream-5-5/llms.txt" rel="noopener noreferrer"&gt;model guide&lt;/a&gt; says output URLs last roughly 30 minutes. Download promptly with the same Bearer header and store the bytes yourself. &lt;code&gt;expires_at: null&lt;/code&gt; is not a permanent-retention promise. If &lt;code&gt;b64_json&lt;/code&gt; is populated, decode it instead of downloading a URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Edit the saved file, not its protected URL
&lt;/h2&gt;

&lt;p&gt;Inspect &lt;code&gt;mug-blue.png&lt;/code&gt; before paying for an edit. An authenticated &lt;code&gt;content_url&lt;/code&gt; is not necessarily public or reachable by the image provider. Send the saved PNG as a Data URI instead:&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;reference&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mug-blue.png"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_bytes&lt;/span&gt;&lt;span class="p"&gt;(&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="n"&gt;reference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="s2"&gt;"\x89PNG\r\n\x1a\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"The editing reference must be the saved PNG."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;edit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Change only the mug color from blue to forest green. Preserve the mug shape, "&lt;/span&gt;
              &lt;span class="s2"&gt;"camera angle, tabletop, background, lighting, and shadows."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"image"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"data:image/png;base64,"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;b64encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reference&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ascii"&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="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;api_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;IMAGES&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"/generations"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mug-green"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The prompt requests preservation; it does not demonstrate that preservation happened. Review the edited file before another paid round. The entire JSON request, including Base64 encoding, must fit within &lt;strong&gt;32 MiB&lt;/strong&gt;; model-specific media limits also apply. A genuinely public, provider-reachable image URL is another accepted input option.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep background execution separate from recovery
&lt;/h2&gt;

&lt;p&gt;Task-feature activation is required even for synchronous waiting. &lt;code&gt;403 async_not_enabled&lt;/code&gt; means that feature needs activation in the console. The optional part is background execution.&lt;/p&gt;

&lt;p&gt;To use background generation, build the same &lt;code&gt;generation&lt;/code&gt; dictionary, then use the two lines below instead of both the synchronous &lt;code&gt;task = api_json(...)&lt;/code&gt; line and its separate &lt;code&gt;collect(...)&lt;/code&gt; call. Choose before submitting. &lt;strong&gt;Do not run both versions.&lt;/strong&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;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;api_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;IMAGES&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"/generations"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;generation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"async"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mug-blue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;poll&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&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;The helper polls &lt;code&gt;GET /ai/v1/images/{id}&lt;/code&gt; approximately every 15 seconds until a terminal state. That is the documented recommendation, not a server-enforced interval. Webhooks require &lt;code&gt;async: true&lt;/code&gt;; a receiver is outside this tutorial.&lt;/p&gt;

&lt;p&gt;If collection stopped, reload only the shared setup/helper block in the appendix in a fresh session if needed, including its &lt;code&gt;settings&lt;/code&gt; definitions—not a creation block. With a saved ID, recovery uses no POST:&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;task_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mug-blue.task-id"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;api_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;IMAGES&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"/"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;safe&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&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;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mug-blue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;poll&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&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;Use the corresponding &lt;code&gt;mug-green&lt;/code&gt; stem to recover the edit. If the creation response disappeared before an ID was saved, inspect recent tasks:&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;recent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;api_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;IMAGES&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"?limit=20&amp;amp;order=desc"&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;row&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;recent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"data"&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="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"created_at"&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;Match the model and creation time; do not blindly choose the newest task. Use &lt;code&gt;next_after&lt;/code&gt; as the next request's &lt;code&gt;after&lt;/code&gt; cursor if needed. If the match is ambiguous, contact support rather than submit again. The list is a snapshot; poll task details instead. A row's &lt;code&gt;output_error&lt;/code&gt; means the output could not be read, not that generation produced nothing or charges changed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep using the creating key for list, detail, and content access.&lt;/strong&gt; Unified tasks are token-isolated: another key on the same account cannot read them. A local interruption does not prove the task failed or that no charge occurred.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch on documented error codes, not message strings
&lt;/h2&gt;

&lt;p&gt;These are documented unified image errors, &lt;strong&gt;not observed 5.5 responses&lt;/strong&gt;. Check HTTP status separately from task status.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Where&lt;/th&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Next action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 400&lt;/td&gt;
&lt;td&gt;schema_violation&lt;/td&gt;
&lt;td&gt;Correct schema fields&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 400&lt;/td&gt;
&lt;td&gt;capability_not_supported&lt;/td&gt;
&lt;td&gt;Remove unsupported options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 504&lt;/td&gt;
&lt;td&gt;sync_timeout&lt;/td&gt;
&lt;td&gt;Recover; contact support&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 502&lt;/td&gt;
&lt;td&gt;task_status_unavailable&lt;/td&gt;
&lt;td&gt;Do not resubmit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 422&lt;/td&gt;
&lt;td&gt;output_blocked&lt;/td&gt;
&lt;td&gt;Revise content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 403&lt;/td&gt;
&lt;td&gt;async_not_enabled&lt;/td&gt;
&lt;td&gt;Activate task feature&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failed task&lt;/td&gt;
&lt;td&gt;result_delivery_failed&lt;/td&gt;
&lt;td&gt;Investigate existing result&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For HTTP 502 &lt;code&gt;task_status_unavailable&lt;/code&gt;, the unified image API guide states:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The model provider task state could not be confirmed. Do not submit it again. Contact support with the task ID or request ID.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For task-level &lt;code&gt;result_delivery_failed&lt;/code&gt;, it states:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The generated result could not be delivered. Do not resubmit automatically. Contact support with the task ID.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A &lt;code&gt;sync_timeout&lt;/code&gt; does not establish that execution never happened. Retain &lt;code&gt;error.tid&lt;/code&gt;, use a task ID only if one was actually returned, and ask support to resolve uncertain outcomes. Never turn an uncertain result into an automatic POST retry.&lt;/p&gt;

&lt;p&gt;A recoverable download failure calls for retrying retrieval, not generation. Two failures need different decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;410 artifact_expired&lt;/code&gt;:&lt;/strong&gt; the artifact can no longer be retrieved. Check saved files first. If a replacement is still needed, deliberately authorize a new paid generation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;429 too_many_downloads&lt;/code&gt;:&lt;/strong&gt; check saved copies or contact support. Waiting alone does not guarantee renewed access.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The guide explicitly waives the generation fee for &lt;code&gt;output_blocked&lt;/code&gt;, including when it appears in a failed task. Do not extend that exception to every failed or moderated request; &lt;code&gt;output_policy_violation&lt;/code&gt; follows the existing moderation billing rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Budget for both paid actions
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://finance.sina.com.cn/tech/it/2026-11-09/doc-iniycrzu2908981.shtml" rel="noopener noreferrer"&gt;Sina Technology's launch report&lt;/a&gt; reports approximately CNY 0.28 for one 2K square edit, combining image input and output, with text tokens free. This is press reporting, not a verified official rate sheet or an AIHubMix quote.&lt;/p&gt;

&lt;p&gt;Two paid edit rounds of an existing image, each matching that rounded scenario, illustrate approximately &lt;code&gt;2 × CNY 0.28 = CNY 0.56&lt;/code&gt;. That excludes initial text-to-image generation, extra references, additional candidates, and retries. It is not a measured bill.&lt;/p&gt;

&lt;p&gt;For the example here, &lt;strong&gt;total = initial generation charge + reference-edit charge&lt;/strong&gt;. A full official 5.5 tariff was not established from the examined pages, so there is no fixed total or precise old/new savings ratio to quote.&lt;/p&gt;

&lt;p&gt;Before submitting, confirm the current model schema, activate the task feature, retain task IDs, and treat each POST as a separate paid action. Start with one image and one deliberate edit; review the saved files before adding rounds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix: shared setup and download helper
&lt;/h2&gt;

&lt;p&gt;Skip this appendix when reading the workflow. Before executing the short examples, expand and load this block once into the same Python session. It configures the session and defines functions without generating an image. To recover an interrupted task in a fresh session, reload only this block—not a creation or editing block.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
  Expand the full helper — load once before the short examples; no image request
  &lt;br&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;urlsplit&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="no"&gt;BASE&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="no"&gt;IMAGES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/ai/v1/images"&lt;/span&gt;
&lt;span class="n"&gt;settings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"doubao-seedream-5-5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2048x2048"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"n"&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="s2"&gt;"output_format"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"response_format"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&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;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Bearer "&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="s2"&gt;"AIHUBMIX_API_KEY"&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;api_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&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="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;BASE&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;body&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="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&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;allow_redirects&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RequestException&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s2"&gt;"Connection interrupted. Recover the existing task before another POST."&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"HTTP {response.status_code}: non-JSON response; recover before another POST."&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nb"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Unexpected response; recover before another POST."&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="mi"&gt;200&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"HTTP {response.status_code}: code={error.get('code')}, "&lt;/span&gt;
            &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"tid={error.get('tid')}. No automatic generation retry."&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;data&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;poll&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;task_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"id"&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="nb"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"No task ID returned. Recover from the task list; do not resubmit."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stem&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;".task-id"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Task:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"status:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&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;status&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"pending"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"in_progress"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Stopped: status={status}, code={error.get('code')}; task={task_id}."&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="n"&gt;poll&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Task still active. Query the saved ID; do not recreate it."&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="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;api_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;IMAGES&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"/"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;safe&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&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;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"output"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;[&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="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Completed without readable output; investigate the saved task."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;output&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="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"b64_json"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;image_bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;b64decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"b64_json"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;validate&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&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;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"content_url"&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="nb"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Missing content_url; investigate the saved task."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;parsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;urlsplit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scheme&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;netloc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"aihubmix.com"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Unexpected download origin; key was not forwarded."&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="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&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="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;15&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="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;allow_redirects&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RequestException&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Download interrupted; recover this task, not a new generation."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;300&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="n"&gt;detail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;detail&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="n"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"error"&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="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;410&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"artifact_expired"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Artifact expired; retrieval cannot recover it. Check saved files first."&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;code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"too_many_downloads"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Download allowance exhausted; check saved files or contact support."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Download HTTP {response.status_code}, code={code}; "&lt;/span&gt;
                &lt;span class="s2"&gt;"inspect the saved task. Retry retrieval only if recoverable."&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;image_bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;image_bytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="s2"&gt;"\x89PNG\r\n\x1a\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Expected PNG bytes; stopped before saving or reusing the result."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;destination&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stem&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;".png"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Saved:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;destination&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;destination&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The 600-second read timeout is a client choice, not a service latency promise. The PNG check matches this tutorial's explicit output format; adapt it if you choose JPEG.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the Seedream 5.5 series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Before migrating an existing 5.0 Pro integration, weigh the upgrade: &lt;a href="https://dev.to/aihubmix/seedream-55-vs-50-pro-check-the-output-contract-before-migrating-ajh"&gt;Seedream 5.5 vs 5.0 Pro: check the output contract before migrating&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If the same workflow could use another image model, compare the trade-offs: &lt;a href="https://dev.to/aihubmix/seedream-55-vs-gpt-image-26-editing-controls-before-integration-bfk"&gt;Seedream 5.5 vs GPT Image 2.6: editing controls before integration&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://seed.bytedance.com/en/blog/more-realistic-images-more-stable-editing-across-100-rounds-introducing-seedream-5-5" rel="noopener noreferrer"&gt;Seedream 5.5 launch announcement&lt;/a&gt; — ByteDance Seed; vendor capability claims.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/call/schema/models/doubao-seedream-5-5/endpoints" rel="noopener noreferrer"&gt;Current Seedream 5.5 endpoint schema&lt;/a&gt; — AIHubMix; request fields and model-specific constraints.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aihubmix.com/en/api/aihubmix-image-generation.md" rel="noopener noreferrer"&gt;Unified image generation API&lt;/a&gt; — AIHubMix; tasks, downloads, and current errors.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/model/doubao-seedream-5-5/llms.txt" rel="noopener noreferrer"&gt;Seedream 5.5 model guide&lt;/a&gt; — AIHubMix; model ID and short-lived authenticated downloads; use the unified API document for route-specific errors.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://finance.sina.com.cn/tech/it/2026-11-09/doc-iniycrzu2908981.shtml" rel="noopener noreferrer"&gt;Seedream 5.5 launch coverage&lt;/a&gt; — Sina Technology; approximate editing-cost scenario, not an official tariff.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>tutorial</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Seedream 5.5 vs 5.0 Pro: check the output contract before migrating</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Thu, 12 Nov 2026 15:00:13 +0000</pubDate>
      <link>https://dev.to/aihubmix/seedream-55-vs-50-pro-check-the-output-contract-before-migrating-ajh</link>
      <guid>https://dev.to/aihubmix/seedream-55-vs-50-pro-check-the-output-contract-before-migrating-ajh</guid>
      <description>&lt;p&gt;&lt;a href="https://aihubmix.com/model/doubao-seedream-5-5" rel="noopener noreferrer"&gt;Seedream 5.5&lt;/a&gt; is worth evaluating for repeated image edits, transparent assets, and dense Chinese or English text. It is not an automatic replacement for a 5.0 Pro integration that depends on separate layers or exact dimensions.&lt;/p&gt;

&lt;p&gt;The engineering question is whether improved model behavior arrives through an API that still delivers the outputs your application requires. Keep those two checks separate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the release claims as evaluation targets
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://seed.bytedance.com/en/blog/more-realistic-images-more-stable-editing-across-100-rounds-introducing-seedream-5-5" rel="noopener noreferrer"&gt;ByteDance's November 9, 2026 announcement&lt;/a&gt; describes 100 successive edits to one person. Each round uses the previous output as its reference, rather than returning to the original. That distinction matters when evaluating accumulated drift.&lt;/p&gt;

&lt;p&gt;ByteDance claims pixel-level preservation of unedited regions, less color shift and detail loss, and more realistic lighting, skin, and materials. These are vendor claims and a vendor demonstration—not an independently established durability limit. The sequence does not guarantee unchanged identity, geometry, or lettering across every production job.&lt;/p&gt;

&lt;p&gt;For dense Chinese and English text, including small lettering, the vendor reports &lt;strong&gt;0.4% severe corruption&lt;/strong&gt; and &lt;strong&gt;1.7% minor corruption&lt;/strong&gt; in its evaluation. These are not universal error probabilities. Labels, prices, and layouts still need proofreading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preserve the documented 5.0 Pro baseline
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://docs.volcengine.com/docs/ark/image-generation-api?lang=zh" rel="noopener noreferrer"&gt;official image-generation API documentation&lt;/a&gt; provides this baseline:&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;Seedream 5.0 Pro&lt;/th&gt;
&lt;th&gt;Seedream 5.5&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Successive edits&lt;/td&gt;
&lt;td&gt;Image editing supported&lt;/td&gt;
&lt;td&gt;100-round vendor demo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transparency&lt;/td&gt;
&lt;td&gt;Edit an alpha-bearing input&lt;/td&gt;
&lt;td&gt;Native RGBA generation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Separate layers&lt;/td&gt;
&lt;td&gt;Base + up to 16 layers&lt;/td&gt;
&lt;td&gt;Not confirmed on AIHubMix&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Generation presets&lt;/td&gt;
&lt;td&gt;1K / 1.5K / 2K&lt;/td&gt;
&lt;td&gt;Confirm on your route&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 5.0 Pro entries describe the official vendor API. Its layer decomposition produces a base image and independently editable PNG layers. Layer decomposition also supports the default size value &lt;code&gt;auto&lt;/code&gt;, subject to documented dimension bounds. Better image quality does not replace that output structure.&lt;/p&gt;

&lt;p&gt;Transparency needs a separate distinction. The official API already supports transparent editing for 5.0 Pro and Flash, with &lt;strong&gt;exactly one alpha-bearing input image and PNG output&lt;/strong&gt;. The 5.5 launch instead describes native RGBA generation from text or reference images, including full and partial transparency. It is not accurate to say that 5.0 could not handle transparency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pitfalls: a published field is not a runtime result
&lt;/h2&gt;

&lt;h3&gt;
  
  
  PNG output does not establish native alpha
&lt;/h3&gt;

&lt;p&gt;A PNG can be fully opaque. The model-level RGBA announcement does not establish a working gateway parameter, and choosing PNG alone does not confirm transparent output.&lt;/p&gt;

&lt;h3&gt;
  
  
  Listed sizes do not confirm route compatibility
&lt;/h3&gt;

&lt;p&gt;AIHubMix's &lt;a href="https://aihubmix.com/model/doubao-seedream-5-5/llms.txt" rel="noopener noreferrer"&gt;model guide&lt;/a&gt; documents model ID &lt;code&gt;doubao-seedream-5-5&lt;/code&gt; and &lt;code&gt;POST /ai/v1/images/generations&lt;/code&gt;. The &lt;a href="https://docs.aihubmix.com/en/api/aihubmix-image-generation.md" rel="noopener noreferrer"&gt;gateway image-generation guide&lt;/a&gt; explains the protocol.&lt;/p&gt;

&lt;p&gt;As of &lt;strong&gt;November 12, 2026, 06:05 UTC&lt;/strong&gt;, the &lt;a href="https://aihubmix.com/call/schema/models/doubao-seedream-5-5/endpoints" rel="noopener noreferrer"&gt;model-specific endpoint schema&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixes &lt;code&gt;n&lt;/code&gt; at 1.&lt;/li&gt;
&lt;li&gt;Lists PNG/JPEG output and &lt;code&gt;image&lt;/code&gt;/&lt;code&gt;images&lt;/code&gt; inputs.&lt;/li&gt;
&lt;li&gt;Exposes neither &lt;code&gt;background&lt;/code&gt; nor &lt;code&gt;layer_decomposition&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Lists 2K/3K/4K sizes, with pixel bounds resembling 5.0 Lite's rather than Pro's.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are published schema entries, not verified 5.5 runtime support. They establish neither successful requests nor failures. Treat this as an unresolved documentation/runtime boundary, especially if dimensions or alpha output are mandatory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Budget from qualified figures, not a savings headline
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://docs.volcengine.com/docs/ark/model-pricing?lang=zh" rel="noopener noreferrer"&gt;official Volcano Ark price table&lt;/a&gt; documents 5.0 Pro's CNY rates but lists neither 5.5 nor the announced 5.5 Pro. The documented rates and remaining gaps are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model / output tier&lt;/th&gt;
&lt;th&gt;Official CNY per output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;5.0 Pro: ≤2.61 million pixels&lt;/td&gt;
&lt;td&gt;0.30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5.0 Pro: &amp;gt;2.61 million pixels&lt;/td&gt;
&lt;td&gt;0.60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5.5&lt;/td&gt;
&lt;td&gt;Rate not verified&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5.5 Pro&lt;/td&gt;
&lt;td&gt;Not priced in cited material&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 5.0 Pro prices cover ordinary generation, not layer decomposition. The first reference image is free; each additional reference costs CNY 0.02. A 2048 × 2048 output contains &lt;strong&gt;4,194,304 pixels&lt;/strong&gt;, placing it in the &lt;strong&gt;CNY 0.60&lt;/strong&gt; tier, not CNY 0.30.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://finance.sina.com.cn/tech/it/2026-11-09/doc-iniycrzu2908981.shtml" rel="noopener noreferrer"&gt;Sina Technology's launch report&lt;/a&gt; describes 5.5 billing for input and output images, with text tokens uncharged. It gives &lt;strong&gt;approximately CNY 0.28&lt;/strong&gt; for a 2K-square edit. This is a press-reported example, not a verified complete official tariff or an AIHubMix quote.&lt;/p&gt;

&lt;p&gt;Three such rounds would be &lt;strong&gt;3 × CNY 0.28 ≈ CNY 0.84&lt;/strong&gt;, assuming an existing source image, one reference and one output per round, no extra candidates or retries, and an unchanged rate. This is arithmetic, not a measured bill. Do not derive a precise savings percentage from a rounded report and a different model's official schedule.&lt;/p&gt;

&lt;p&gt;ByteDance has announced a future 5.5 Pro, but the cited material establishes neither its release date nor its price. The current 5.5 is not that future Pro edition.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the migration decision explicit
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Evaluate 5.5 for revision-heavy product images, campaign variants, and text-heavy graphics.&lt;/li&gt;
&lt;li&gt;Retain an established workflow when separate layers or particular dimensions cannot change.&lt;/li&gt;
&lt;li&gt;Make confirmed alpha output on your serving route a go/no-go condition for transparent deliverables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start with what the output must preserve, then decide whether the model and serving route meet that requirement together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the Seedream 5.5 series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To turn the output requirements into an integration: &lt;a href="https://dev.to/aihubmix/seedream-55-api-with-python-generate-save-then-edit-1hi5"&gt;Seedream 5.5 API with Python: generate, save, then edit&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;To compare a different vendor rather than another Seedream version: &lt;a href="https://dev.to/aihubmix/seedream-55-vs-gpt-image-26-editing-controls-before-integration-bfk"&gt;Seedream 5.5 vs GPT Image 2.6: editing controls before integration&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://seed.bytedance.com/en/blog/more-realistic-images-more-stable-editing-across-100-rounds-introducing-seedream-5-5" rel="noopener noreferrer"&gt;Seedream 5.5 launch announcement&lt;/a&gt; — ByteDance Seed; vendor claims and evaluation.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.volcengine.com/docs/ark/image-generation-api?lang=zh" rel="noopener noreferrer"&gt;Image-generation API&lt;/a&gt; — Volcano Ark; documented 5.0 Pro capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.volcengine.com/docs/ark/model-pricing?lang=zh" rel="noopener noreferrer"&gt;Model pricing&lt;/a&gt; — Volcano Ark; official 5.0 Pro CNY rates.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://finance.sina.com.cn/tech/it/2026-11-09/doc-iniycrzu2908981.shtml" rel="noopener noreferrer"&gt;Seedream 5.5 launch coverage&lt;/a&gt; — Sina Technology, November 9, 2026; reported edit-cost example.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/model/doubao-seedream-5-5" rel="noopener noreferrer"&gt;Seedream 5.5 on AIHubMix&lt;/a&gt; — model listing; guide and endpoint schema linked above.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>tutorial</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Gemini Decision 1 vs Jev 1.14: Evaluate the Routing Policy, Not One Score</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Thu, 12 Nov 2026 09:21:39 +0000</pubDate>
      <link>https://dev.to/aihubmix/gemini-decision-1-vs-jev-114-evaluate-the-routing-policy-not-one-score-32p8</link>
      <guid>https://dev.to/aihubmix/gemini-decision-1-vs-jev-114-evaluate-the-routing-policy-not-one-score-32p8</guid>
      <description>&lt;p&gt;By AIHubMix&lt;/p&gt;

&lt;p&gt;For an input-price-sensitive text router, &lt;a href="https://aihubmix.com/model/jev-1.14" rel="noopener noreferrer"&gt;Jev 1.14&lt;/a&gt; deserves an early evaluation. Choose &lt;a href="https://aihubmix.com/model/gemini-decision-1" rel="noopener noreferrer"&gt;Gemini Decision 1&lt;/a&gt; if a held-out test shows that its routing policy avoids enough costly errors or escalations to justify the higher input price. Neither model wins every routing task.&lt;/p&gt;

&lt;p&gt;The engineering problem is bounded: route a request, allow a tool action, or escalate it. Both models support yes/no (&lt;code&gt;noul&lt;/code&gt;), choice, and rubric-score decisions. The comparison needs to evaluate those decisions as a policy, not treat a benchmark score or a confidence field as a deployment guarantee.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the benchmark with its denominator
&lt;/h2&gt;

&lt;p&gt;The figures below come from &lt;a href="https://blog.google/innovation-and-ai/technology/developers-tools/gemini-decisions-api/" rel="noopener noreferrer"&gt;Google's launch evaluation&lt;/a&gt;. They are Google self-reports, not independent validation or AIHubMix measurements.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Google-reported measure&lt;/th&gt;
&lt;th&gt;Gemini Decision 1&lt;/th&gt;
&lt;th&gt;Jev 1.14&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;JevBench accuracy&lt;/td&gt;
&lt;td&gt;92.2%&lt;/td&gt;
&lt;td&gt;90.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;When2Call accuracy&lt;/td&gt;
&lt;td&gt;79.9%&lt;/td&gt;
&lt;td&gt;82.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Top-1 ECE&lt;/td&gt;
&lt;td&gt;0.0250&lt;/td&gt;
&lt;td&gt;0.0494&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evaluation spend&lt;/td&gt;
&lt;td&gt;USD 0.88&lt;/td&gt;
&lt;td&gt;USD 0.68&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;JevBench uses the public split. ECE and spend cover seven shared evaluations. Google uses the full benchmark as the denominator and counts refusals, safety blocks, and requests a model could not accept as incorrect.&lt;/p&gt;

&lt;p&gt;The split verdict matters: Gemini leads on JevBench and aggregate calibration; Jev leads on When2Call accuracy. Expected calibration error (ECE) measures agreement between confidence and observed correctness, not the proportion of wrong classifications. Lower is better, but a lower aggregate ECE does not validate a threshold for a particular route.&lt;/p&gt;

&lt;p&gt;The chart does not report route-specific precision or recall, false tool-call rates, or automation coverage at a fixed error budget. Those are still measurements the deployment decision needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Select thresholds separately, then compare held-out policies
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aistudio.google.com/docs/decisions-api" rel="noopener noreferrer"&gt;Google's confidence documentation&lt;/a&gt; defines confidence as the largest outcome probability. For a yes/no question, it is the larger of the yes and no probabilities—not an independent second check.&lt;/p&gt;

&lt;p&gt;Native Jev &lt;code&gt;noul&lt;/code&gt; answers expose a probability without a separate confidence field. Even where choice or score answers share field names, that does not establish identical calibration. Reusing a threshold across models, routes, or versions is an untested policy change.&lt;/p&gt;

&lt;p&gt;Use this evaluation workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fix the route definitions, acceptable false-action rate, cost of a false action, and fallback policy.&lt;/li&gt;
&lt;li&gt;Select a threshold for each model on labeled development traffic.&lt;/li&gt;
&lt;li&gt;Evaluate those policies on a separate held-out set.&lt;/li&gt;
&lt;li&gt;Count wrong automatic actions and valid requests unnecessarily escalated. Compare the traffic each policy can automate within the same error budget.&lt;/li&gt;
&lt;li&gt;Include additional human-review expense in total operating cost.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For high-consequence actions, fail closed or use manual fallback. Authorization checks remain outside the model's decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate input-price arithmetic from operating cost
&lt;/h2&gt;

&lt;p&gt;These are &lt;strong&gt;official direct-API list prices&lt;/strong&gt;, from &lt;a href="https://aistudio.google.com/docs/pricing#gemini-decision" rel="noopener noreferrer"&gt;Google's pricing page&lt;/a&gt; and &lt;a href="https://docs.typesafe.ai/models.md" rel="noopener noreferrer"&gt;TypeSafe's model documentation&lt;/a&gt;, not AIHubMix channel 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;Input / 1M tokens&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gemini Decision 1&lt;/td&gt;
&lt;td&gt;USD 0.10&lt;/td&gt;
&lt;td&gt;0 tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jev 1.14&lt;/td&gt;
&lt;td&gt;USD 0.042&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Gemini generates zero output tokens. Jev's free output does not require its reported output-token usage to be zero. The approximately 2.38× ratio compares input-token prices, not necessarily total request costs.&lt;/p&gt;

&lt;p&gt;For the documentation-based estimate, assume 1,000,000 decisions, one request per decision, and 2,000 billed input tokens per request, including questions. The input-token count is assumed independently for each vendor; it does not establish equal tokenization or formatting.&lt;/p&gt;

&lt;p&gt;That is 2 billion billed input tokens: USD 200 for Gemini and USD 84 for Jev, a USD 116 difference at official rates. This is not an inference measurement or a gateway invoice. The estimate does not account for retries, escalation, or differences in accuracy; check the selected channel's pricing for actual charges.&lt;/p&gt;

&lt;p&gt;Google's evaluation spend instead has a ratio of about 1.29×: USD 0.88 / USD 0.68. Different workloads and billed token counts can produce that ratio without contradicting the list prices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat native capabilities as requirements to verify
&lt;/h2&gt;

&lt;p&gt;Google documents text, image, audio, video, and PDF input, with 262,144 total tokens shared across input and questions. Its 1–1,000-question limit does not establish a capacity advantage: TypeSafe specifies no separate question-count ceiling, subject to context limits.&lt;/p&gt;

&lt;p&gt;Jev is not text-only: it accepts text and PNG/JPEG images. However, &lt;a href="https://typesafe.ai/blog/jev-1-14" rel="noopener noreferrer"&gt;Jev 1.14's release notes&lt;/a&gt; flag images, Box, and extended context as experimental. Native images and Box are off by default and require a vendor opt-in header. That header's gateway behavior is unverified here.&lt;/p&gt;

&lt;p&gt;Jev's default context limits are 64k tokens for shared state plus all questions and 32k for shared state plus any single question. An experimental vendor header raises both to 262k, with slower and less accurate processing.&lt;/p&gt;

&lt;p&gt;These are native vendor specifications, not verified gateway guarantees. Google's native API also lacks caching and Batch support and does not accept native tool-call input blocks. Deciding whether a tool should run is not the same as accepting its protocol blocks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Record the actual channel and returned version
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://aihubmix.com/compare/gemini-decision-1/jev-1.14" rel="noopener noreferrer"&gt;AIHubMix comparison page&lt;/a&gt; is a starting point for selecting the products. Their public instructions document &lt;code&gt;POST /v1/systemone&lt;/code&gt;, the same AIHubMix key, and a request containing &lt;code&gt;state&lt;/code&gt; plus &lt;code&gt;questions&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The documented AIHubMix product IDs are &lt;code&gt;gemini-decision-1&lt;/code&gt; and &lt;code&gt;jev-1.14&lt;/code&gt;. They are not evidence of immutable upstream build pins. Jev's native versioned ID is &lt;code&gt;jev-1.14.0&lt;/code&gt;; record the model/version returned by the actual channel rather than assuming an alias resolves identically everywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No authenticated request was run for this comparison.&lt;/strong&gt; Shared text-request documentation is not proof of response equivalence or actual channel parity. Native media, full context limits, and Gemini's 1,000-question capacity have not been established as passing through AIHubMix.&lt;/p&gt;

&lt;p&gt;Before choosing, verify the required capabilities on the exact channel, compare held-out automation coverage, and include fallback expense in total operating cost. Keep Jev if it meets the error budget at lower total cost; choose Gemini if its validated benefit justifies the premium. Re-evaluate when the model, version, or traffic changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the Gemini Decision 1 series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For the documented request shape behind this policy comparison, read &lt;a href="https://dev.to/aihubmix/gemini-decision-1-three-typed-checks-in-one-api-request-mj3"&gt;Gemini Decision 1: Three Typed Checks in One API Request&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Official pricing snapshots: Google, November 12, 2026, 06:43 UTC; TypeSafe, November 12, 2026, 06:53 UTC. Cost estimates are documentation-based, not inference measurements.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Google: &lt;a href="https://blog.google/innovation-and-ai/technology/developers-tools/gemini-decisions-api/" rel="noopener noreferrer"&gt;Gemini Decisions API launch and benchmark chart&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Google: &lt;a href="https://aistudio.google.com/docs/decisions-api" rel="noopener noreferrer"&gt;Decisions API documentation&lt;/a&gt; and &lt;a href="https://aistudio.google.com/docs/pricing#gemini-decision" rel="noopener noreferrer"&gt;official pricing&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;TypeSafe: &lt;a href="https://docs.typesafe.ai/models.md" rel="noopener noreferrer"&gt;model documentation&lt;/a&gt;, &lt;a href="https://typesafe.ai/blog/jev-1-14" rel="noopener noreferrer"&gt;Jev 1.14 release&lt;/a&gt;, &lt;a href="https://docs.typesafe.ai/images.md" rel="noopener noreferrer"&gt;image limitations&lt;/a&gt;, and &lt;a href="https://api.typesafe.ai/openapi.json" rel="noopener noreferrer"&gt;native API schema&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;AIHubMix: &lt;a href="https://aihubmix.com/model/gemini-decision-1" rel="noopener noreferrer"&gt;Gemini Decision 1&lt;/a&gt; (&lt;a href="https://aihubmix.com/model/gemini-decision-1/llms.txt" rel="noopener noreferrer"&gt;instructions&lt;/a&gt;) and &lt;a href="https://aihubmix.com/model/jev-1.14" rel="noopener noreferrer"&gt;Jev 1.14&lt;/a&gt; (&lt;a href="https://aihubmix.com/model/jev-1.14/llms.txt" rel="noopener noreferrer"&gt;instructions&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;AIHubMix: &lt;a href="https://aihubmix.com/compare/gemini-decision-1/jev-1.14" rel="noopener noreferrer"&gt;Gemini Decision 1 versus Jev 1.14 comparison&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>api</category>
      <category>gemini</category>
    </item>
    <item>
      <title>Gemini Decision 1: Three Typed Checks in One API Request</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Thu, 12 Nov 2026 09:21:37 +0000</pubDate>
      <link>https://dev.to/aihubmix/gemini-decision-1-three-typed-checks-in-one-api-request-mj3</link>
      <guid>https://dev.to/aihubmix/gemini-decision-1-three-typed-checks-in-one-api-request-mj3</guid>
      <description>&lt;p&gt;One support ticket can need three independent checks: which team should receive it, how urgent it is, and whether the message describes a working alternative. Gemini Decision 1 is designed for those bounded judgments, returning typed answers and probabilities rather than generating answer text.&lt;/p&gt;

&lt;p&gt;AIHubMix lists &lt;a href="https://aihubmix.com/model/gemini-decision-1" rel="noopener noreferrer"&gt;Gemini Decision 1&lt;/a&gt; on a separate decision endpoint, not Chat Completions. The integration below is documentation-based and &lt;strong&gt;has not been executed&lt;/strong&gt;. No authenticated request, output measurement, or latency test was run for this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose the answer type before writing the request
&lt;/h2&gt;

&lt;p&gt;Google's &lt;a href="https://aistudio.google.com/docs/models/gemini-decision-1" rel="noopener noreferrer"&gt;model specifications&lt;/a&gt; describe three answer types:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Question to express&lt;/th&gt;
&lt;th&gt;Answer value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;noul&lt;/td&gt;
&lt;td&gt;Does this condition hold?&lt;/td&gt;
&lt;td&gt;Probability of yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;choice&lt;/td&gt;
&lt;td&gt;Which route fits?&lt;/td&gt;
&lt;td&gt;One option plus probabilities&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;score&lt;/td&gt;
&lt;td&gt;How severe is this?&lt;/td&gt;
&lt;td&gt;Expected rubric level&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On Google's native API, &lt;code&gt;noul&lt;/code&gt; ranges from 0.01 to 0.99. A &lt;code&gt;choice&lt;/code&gt; accepts 2–255 options; a &lt;code&gt;score&lt;/code&gt; accepts 2–255 ordered levels, with 2–10 recommended for most rubrics. A score can be fractional because it is the probability-weighted average of level indices, not necessarily the most likely level.&lt;/p&gt;

&lt;p&gt;The native API supports up to 1,000 questions within a 262,144-token window covering the input and all questions. It documents text, images, audio, video, and PDFs. &lt;strong&gt;These are native Google capabilities, not verified gateway limits or media support.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Questions share input but do not share answers. One question cannot read another question's result. Combine independent outcomes in application code; use another request when a later decision genuinely depends on an earlier one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Count all billed input
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://aistudio.google.com/docs/pricing#gemini-decision" rel="noopener noreferrer"&gt;official pricing page&lt;/a&gt; sets Decision's standard price at $0.10 per million input tokens, with no output tokens. Shared input is billed once per request, while each question adds instructions, criteria, and formatting tokens.&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;Input / 1M tokens&lt;/th&gt;
&lt;th&gt;Output / 1M tokens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gemini Decision 1&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;td&gt;No output tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 3.5 Flash-Lite&lt;/td&gt;
&lt;td&gt;$0.30&lt;/td&gt;
&lt;td&gt;$2.50&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are official standard direct-API prices in USD. Flash-Lite's output price includes thinking tokens. AIHubMix's listed rates matched these prices in the November 12, 2026 check.&lt;/p&gt;

&lt;p&gt;For an &lt;strong&gt;illustrative, not measured&lt;/strong&gt; workload, assume 100,000 tickets per month, each sent once with three questions, and 2,000 billed input tokens per request &lt;strong&gt;including those questions&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decision: 200 million input tokens × $0.10/M = &lt;strong&gt;$20&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/model/gemini-3.5-flash-lite" rel="noopener noreferrer"&gt;Gemini 3.5 Flash-Lite&lt;/a&gt;: the same assumed input costs $60. Another assumed 40 output tokens per request produces four million output tokens, costing $10, for &lt;strong&gt;$70 total&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The estimate excludes caching, retries, taxes, and downstream review. Equal assumed billed input does not establish equal tokenization or equal quality. More routing errors can outweigh a smaller token bill.&lt;/p&gt;

&lt;p&gt;The Decisions API has no context caching or Batch API. Shared-input billing helps within one request; repeating the state in another request bills it again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the gateway's request envelope
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://aihubmix.com/model/gemini-decision-1/llms.txt" rel="noopener noreferrer"&gt;AIHubMix model instructions&lt;/a&gt; document &lt;code&gt;POST /v1/systemone&lt;/code&gt;, Bearer authentication, and the fields &lt;code&gt;model&lt;/code&gt;, &lt;code&gt;state&lt;/code&gt;, and &lt;code&gt;questions&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Google's native API instead uses &lt;code&gt;/v1beta/decisions&lt;/code&gt; and &lt;code&gt;input&lt;/code&gt;. The envelopes are not interchangeable. Changing a base URL on a native SDK example does not establish that its method and fields will translate.&lt;/p&gt;

&lt;p&gt;This is the &lt;strong&gt;unexecuted documentation example&lt;/strong&gt;, using a fictional ticket and text only. Media behavior through the gateway has not been verified here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --fail-with-body https://aihubmix.com/v1/systemone \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $AIHUBMIX_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "model": "gemini-decision-1",
    "state": "The export button fails in Safari. Chrome works, but I need to send the report today.",
    "questions": {
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this support request?",
        "criteria": {
          "billing": "Charges, invoices, or refunds.",
          "technical": "A product feature is not working.",
          "other": "The request does not fit either department."
        }
      },
      "urgency": {
        "type": "score",
        "instructions": "How time-sensitive is the request?",
        "criteria": [
          "No deadline is stated.",
          "A future deadline is stated, but not today.",
          "The user needs the task completed today."
        ]
      },
      "has_workaround": {
        "type": "noul",
        "instructions": "Does the message explicitly describe a working alternative?"
      }
    }
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;choice.criteria&lt;/code&gt; is an object; &lt;code&gt;score.criteria&lt;/code&gt; is an ordered array. Put the complete question in &lt;code&gt;instructions&lt;/code&gt;, rather than expecting the question key to supply its meaning.&lt;/p&gt;

&lt;p&gt;The current AIHubMix instructions contain a response example naming a Jev model. &lt;strong&gt;That is not a Gemini transcript.&lt;/strong&gt; It establishes neither Gemini's actual response shape and routing nor its output-token accounting, score semantics, or confidence semantics. Validate the real returned types and usage before integration. Full native media support, context limits, and question-count limits through this gateway remain unverified here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes belong in the routing policy
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://aistudio.google.com/docs/decisions-api" rel="noopener noreferrer"&gt;Google Decisions API guide&lt;/a&gt; recommends selecting thresholds against labeled examples from your own traffic, then measuring errors on a separate held-out set.&lt;/p&gt;

&lt;h3&gt;
  
  
  A valid-looking result still needs validation
&lt;/h3&gt;

&lt;p&gt;Validate the response and required fields before reading an answer. Check that the selected route belongs to the allowed options. Send uncertain, out-of-scope, or malformed results to review. Include an &lt;code&gt;other&lt;/code&gt; option when no route may fit: a closed option list still distributes probability even when every listed option is unsuitable.&lt;/p&gt;

&lt;h3&gt;
  
  
  High confidence is not the probability of yes
&lt;/h3&gt;

&lt;p&gt;On Google's native API, confidence is the highest outcome probability. For a yes/no question it is &lt;code&gt;max(p, 1 − p)&lt;/code&gt;, not a second model independently confirming the result. A high-confidence no is still no. Do not use confidence in place of the probability that the condition holds.&lt;/p&gt;

&lt;p&gt;For scores, decide whether the application needs the expected score or the single most likely level. They can lead to different actions. These native semantics are not established for Gemini by the gateway's Jev response example.&lt;/p&gt;

&lt;h3&gt;
  
  
  A missing answer must not become approval
&lt;/h3&gt;

&lt;p&gt;Google's documentation shows blocked inputs returning HTTP 400 rather than decision answers. That is a native documentation example, &lt;strong&gt;not a measured AIHubMix response&lt;/strong&gt;. Handle non-success responses separately using the gateway's &lt;a href="https://docs.aihubmix.com/en/FAQs/HTTP-Codes.md" rel="noopener noreferrer"&gt;HTTP error guidance&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A typed answer is not authorization to execute an action. Authorization and high-stakes review remain application responsibilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this integration does not demonstrate
&lt;/h2&gt;

&lt;p&gt;Google reports median end-to-end latency of 150–250 ms for inputs up to 16K tokens and nearly flat latency from 1 to 100 questions. These are &lt;strong&gt;vendor-reported figures&lt;/strong&gt;, not AIHubMix measurements, and not a promise for 1,000 questions or the full context window.&lt;/p&gt;

&lt;p&gt;Decision is a plausible fit for routing, policy checks, candidate ranking, and narrow agent stop/escalation decisions. Keep a generative model when the application needs an explanation, arbitrary extracted values, tool arguments, or multi-step reasoning.&lt;/p&gt;

&lt;p&gt;The next integration step is to validate actual response types and usage, then evaluate a routing policy against labeled traffic. The example above demonstrates a documented request structure, not a working integration or a measured result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the Gemini Decision 1 series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To compare routing policies rather than just request formats, continue with &lt;a href="https://dev.to/aihubmix/gemini-decision-1-vs-jev-114-evaluate-the-routing-policy-not-one-score-32p8"&gt;Gemini Decision 1 vs Jev 1.14: Evaluate the Routing Policy, Not One Score&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Prices reflect the November 12, 2026, 06:43 UTC check. Specifications and prices are documentation snapshots, not inference measurements.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://blog.google/innovation-and-ai/technology/developers-tools/gemini-decisions-api/" rel="noopener noreferrer"&gt;Gemini Decisions API launch announcement&lt;/a&gt; — Google DeepMind.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aistudio.google.com/docs/models/gemini-decision-1" rel="noopener noreferrer"&gt;Gemini Decision 1 model specifications&lt;/a&gt; and &lt;a href="https://aistudio.google.com/docs/decisions-api" rel="noopener noreferrer"&gt;Decisions API guide&lt;/a&gt; — Google.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aistudio.google.com/docs/pricing" rel="noopener noreferrer"&gt;Gemini API pricing&lt;/a&gt; — Google, standard USD prices for Decision and Flash-Lite.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/model/gemini-decision-1/llms.txt" rel="noopener noreferrer"&gt;Gemini Decision 1 gateway instructions&lt;/a&gt; and &lt;a href="https://aihubmix.com/model/gemini-3.5-flash-lite/llms.txt" rel="noopener noreferrer"&gt;Flash-Lite listing&lt;/a&gt; — AIHubMix.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aihubmix.com/en/FAQs/HTTP-Codes.md" rel="noopener noreferrer"&gt;HTTP status-code reference&lt;/a&gt; — AIHubMix.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>api</category>
      <category>gemini</category>
    </item>
    <item>
      <title>Gemini 4 Carbon vs Fable 5.2: Which One for Agentic Coding?</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Wed, 11 Nov 2026 16:12:37 +0000</pubDate>
      <link>https://dev.to/aihubmix/gemini-4-carbon-vs-fable-52-which-one-for-agentic-coding-35ca</link>
      <guid>https://dev.to/aihubmix/gemini-4-carbon-vs-fable-52-which-one-for-agentic-coding-35ca</guid>
      <description>&lt;p&gt;For long-horizon coding, Fable 5.2 leads the listed hard-code evaluations. Carbon scores higher on the listed Terminal-Bench 4.0 and AutomationBench-AA rows, and its introductory token rate is lower.&lt;/p&gt;

&lt;p&gt;Artificial Analysis's November 11 snapshot puts Fable High at 61.82 (#3) and Carbon High at 60.03 (#4). Fable High costs $9.08 per task and takes 17.3 minutes; Carbon High costs $7.76 and takes 25.6 minutes. At Medium, Carbon's AA index is higher (58.26 vs 56.41), but Fable is cheaper and faster: $3.80 and 7.8 minutes versus Carbon's $6.59 and 23.3.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Evaluation&lt;/th&gt;
&lt;th&gt;Carbon High&lt;/th&gt;
&lt;th&gt;Fable High&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;65.15&lt;/td&gt;
&lt;td&gt;59.6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FrontierCode 2.0&lt;/td&gt;
&lt;td&gt;40.56&lt;/td&gt;
&lt;td&gt;49.13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AutomationBench-AA&lt;/td&gt;
&lt;td&gt;77.82&lt;/td&gt;
&lt;td&gt;71.36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HLE-Diamond&lt;/td&gt;
&lt;td&gt;69.1&lt;/td&gt;
&lt;td&gt;73.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Non-hallucination&lt;/td&gt;
&lt;td&gt;88.58&lt;/td&gt;
&lt;td&gt;42.02&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Accuracy&lt;/td&gt;
&lt;td&gt;58.27&lt;/td&gt;
&lt;td&gt;77.23&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Which model leads on each test at High effort? Subtracting Fable from Carbon makes the direction visible; the table above keeps the absolute scores.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyw36e2qbdk9qejqcsozj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyw36e2qbdk9qejqcsozj.png" alt="Carbon High minus Fable High, in percentage points: Terminal-Bench +5.55, FrontierCode -8.57, AutomationBench +6.46, HLE-Diamond -4.70, non-hallucination +46.56 and accuracy -18.96." width="800" height="1033"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;High effort · Carbon minus Fable, percentage points. Source: Artificial Analysis, 11 November 2026.&lt;/p&gt;

&lt;p&gt;Positive values favour Carbon; negative values favour Fable. These independent tests do not form a combined quality score: a larger gap on one benchmark does not imply a larger gain in general ability. In particular, non-hallucination and accuracy measure different outcomes.&lt;/p&gt;

&lt;p&gt;Anthropic's own table ran Fable at Xhigh and Carbon at Medium: Fable led FrontierCode 49.1 to 41.1 and OSWorld 89.3 to 81.5; Carbon led AutomationBench 53.9 to 51.4. These are vendor-reported results on a different setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment differences
&lt;/h2&gt;

&lt;p&gt;Carbon's Google-native context is 1,048,576 tokens, with low/medium/high thinking and a 65,536 standard output cap. Google-native long decode can reach up to 1,048,576 minus input, but AIHubMix lists text, image, audio, video and PDF input for Carbon and documents all four protocol surfaces; its larger output path and native context are unconfirmed. Fable has 1M context, adaptive thinking that cannot be disabled, 128,000 output, text, image and PDF input, and a 30-day retention requirement with no ZDR unless authorized. Forced tool use (&lt;code&gt;tool_choice&lt;/code&gt; any/tool) returns 400 on Fable.&lt;/p&gt;

&lt;p&gt;Fable's official cache-read price is $0.20 per million tokens, alongside $8/$40 input/output. Carbon is $2/$10 until November 30, then $4/$20. AIHubMix lists Carbon at Google's introductory rate; the per-task numbers above use AA's standard prices.&lt;/p&gt;

&lt;h2&gt;
  
  
  One key, two IDs on AIHubMix
&lt;/h2&gt;

&lt;p&gt;AIHubMix documents Chat Completions, Messages, Responses and Gemini for Carbon, and Chat Completions, Responses and Messages for Fable. Carbon's documented input is text, image, audio, video and PDF. The gateway may retry another provider, so provider behaviour can vary. No live smoke test was run for this post; the sample only shows the request shape.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"gemini-4-carbon"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"claude-fable-5-2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="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="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Reply with OK."&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="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4096&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;Use Fable for hard code changes when its retention policy is acceptable. Use Carbon for the listed terminal and automation benchmarks, higher non-hallucination score and the lower High-effort task cost before December 1. Neither is a chat-speed model at High effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep reading: the Gemini 4 Carbon series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sibling trade-off: &lt;a href="https://dev.to/aihubmix/gemini-4-carbon-vs-argon-same-price-when-is-carbon-worth-it-4dn1"&gt;Gemini 4 Carbon vs Argon: Same Price, When Is Carbon Worth It?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Migration details: &lt;a href="https://dev.to/aihubmix/gemini-4-carbon-api-migration-400-errors-timeouts-and-output-limits-3h0d"&gt;Gemini 4 Carbon API Migration: 400 Errors, Timeouts and Output Limits&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://artificialanalysis.ai/models/gemini-4-carbon" rel="noopener noreferrer"&gt;Artificial Analysis: Carbon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://artificialanalysis.ai/models/claude-fable-5-2" rel="noopener noreferrer"&gt;Artificial Analysis: Fable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.anthropic.com/claude-fable-and-mythos-5-2" rel="noopener noreferrer"&gt;Anthropic launch table&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aihubmix.com/model/gemini-4-carbon" rel="noopener noreferrer"&gt;AIHubMix Carbon&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>gemini</category>
      <category>api</category>
    </item>
    <item>
      <title>Gemini 4 Carbon API Migration: 400 Errors, Timeouts and Output Limits</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Wed, 11 Nov 2026 16:12:26 +0000</pubDate>
      <link>https://dev.to/aihubmix/gemini-4-carbon-api-migration-400-errors-timeouts-and-output-limits-3h0d</link>
      <guid>https://dev.to/aihubmix/gemini-4-carbon-api-migration-400-errors-timeouts-and-output-limits-3h0d</guid>
      <description>&lt;p&gt;Carbon keeps Argon's request schema, but several values now fail validation and long thinking changes the timeout and billing profile. The native Interactions/background rules below come from Google's Carbon guide; AIHubMix documents all four protocol surfaces for Carbon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Safe defaults
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;gemini-4-carbon&lt;/code&gt; and keep &lt;code&gt;max_tokens&lt;/code&gt; at or below 65,536 on AIHubMix; the model page lists that as the max output and does not publish a larger path.&lt;/li&gt;
&lt;li&gt;For Google's native long-decode path, set HTTP read timeouts to 15–20 minutes per stream.&lt;/li&gt;
&lt;li&gt;Remove &lt;code&gt;temperature&lt;/code&gt;, &lt;code&gt;top_p&lt;/code&gt; and &lt;code&gt;top_k&lt;/code&gt; (ignored). Remove penalties; &lt;code&gt;candidate_count&lt;/code&gt; above 1 returns 400 in Google's Carbon guide.&lt;/li&gt;
&lt;li&gt;For Google-native background interactions, send &lt;code&gt;store=true&lt;/code&gt; and an explicit &lt;code&gt;max_output_tokens&lt;/code&gt;; these fields are not documented for Carbon on AIHubMix.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Documented 400s
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Trigger&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Native &lt;code&gt;max_output_tokens&lt;/code&gt; above 1,048,576&lt;/td&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Stay within the native cap; keep AIHubMix at ≤65,536&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;frequency_penalty&lt;/code&gt; or &lt;code&gt;presence_penalty&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Remove the fields&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;candidate_count&lt;/code&gt; above 1&lt;/td&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Omit or set to 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Native background without &lt;code&gt;store=true&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Add &lt;code&gt;store=true&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;History ends on a model turn&lt;/td&gt;
&lt;td&gt;Rejected&lt;/td&gt;
&lt;td&gt;End on a user turn&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Native &lt;code&gt;thinking_budget&lt;/code&gt; or &lt;code&gt;MINIMAL&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;400 on native Carbon&lt;/td&gt;
&lt;td&gt;Use low/medium/high&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;temperature&lt;/code&gt;, &lt;code&gt;top_p&lt;/code&gt; and &lt;code&gt;top_k&lt;/code&gt; are ignored. In Google's native Carbon fields, &lt;code&gt;thinking_budget&lt;/code&gt; and &lt;code&gt;thinking_level=MINIMAL&lt;/code&gt; are validation errors. In Google's OpenAI compatibility layer, &lt;code&gt;reasoning_effort=minimal&lt;/code&gt; maps to &lt;code&gt;low&lt;/code&gt;; AIHubMix's model data lists low/medium/high with a medium default, but the alias mapping still needs a test. Do not combine &lt;code&gt;reasoning_effort&lt;/code&gt; and &lt;code&gt;thinking_level&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quiet failures
&lt;/h2&gt;

&lt;p&gt;The standard output ceiling is 65,536. Google's native long-decode path can reach up to 1,048,576 tokens minus the input, with 131,072 and 262,144 as examples, but the OpenAI compatibility layer cannot retrieve continuation tokens; keep the AIHubMix request at 65,536 or below. A low cap such as 8,192 can stop the model while it is thinking and return &lt;code&gt;incomplete&lt;/code&gt; with empty text; completed work is still billed.&lt;/p&gt;

&lt;p&gt;Carbon defaults to medium thinking. Explicit caching is unsupported; implicit caching begins at 4,096 tokens. Google's guide recommends sequential tool turns, while AIHubMix lists tool calling and documents &lt;code&gt;tool_choice="auto"&lt;/code&gt;; forced-tool behaviour beyond &lt;code&gt;auto&lt;/code&gt; is unconfirmed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Timeouts and billing
&lt;/h2&gt;

&lt;p&gt;Does a 60-second cutoff allow the first answer token to arrive? Artificial Analysis measured Carbon High at 67.1 seconds, Carbon Medium at 23.2, Carbon Low at 12.9 and Argon High at 40.1.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs4fsp0jpx3nhixr57cpc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs4fsp0jpx3nhixr57cpc.png" alt="Seconds to first answer token: Carbon High 67.1, Medium 23.2, Low 12.9; Argon High 40.1. Only Carbon High exceeds the 60-second reference." width="800" height="722"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First answer token only, not total request duration. Source: &lt;a href="https://artificialanalysis.ai/models/gemini-4-carbon" rel="noopener noreferrer"&gt;Artificial Analysis&lt;/a&gt;, 11 November 2026.&lt;/p&gt;

&lt;p&gt;Carbon High crosses the 60-second reference in this measurement. That does not establish a safe timeout for the whole request: Google's separate recommendation of 15–20-minute HTTP read timeouts applies to its native long-decode streams. These are one snapshot's results, not latency guarantees or an AIHubMix test.&lt;/p&gt;

&lt;p&gt;Thinking tokens count as output. Every native long-decode hop is billed, including hops containing only thinking, and cancelled work is billed for completed segments. Google Search grounding has 5,000 free requests per month, then $14 per 1,000 (daily cap 1,500).&lt;/p&gt;

&lt;p&gt;Google's Vertex rule for completions over 32K that fail after a timeout is vendor-only; AIHubMix has not published whether it applies. Carbon and Argon rates double on December 1 ($2/$10/$0.10 to $4/$20/$0.20); AIHubMix's post-December price is unknown.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minimal Chat Completions request
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&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="s2"&gt;"https://aihubmix.com/v1"&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="s2"&gt;"AIHUBMIX_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"gemini-4-carbon"&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="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Reply with OK."&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="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="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="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;AIHubMix documents Chat Completions, Messages, Responses and Gemini for Carbon. Claude Code (Messages) and Codex (Responses) both have a documented route; still smoke-test the exact client before wiring either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;gemini-4-carbon&lt;/code&gt; selected.&lt;/li&gt;
&lt;li&gt;No sampling parameters or penalties.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;candidate_count&lt;/code&gt; omitted or 1.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;max_tokens&lt;/code&gt; ≤65,536; native long-decode timeout ≥15 minutes.&lt;/li&gt;
&lt;li&gt;Only one reasoning control field; native &lt;code&gt;MINIMAL&lt;/code&gt; and &lt;code&gt;thinking_budget&lt;/code&gt; are invalid.&lt;/li&gt;
&lt;li&gt;Prefer sequential tool turns on Google native; AIHubMix lists tool calling and records &lt;code&gt;tool_choice="auto"&lt;/code&gt;, but forced-tool values still need a test.&lt;/li&gt;
&lt;li&gt;No explicit cache calls.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep reading: the Gemini 4 Carbon series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Compare the sibling model: &lt;a href="https://dev.to/aihubmix/gemini-4-carbon-vs-argon-same-price-when-is-carbon-worth-it-4dn1"&gt;Gemini 4 Carbon vs Argon: Same Price, When Is Carbon Worth It?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Compare agentic coding choices: &lt;a href="https://dev.to/aihubmix/gemini-4-carbon-vs-fable-52-which-one-for-agentic-coding-35ca"&gt;Gemini 4 Carbon vs Fable 5.2: Which One for Agentic Coding?&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.cloud.google.com/gemini-enterprise-agent-platform/models/guides/gemini-4-carbon" rel="noopener noreferrer"&gt;Gemini 4 Carbon guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aistudio.google.com/docs/long-decode" rel="noopener noreferrer"&gt;Google long decode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aistudio.google.com/docs/pricing" rel="noopener noreferrer"&gt;Google pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aihubmix.com/model/gemini-4-carbon" rel="noopener noreferrer"&gt;AIHubMix Carbon&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>gemini</category>
      <category>api</category>
    </item>
    <item>
      <title>Gemini 4 Carbon vs Argon: Same Price, When Is Carbon Worth It?</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Wed, 11 Nov 2026 16:11:02 +0000</pubDate>
      <link>https://dev.to/aihubmix/gemini-4-carbon-vs-argon-same-price-when-is-carbon-worth-it-4dn1</link>
      <guid>https://dev.to/aihubmix/gemini-4-carbon-vs-argon-same-price-when-is-carbon-worth-it-4dn1</guid>
      <description>&lt;p&gt;Gemini 4 Carbon is Argon with more thinking per turn. Google documents native long decode up to 1,048,576 tokens minus input, while AIHubMix documents all four protocol surfaces and a 65,536-token max output; keep gateway requests at or below that cap. Google charges the same introductory rate ($2/M input, $10/M output through November 30, 2026; $4/$20 from December 1), but Carbon spends more tokens and waits longer before its first answer.&lt;/p&gt;

&lt;p&gt;For queue-based coding agents, the trade can pay off. Artificial Analysis's 2026-11-11T05:23Z snapshot measured Carbon High at 60.03 (#4 of 104), $7.76 per task and 25.6 minutes, versus Argon High at 50.41, $9.95 and 29.0 minutes. First token was slower: 67.1 seconds versus 40.1.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes in an Argon migration
&lt;/h2&gt;

&lt;p&gt;Carbon is based on Argon. The model ID is &lt;code&gt;gemini-4-carbon&lt;/code&gt;. Google documents a 1,048,576-token context window, low/medium/high thinking with medium as the default, and a 65,536-token standard output cap. Google's native long-decode path can reach up to 1,048,576 tokens minus the input, with 131,072 and 262,144 as examples. AIHubMix documents all four protocol surfaces and a 65,536-token max output, so keep gateway requests at or below that cap until a larger path is documented. Google says upgrading from Argon requires no request schema changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measurements that matter
&lt;/h2&gt;

&lt;p&gt;Does Carbon deliver a higher AA index for less money per completed task? Plotting quality against task cost makes the four configurations easier to compare.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqyf7vncu1tt3pohkuqtb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqyf7vncu1tt3pohkuqtb.png" alt="Cost-quality scatter: Carbon High $7.76 per task and 60.03 AA index, Medium $6.59 and 58.26, Low $7.19 and 54.22, and Argon High $9.95 and 50.41." width="800" height="844"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AA index versus USD per task. Source: Artificial Analysis, November 11, 2026. Costs use standard list prices of $4/M input and $20/M output; exact values follow in the table.&lt;/p&gt;

&lt;p&gt;Carbon High sits above and to the left of Argon High: a higher index at lower task cost. Medium is the cheapest Carbon setting in this run; Low is a latency choice rather than the lowest-cost choice. These are AA task costs, not AIHubMix request bills.&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;AA index&lt;/th&gt;
&lt;th&gt;$/task&lt;/th&gt;
&lt;th&gt;Min/task&lt;/th&gt;
&lt;th&gt;First token&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Carbon High&lt;/td&gt;
&lt;td&gt;60.03&lt;/td&gt;
&lt;td&gt;7.76&lt;/td&gt;
&lt;td&gt;25.6&lt;/td&gt;
&lt;td&gt;67.1 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Carbon Medium&lt;/td&gt;
&lt;td&gt;58.26&lt;/td&gt;
&lt;td&gt;6.59&lt;/td&gt;
&lt;td&gt;23.3&lt;/td&gt;
&lt;td&gt;23.2 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Carbon Low&lt;/td&gt;
&lt;td&gt;54.22&lt;/td&gt;
&lt;td&gt;7.19&lt;/td&gt;
&lt;td&gt;22.6&lt;/td&gt;
&lt;td&gt;12.9 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Argon High&lt;/td&gt;
&lt;td&gt;50.41&lt;/td&gt;
&lt;td&gt;9.95&lt;/td&gt;
&lt;td&gt;29.0&lt;/td&gt;
&lt;td&gt;40.1 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;AA uses standard $4/$20 prices. Carbon Low costs more per task than Medium in this snapshot, so treat Low as a latency setting rather than a discount setting.&lt;/p&gt;

&lt;p&gt;The Coding Agent Index v2 puts Antigravity CLI + Carbon High at #4 (59.4, $7.74/task, 29.8 minutes) and Argon High at #11 (53.2, $11.73/task, 34.7 minutes). Fable 5.2 is not on that index.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to pick which
&lt;/h2&gt;

&lt;p&gt;Carbon fits vendor-native batch or background agent jobs, quality-sensitive work and loops that can wait for a longer first token. Background mode is listed as a capability, but its native request fields are not documented. Argon fits interactive coding, autocomplete and any product with a tight latency budget. Test the same 20–50 real requests through both and record first-token time and completed-task cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  AIHubMix request shape
&lt;/h2&gt;

&lt;p&gt;AIHubMix documents Carbon on Chat Completions, Messages, Responses and native Gemini, with text, image, audio, video and PDF input. What remains unconfirmed is parameter-level: &lt;code&gt;reasoning_effort&lt;/code&gt; mapping, forced tool calls and the native long-decode path. Keep &lt;code&gt;max_tokens&lt;/code&gt; at or below 65,536; no live request was run for this post.&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&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="s2"&gt;"https://aihubmix.com/v1"&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="s2"&gt;"AIHUBMIX_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"gemini-4-carbon"&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="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Summarise this incident report and list follow-ups."&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="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;16384&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="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;h2&gt;
  
  
  Keep reading: the Gemini 4 Carbon series
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Migration errors and timeout settings: &lt;a href="https://dev.to/aihubmix/gemini-4-carbon-api-migration-400-errors-timeouts-and-output-limits-3h0d"&gt;Gemini 4 Carbon API Migration: 400 Errors, Timeouts and Output Limits&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Agentic coding comparison: &lt;a href="https://dev.to/aihubmix/gemini-4-carbon-vs-fable-52-which-one-for-agentic-coding-35ca"&gt;Gemini 4 Carbon vs Fable 5.2: Which One for Agentic Coding?&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://deepmind.google/models/model-cards/gemini-4-carbon/" rel="noopener noreferrer"&gt;Gemini 4 Carbon model card&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aistudio.google.com/docs/whats-new-gemini-4-carbon" rel="noopener noreferrer"&gt;Google AI Studio: what's new&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://artificialanalysis.ai/models/gemini-4-carbon" rel="noopener noreferrer"&gt;Artificial Analysis: Gemini 4 Carbon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aihubmix.com/model/gemini-4-carbon" rel="noopener noreferrer"&gt;AIHubMix: Gemini 4 Carbon&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>gemini</category>
      <category>api</category>
    </item>
    <item>
      <title>Qwen4-Max-Preview returned an empty reply at max_tokens 300: here's why</title>
      <dc:creator>AIHubMix</dc:creator>
      <pubDate>Wed, 11 Nov 2026 14:23:28 +0000</pubDate>
      <link>https://dev.to/aihubmix/qwen4-max-preview-returned-an-empty-reply-at-maxtokens-300-heres-why-iji</link>
      <guid>https://dev.to/aihubmix/qwen4-max-preview-returned-an-empty-reply-at-maxtokens-300-heres-why-iji</guid>
      <description>&lt;p&gt;A 300-token &lt;code&gt;max_tokens&lt;/code&gt; used to be a safe cap for a short answer. On Qwen4-Max-Preview it returned HTTP 200 with an empty &lt;code&gt;content&lt;/code&gt;. Alibaba changed what &lt;code&gt;max_tokens&lt;/code&gt; covers: on this model it limits the thinking and the answer together, so the reasoning can use up the budget before the answer starts.&lt;/p&gt;

&lt;p&gt;This post reproduces that on AIHubMix, shows the fixes, and covers the settings that matter when you point a coding agent at the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Alibaba opened &lt;a href="https://www.alibabacloud.com/help/en/model-studio/qwen4-max-preview" rel="noopener noreferrer"&gt;Qwen4-Max-Preview&lt;/a&gt; on November 11, 2026, as the next-generation flagship of its Qwen family. Alibaba itself offers it only through Token Plan, a Credits-billed subscription for coding tools, with no pay-as-you-go option. The preview runs until 24:00 on November 25, 2026 (UTC+8), which is 16:00 UTC, and Alibaba retires the model after that.&lt;/p&gt;

&lt;p&gt;AIHubMix is the first platform to offer it as a per-token API. It has served the model since launch day as &lt;a href="https://aihubmix.com/model/coding-qwen4-max-preview" rel="noopener noreferrer"&gt;&lt;code&gt;coding-qwen4-max-preview&lt;/code&gt;&lt;/a&gt; on the OpenAI-compatible endpoint. AIHubMix labels the channel a preview service that "may be unstable and is recommended for testing and evaluation."&lt;/p&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;Base URL &lt;code&gt;https://aihubmix.com/v1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Model ID &lt;code&gt;coding-qwen4-max-preview&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reproducing the empty reply
&lt;/h2&gt;

&lt;p&gt;AIHubMix ran this request on November 11, 2026:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s https://aihubmix.com/v1/chat/completions \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $AIHUBMIX_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "model": "coding-qwen4-max-preview",
    "max_tokens": 300,
    "messages": [{"role": "user", "content": "How many pairs of positive integers (x, y) with x &amp;gt; y satisfy x^2 - y^2 = 2024? List them."}]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response, trimmed to the relevant fields:&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;"finish_reason"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"length"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"content"&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;"usage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"prompt_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"completion_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"completion_tokens_details"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"reasoning_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;300&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All 300 tokens went to reasoning, and the answer never started. Nothing errors, so a client that only reads &lt;code&gt;content&lt;/code&gt; sees an empty string and may treat it as a valid reply. With &lt;code&gt;max_tokens: 16384&lt;/code&gt;, the same prompt finished normally: 1,206 completion tokens, 608 of them reasoning, and the correct answer (four pairs).&lt;/p&gt;

&lt;p&gt;The same check with the OpenAI Python SDK:&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&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="s2"&gt;"https://aihubmix.com/v1"&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="s2"&gt;"AIHUBMIX_API_KEY"&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="s2"&gt;"coding-qwen4-max-preview"&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;300&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="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"How many pairs of positive integers (x, y) with x &amp;gt; y satisfy x^2 - y^2 = 2024? List them."&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="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;choice&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="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;finish_reason&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"length"&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;choice&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="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Budget used up before the answer started: raise the limit or lower reasoning_effort"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;choice&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;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;Alibaba's &lt;a href="https://www.alibabacloud.com/help/en/model-studio/api-compatibility-upgrade-notice" rel="noopener noreferrer"&gt;API compatibility notice&lt;/a&gt;, dated November 2, announced the change, and the model page repeats it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Starting with qwen4-max-preview, max_tokens is equivalent to max_completion_tokens. Both limit the combined tokens for thinking and the final answer. Thinking consumes part of the same budget, so a limit previously sized for the answer alone may truncate output.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On Qwen3.8-Max, &lt;code&gt;max_tokens&lt;/code&gt; limits the answer only; thinking sits outside it. The other differences on Alibaba's published specs:&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;Qwen4-Max-Preview&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;1M&lt;/td&gt;
&lt;td&gt;1M&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maximum output&lt;/td&gt;
&lt;td&gt;131,072&lt;/td&gt;
&lt;td&gt;393,216&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What max_tokens limits&lt;/td&gt;
&lt;td&gt;Answer only&lt;/td&gt;
&lt;td&gt;Thinking + answer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Thinking default&lt;/td&gt;
&lt;td&gt;On, xhigh&lt;/td&gt;
&lt;td&gt;On, xhigh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Effort levels&lt;/td&gt;
&lt;td&gt;low, medium, xhigh&lt;/td&gt;
&lt;td&gt;low, medium, xhigh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input&lt;/td&gt;
&lt;td&gt;Text, image, video&lt;/td&gt;
&lt;td&gt;Text, image, video&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Official access&lt;/td&gt;
&lt;td&gt;Pay-as-you-go, Token Plan&lt;/td&gt;
&lt;td&gt;Token Plan only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Status&lt;/td&gt;
&lt;td&gt;Available&lt;/td&gt;
&lt;td&gt;Retires after Nov 25&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Qwen4-Max-Preview's output limit is shared by thinking and the final answer. Thinking controls keep the same names and levels, so code that already sets &lt;code&gt;reasoning_effort&lt;/code&gt; for Qwen3.8 carries over. Alibaba's launch page lists no benchmark scores, and we found no independent benchmark of this preview as of November 11.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Size limits for thinking plus answer.&lt;/strong&gt; Remove old answer-only caps, or raise them well above what the answer needs. Alibaba marks &lt;code&gt;max_tokens&lt;/code&gt; as "to be deprecated" and recommends &lt;code&gt;max_completion_tokens&lt;/code&gt; for new integrations. On this model the two mean the same thing, so renaming alone fixes nothing: &lt;code&gt;max_completion_tokens: 300&lt;/code&gt; returned the same empty reply on AIHubMix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cap thinking directly when you need a short reply.&lt;/strong&gt; Set &lt;code&gt;reasoning_effort&lt;/code&gt; to &lt;code&gt;low&lt;/code&gt;, or to &lt;code&gt;none&lt;/code&gt; to turn thinking off. In AIHubMix's test, &lt;code&gt;none&lt;/code&gt; answered a short coding prompt in 43 completion tokens with no reasoning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check &lt;code&gt;finish_reason&lt;/code&gt; on every call.&lt;/strong&gt; Treat &lt;code&gt;"length"&lt;/code&gt; with an empty &lt;code&gt;content&lt;/code&gt; as a failure to retry with a larger budget, not as an answer.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Thinking controls
&lt;/h2&gt;

&lt;p&gt;Thinking is on by default. Alibaba's &lt;a href="https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-chat-completions" rel="noopener noreferrer"&gt;Chat Completions reference&lt;/a&gt; documents the details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Levels&lt;/strong&gt;: &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, and &lt;code&gt;xhigh&lt;/code&gt; (the default). &lt;code&gt;max&lt;/code&gt; and &lt;code&gt;high&lt;/code&gt; become &lt;code&gt;xhigh&lt;/code&gt;, &lt;code&gt;minimal&lt;/code&gt; becomes &lt;code&gt;low&lt;/code&gt;, and &lt;code&gt;none&lt;/code&gt; turns thinking off. Any other value returns an error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budgets&lt;/strong&gt;: if you don't set &lt;code&gt;thinking_budget&lt;/code&gt;, the levels map to thinking budgets of 4,096 (&lt;code&gt;low&lt;/code&gt;), 16,384 (&lt;code&gt;medium&lt;/code&gt;), and 262,144 (&lt;code&gt;xhigh&lt;/code&gt;) tokens. If you set neither, the same page says the default is &lt;code&gt;xhigh&lt;/code&gt; with a 131,072-token budget. By that mapping, sending &lt;code&gt;xhigh&lt;/code&gt; explicitly allows up to twice the default thinking budget. This is how the docs describe it; AIHubMix hasn't measured it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't combine&lt;/strong&gt;: Alibaba documents setting &lt;code&gt;reasoning_effort&lt;/code&gt; and &lt;code&gt;thinking_budget&lt;/code&gt; together as an error. One AIHubMix test that sent both returned normally, so the channel may not reject the pair, but nothing documents which setting takes effect. Send only one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-turn&lt;/strong&gt;: return earlier thinking in each assistant message's &lt;code&gt;reasoning_content&lt;/code&gt; field, never inside &lt;code&gt;content&lt;/code&gt;. Leaving it out doesn't cause an error, but sending it back is billed as input.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Through AIHubMix, &lt;code&gt;low&lt;/code&gt; and &lt;code&gt;none&lt;/code&gt; were accepted, and the thinking arrived in &lt;code&gt;reasoning_content&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a session costs
&lt;/h2&gt;

&lt;p&gt;Alibaba publishes no per-token price for Qwen4-Max-Preview: its only official route is Token Plan, billed in Credits. On AIHubMix the channel bills per token: $0.353 per million input tokens, $1.059 per million output tokens, and $0.0441 per million cached input tokens.&lt;/p&gt;

&lt;p&gt;One coding-agent session, with assumptions rather than measurements: 40 turns, each sending 60,000 input tokens, of which 50,000 are a cached repository prefix, and each writing 3,000 output tokens, thinking included.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;One session on AIHubMix&lt;/th&gt;
&lt;th&gt;Tokens&lt;/th&gt;
&lt;th&gt;Price per 1M&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Uncached input&lt;/td&gt;
&lt;td&gt;400,000&lt;/td&gt;
&lt;td&gt;$0.353&lt;/td&gt;
&lt;td&gt;$0.141&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cached input&lt;/td&gt;
&lt;td&gt;2,000,000&lt;/td&gt;
&lt;td&gt;$0.0441&lt;/td&gt;
&lt;td&gt;$0.088&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output, thinking included&lt;/td&gt;
&lt;td&gt;120,000&lt;/td&gt;
&lt;td&gt;$1.059&lt;/td&gt;
&lt;td&gt;$0.127&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,520,000&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0.356&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Cache hits aren't guaranteed, and AIHubMix hasn't measured them on this channel. With no cache hits, the same session costs about $0.974.&lt;/p&gt;

&lt;p&gt;Two details move this number in practice. Thinking counts as output: in AIHubMix's usage data, reasoning tokens are part of &lt;code&gt;completion_tokens&lt;/code&gt;, and thinking runs at xhigh by default. And Alibaba turns on &lt;code&gt;preserve_thinking&lt;/code&gt; by default for this model: earlier thinking that your client sends back in &lt;code&gt;reasoning_content&lt;/code&gt; "is included in the input token count and is billed," so long agent sessions grow their input faster than the visible conversation suggests.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code&lt;/strong&gt; uses the Anthropic Messages API. The AIHubMix model page lists only &lt;code&gt;/v1/chat/completions&lt;/code&gt;, but one test request to AIHubMix's &lt;code&gt;/v1/messages&lt;/code&gt; with this model ID returned a normal response with separate thinking and text blocks. That was a single request without tools, not a Claude Code session. For running Claude Code on non-Claude models, AIHubMix documents a separate setup, &lt;a href="https://docs.aihubmix.com/en/api/CC-any" rel="noopener noreferrer"&gt;Claude Code with any LLM&lt;/a&gt;: install its &lt;code&gt;@aihubmix/claude-code&lt;/code&gt; package, set &lt;code&gt;default&lt;/code&gt;, &lt;code&gt;think&lt;/code&gt;, and &lt;code&gt;longContext&lt;/code&gt; under &lt;code&gt;Router&lt;/code&gt; in &lt;code&gt;~/.aihubmix-claude-code/config.json&lt;/code&gt; to &lt;code&gt;coding-qwen4-max-preview&lt;/code&gt;, then run &lt;code&gt;acc start&lt;/code&gt; and &lt;code&gt;acc code&lt;/code&gt;. We haven't run that setup with this model, so try the smoke test below first. Anthropic's documentation doesn't support routing non-Claude models to Claude Code through a gateway, so this setup is unsupported on Anthropic's side.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen Code&lt;/strong&gt; connects through the OpenAI-compatible endpoint: &lt;code&gt;OPENAI_BASE_URL=https://aihubmix.com/v1&lt;/code&gt; and &lt;code&gt;OPENAI_MODEL=coding-qwen4-max-preview&lt;/code&gt;. Its context-size table gives IDs that start with &lt;code&gt;qwen4&lt;/code&gt; a 1M window. Our ID starts with &lt;code&gt;coding-&lt;/code&gt;, matches no row, and falls back to the 200,000-token default. That is a reading of the code, not a measured run. Expect Qwen Code to compact the conversation long before 1M. If you need the full length, set &lt;code&gt;model.generationConfig.contextWindowSize&lt;/code&gt; to 1000000 in &lt;code&gt;~/.qwen/settings.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenCode, Cline, Cursor and other OpenAI-compatible tools&lt;/strong&gt;: add a custom model with the same base URL and ID. Check the context window, which tools often don't know for new IDs, and any default &lt;code&gt;max_tokens&lt;/code&gt; the tool sends. A small default will now cut into thinking.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ol&gt;
&lt;li&gt;Send one Chat Completions request and confirm &lt;code&gt;reasoning_content&lt;/code&gt; and a non-empty &lt;code&gt;content&lt;/code&gt; come back.&lt;/li&gt;
&lt;li&gt;Give the agent a small task in a scratch repository: fix one failing unit test across two files. Success means the tests pass and the diff touches only what it should.&lt;/li&gt;
&lt;li&gt;Watch for &lt;code&gt;finish_reason: "length"&lt;/code&gt; in your tool's logs or its usage view. If it shows up, raise the output limit or lower &lt;code&gt;reasoning_effort&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Repeat the task at &lt;code&gt;reasoning_effort: "low"&lt;/code&gt; and compare time and output tokens. This tells you which level to run day to day.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What wasn't verified
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tool calling and structured outputs: Alibaba documents both for this model, but AIHubMix hasn't published capability flags for this channel yet, and its model guide says their absence means "unverified, not unsupported." Step 2 of the smoke test is your tool-calling check.&lt;/li&gt;
&lt;li&gt;Claude Code end to end: only one bare Messages request was tested.&lt;/li&gt;
&lt;li&gt;Cache hit rates on this channel.&lt;/li&gt;
&lt;li&gt;The Qwen Code 200,000-token fallback comes from reading the source, not from a run.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For production work, Qwen3.8-Max has the same 1M context, an official pay-as-you-go price, and no announced retirement date, and your &lt;code&gt;max_tokens&lt;/code&gt; settings keep their old meaning there. If you test both, the &lt;a href="https://aihubmix.com/compare/coding-qwen4-max-preview/qwen3.8-max" rel="noopener noreferrer"&gt;side-by-side comparison on AIHubMix&lt;/a&gt; lists their specs and prices; only the model ID changes.&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.alibabacloud.com/help/en/model-studio/qwen4-max-preview" rel="noopener noreferrer"&gt;Alibaba Cloud Model Studio: Qwen4-Max-Preview&lt;/a&gt; (accessed November 11, 2026)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-chat-completions" rel="noopener noreferrer"&gt;Alibaba Cloud Model Studio: Chat Completions API reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.alibabacloud.com/help/en/model-studio/token-plan-personal-overview" rel="noopener noreferrer"&gt;Alibaba Cloud Model Studio: Token Plan (Personal Edition)&lt;/a&gt; (accessed November 11, 2026)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.alibabacloud.com/help/en/model-studio/qwen3-8-max" rel="noopener noreferrer"&gt;Alibaba Cloud Model Studio: Qwen3.8-Max&lt;/a&gt; (accessed November 11, 2026)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aihubmix.com/model/coding-qwen4-max-preview" rel="noopener noreferrer"&gt;AIHubMix: Coding Qwen4 Max Preview&lt;/a&gt; (prices checked November 11, 2026; live tests run 10:22–10:48 UTC)&lt;/li&gt;
&lt;/ol&gt;

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