
Gemini 4 Hydrogen vs 3.8 Flash: Tested Cost and Speed
Gemini 4 Hydrogen is the right upgrade from Gemini 3.8 Flash for anything that makes the model think: on a hard reasoning prompt it answered in 5 seconds instead of 39 and cost half as much. On easy extraction it costs about twice as much until December 31, because its per-token price is double 3.8 Flash's launch discount. That's from 54 benchmark requests and about 40 migration probes I ran this morning, two days after Hydrogen went GA. All 54 answers were correct. The part that will actually bite you is quieter: a low maxOutputTokens cap that worked fine on 3.8 Flash now returns an empty string.
What Changed From Gemini 3.8 Flash to Gemini 4 Hydrogen?
Google released gemini-4-hydrogenon November 12, 2026, two days after Gemini 4 Carbon. It's the cheap, fast member of the Gemini 4 family, and Google calls it the recommended upgrade from 3.8 Flash and every older Gemini 3 and 2.5 model. It also replaced the default model in the Antigravity managed agent. The headline API changes, per Google's what's new page: thinking defaults to high instead of medium, there's a new xhigh level, explicit caching is gone, sampling parameters are ignored, and one 1M-token window is shared by input, thinking and output.
Here's the price sheet per million tokens:
| Per MTok | 3.8 Flash (to Dec 31) | 4 Hydrogen | 4 Carbon (to Nov 30) |
|---|---|---|---|
| Input | $0.75 (then $1.50) | $1.50 | $2.00 (then $4.00) |
| Output, thinking included | $3.75 (then $7.50) | $7.50 | $10.00 (then $20.00) |
| Cached input | $0.075 + storage | $0.075, implicit only | $0.10, implicit only |
| Default thinking level | medium | high | medium |
| Levels | low, medium, high | low, medium, high, xhigh | low, medium, high |
| Free tier | Yes | Yes | No |
Hydrogen's price is exactly what 3.8 Flash will cost on January 1, 2027. So the price question has a deadline. For the next seven weeks every Hydrogen token costs twice a 3.8 Flash token. After that they cost the same, and the only thing that decides your bill is how many tokens each model burns per task. That's what I measured.
Is Gemini 4 Hydrogen Faster Than 3.8 Flash?
Yes, on everything I threw at it. I picked three tasks that look like real automation work: pull five fields out of a sales email as JSON, fix an off-by-one bug in a median() function, and a five-job scheduling puzzle whose constraints contradict each other. That last one is a trap. There is no valid order, and a model that guesses an answer is fabricating. Each model ran each task three times at its default thinking level. Numbers are medians, cost is at paid-tier list prices from usageMetadata.
| Task | 3.8 Flash (medium) | 4 Hydrogen (high) | Result |
|---|---|---|---|
| JSON extraction from an email | 3.94 s, 368 thinking, $0.0017 | 2.74 s, 368 thinking, $0.0035 | Hydrogen 1.2 s faster, 2x the cost |
| Fix a buggy median() function | 6.92 s, 608 thinking, $0.0026 | 4.06 s, 739 thinking, $0.0064 | Hydrogen faster, 2.5x the cost |
| Unsolvable scheduling puzzle | 38.8 s, 3,861 thinking, $0.0148 | 4.95 s, 915 thinking, $0.0075 | Hydrogen 8x faster, half the cost |
The puzzle row is the whole story. Both models correctly said no order exists. 3.8 Flash got there by grinding through 3,600-5,000 thinking tokens and 36-48 seconds. Hydrogen needed about 900 tokens and 5 seconds. Pushing 3.8 Flash to highmade it worse: 6,100-11,800 thinking tokens, 59-105 seconds, $0.0345 a request. For an agent loop that hits a few hard steps per run, that's the difference between a user waiting and a user leaving.
On the easy tasks the picture flips on cost. Hydrogen spent about the same number of thinking tokens as 3.8 Flash on the extraction, so the double per-token price came straight through as a double bill. It did write slightly better code: all three default-level Hydrogen fixes used sorted() and raised a ValueErroron an empty list, while one of three 3.8 Flash fixes still mutated the caller's list with xs.sort(). Every fix passed my test cases.
Is Gemini 4 Hydrogen Cheaper?
Only where 3.8 Flash overthinks. Today Hydrogen cost 2x on extraction, 2.5x on the bug fix and 0.5x on the puzzle. Re-price the same runs at January 2027 rates and 3.8 Flash's extraction goes to $0.0035 (a tie), its bug fix to $0.0052 (Hydrogen still about 20% more) and its puzzle to $0.0296 (Hydrogen 4x cheaper).
Two small billing details showed up too. countTokensreports 38 tokens for a one-line prompt on Hydrogen and 8 on 3.8 Flash, and every benchmark prompt came in 29-30 tokens higher. That fixed overhead is billed, but at $1.50 per million it's noise. On a long 30 KB document Hydrogen actually counted fewer tokens (8,190 vs 8,299), so the tokenizer itself is a little more efficient.
My rule: move reasoning and agent traffic now, and leave high-volume extraction on 3.8 Flash until December 31 or try it on Hydrogen at low. If a job is pure classification, the docs still point you at Gemini 3.5 Flash-Lite, and I'd test that before paying Hydrogen rates for it. I did the same kind of tiering for image models in my Nano Banana 2.1 vs Pro vs Lite test.
Which Thinking Level Should You Use on Hydrogen?
I ran the same three tasks at all four levels, three times each. Median latency and cost per request:
| thinkingLevel | Extraction | Bug fix | Puzzle |
|---|---|---|---|
| low | 2.60 s / $0.0034 | 2.93 s / $0.0040 | 3.48 s / $0.0050 |
| medium | 2.59 s / $0.0037 | 4.76 s / $0.0060 | 5.02 s / $0.0078 |
| high (default) | 2.74 s / $0.0035 | 4.06 s / $0.0064 | 4.95 s / $0.0075 |
| xhigh | 4.01 s / $0.0061 | 17.0 s / $0.0271 | 12.6 s / $0.0180 |
Three things stood out. First, medium and high were basically the same modelon these tasks. Medium even used slightly more thinking tokens on the extraction and the puzzle. Don't expect dropping from the default to medium to save you much.
Second, lowwas the cheapest and fastest everywhere and got every answer right, but its bug fixes skipped the empty-list guard that medium, high and xhigh all added. That's the trade in one example: low does the task, high does the task plus the edge case.
Third, xhighcost 1.7-4x more than high and didn't change a single answer. On the bug fix it thought for 1,900-4,200 tokens about a four-line function. Google's own guide warns it can overthink simple prompts, and it does. Keep it for the step in your pipeline where high actually fails your eval. If you're coming from Claude, this maps closely to the trade-offs in my effort parameter guide.
What Breaks When You Swap the Model ID?
I sent the same edge-case requests to both models. Here's what came back:
| Request | 3.8 Flash | 4 Hydrogen |
|---|---|---|
| maxOutputTokens 512 on a hard prompt | Partial answer text, MAX_TOKENS (2/2) | Empty text, MAX_TOKENS (4/4) |
| maxOutputTokens 2048 at xhigh | xhigh not supported (400) | Empty text, 2,045 thinking tokens (2/2) |
| cachedContents.create | 200, cache of 8,299 tokens | 400: explicit caching not supported |
| thinkingLevel minimal | 400 | 400 |
| temperature 0.2 / 3.0 | 200 / 400 range error | 200 (ignored) / 400 range error |
| Legacy thinkingBudget 0 | 200, no thinking tokens | 200, still thought (13 tokens) |
| countTokens on a 1-line prompt | 8 tokens | 38 tokens |
The empty response trap
maxOutputTokens caps thinking and answer together. When 3.8 Flash ran out, it still handed back a partial answer, which most code at least logs. Hydrogen spent the entire budget thinking and returned nothing visible:
# gemini-4-hydrogen, thinkingLevel xhigh, maxOutputTokens 512
finishReason: MAX_TOKENS
text: ""
usageMetadata: {promptTokenCount: 97, thoughtsTokenCount: 509,
candidatesTokenCount: 3, totalTokenCount: 609}The request is a 200, so nothing throws. If your code reads response.textand moves on, an empty string flows into your next node, your CRM field or your user's chat. At the default level, a 1,024 cap was enough for the puzzle; at xhigh, 2,048 still came back empty in both runs. I've seen the same failure shape with structured output in n8n, which I wrote up in why the structured output parser stops working.
Fix it in two places: raise the cap (Google suggests the 65,536 default) and treat empty text plus MAX_TOKENS as an error. This is the helper I tested against the live API:
import json, os, urllib.request
def ask(prompt, level="medium", max_out=65536):
body = {
"contents": [{"role": "user", "parts": [{"text": prompt}]}],
"generationConfig": {
"maxOutputTokens": max_out,
"thinkingConfig": {"thinkingLevel": level},
},
}
req = urllib.request.Request(
"https://generativelanguage.googleapis.com/v1beta/models/gemini-4-hydrogen:generateContent",
data=json.dumps(body).encode(),
headers={"Content-Type": "application/json",
"x-goog-api-key": os.environ["GEMINI_API_KEY"]},
)
res = json.load(urllib.request.urlopen(req))
cand = res["candidates"][0]
text = "".join(p.get("text", "") for p in cand["content"].get("parts", [])
if not p.get("thought"))
if not text and cand.get("finishReason") == "MAX_TOKENS":
raise RuntimeError(
f"thinking used the whole budget: {res['usageMetadata']}")
return textExplicit caching returns 400
cachedContents.create works on 3.8 Flash and fails on Hydrogen with Explicit caching is not supported for models/gemini-4-hydrogen. If you pre-cache a big system prompt or a document, that code path dies on the switch. Implicit caching does kick in: the second and third calls with the same 8,204-token prompt each had 6,150 tokens billed as cached, about 75%. Keep the long, stable part of your prompt first and you get most of the discount for free.
Silent changes: temperature and thinkingBudget
temperature: 0.2 is accepted and ignored. Out-of-range values like 3.0 still return 400 on both models, so a bad config fails loudly but a tuned one quietly stops doing anything. The legacy thinkingBudget field is also accepted without complaint. Setting it to 0 turned thinking off on 3.8 Flash for a one-word reply, while Hydrogen still thought for 13 tokens. Use thinkingLevel; thinking on Hydrogen doesn't switch off, which is the same direction Anthropic took (see turning off thinking on Opus and Sonnet 5.5). Finally, minimalreturns 400 on Hydrogen. 3.8 Flash already rejected it, so this only hits you if you're jumping from 3.6 Flash or older. Going the other way, a fallback from Hydrogen to 3.8 Flash with xhigh still set returns 400 too.
How Do You Migrate From 3.8 Flash to Hydrogen?
- Grep for
maxOutputTokens. Anything under a few thousand is a candidate for empty responses. Raise it and control spend withthinkingLevelinstead. - Add the empty-text check from the helper above anywhere a model response feeds another system.
- Delete explicit caching for Hydrogen requests and move the stable prefix to the top of the prompt.
- Set
thinkingLevelon every call. Don't inherit the newhighdefault on extraction jobs; uselowthere. - Remove sampling params, change the model ID, re-run your evals and log
usageMetadataper task, so the cost comparison is yours and not mine.
Should You Switch to Gemini 4 Hydrogen Now?
For agents, coding steps and anything with real reasoning: yes, this week. Eight times faster and half the price on the hard prompt is not a marginal gain, and the answers were just as correct. For bulk extraction and classification, I'd keep 3.8 Flash until its discount ends, then re-run the numbers, because on January 1 the price gap closes and Hydrogen's speed becomes free.
One honest caveat: three runs per cell on launch week is a snapshot, not a benchmark suite. Latency will move as Google adds capacity. The empty-response behavior and the 400s won't; those are API rules, and they're what you should fix before you flip the model string.
Gemini 4 Hydrogen FAQ
Is Gemini 4 Hydrogen better than Gemini 3.8 Flash?
For work that makes the model think, yes. On a hard reasoning prompt Hydrogen answered in about 5 seconds versus 39 on 3.8 Flash and cost half as much. On easy extraction both were correct, Hydrogen was a second faster, and it cost about twice as much until 3.8 Flash's price doubles on January 1, 2027.
How much does Gemini 4 Hydrogen cost?
$1.50 per million input tokens and $7.50 per million output tokens, thinking tokens included, flat across the 1M context. Cached input is $0.075 per million through implicit caching only. Batch is half price. It is also on the Gemini API free tier with rate limits.
Why does Gemini 4 Hydrogen return an empty response?
Usually because maxOutputTokens is too low. The cap covers thinking and answer together, and Hydrogen thinks more by default. In my tests a 512-token cap returned empty text with finishReason MAX_TOKENS every time, and at xhigh even 2,048 did. Raise the cap or lower thinkingLevel.
Which thinking level should I use on Gemini 4 Hydrogen?
Use low for extraction, classification and high-volume calls, and the default high for agents and reasoning. In my runs medium cost about the same as high, and xhigh cost 1.7-4x more without changing a single answer, so reserve it for tasks where high actually fails.
Does Gemini 4 Hydrogen support context caching?
Only implicit caching. cachedContents.create returns 400 'Explicit caching is not supported for models/gemini-4-hydrogen'. Implicit caching worked in my test: repeating an 8,204-token prompt got 6,150 tokens billed as cached on the second and third call.
How I Tested
November 14, 2026, from a Mac mini in Allen, TX, against the Gemini API generateContent REST endpoint with no SDK. The benchmark was 3 tasks x 6 configs (3.8 Flash at default and high, Hydrogen at low, medium, default and xhigh) x 3 runs = 54 requests, six in parallel, all with HTTP 200. Latency is wall-clock per request. Costs are computed from usageMetadata (prompt, thoughts and candidates tokens) at paid-tier list prices, so they are estimates of what the same calls would cost on a paid key. Code answers were graded by running them against five test lists, and the puzzle was graded on whether the model said no valid order exists. The migration probes were separate one-off requests. The whole run, probes included, came to roughly half a dollar at list prices.
Moving a Pipeline to Gemini 4?
I build AI automations that run every day in production. Send me your workflow and a day of usage logs and I'll tell you which steps belong on Hydrogen, which should stay on a cheaper model, and where the empty responses will hit.
Related Posts
AI Models
Claude Fable 5.2 vs Fable 5.1: Tested Speed and Cost
Fable 5.2 tested the day after launch: 79 vs 55 tokens/s, 21-23% cheaper per request, a later first token, and the four API changes that return 400s if you only swap the model ID.
AI Models
Nano Banana 2.1 vs Pro vs Lite: Gemini Image API Tested
Same prompt, five Gemini image models, 37 real API calls. At 2K, Nano Banana 2.1 is $0.0504 per image vs $0.101 on Nano Banana 2 and $0.134 on Pro, but it thinks and runs a few seconds slower. Lite is 1K only and the fastest at about 3 s.
AI Models
Claude Sonnet 4.5 Deprecation: Migrate to Sonnet 5.5
claude-sonnet-4-5-20250929 retires on the Claude API on 30 November 2026. I sent the same requests to Sonnet 4.5 and Sonnet 5.5: seven came back 400, the tokenizer counted 24% more, and the default config cost 29% more until I set effort.