Support Gemini 4 Hydrogen (`gemini-4-hydrogen`) on `GoogleModel`
Why we make these changes
Google released Gemini 4 Hydrogen (gemini-4-hydrogen) on 2026-11-12 (announcement, what's new).
Hydrogen adds an xhigh thinking level, its deepest reasoning; high is its default and reasons less. Pydantic AI maps unified thinking='xhigh' and 'max' to HIGH on every Gemini model, so neither reaches it. Hydrogen also rejects MINIMAL, which thinking=False and 'minimal' send without a profile entry.
There is no issue for this. Mirrors #13057 (Gemini 4 Carbon).
[!WARNING]
Compatibility impact: GoogleThinkingLevel, the type of GoogleModelProfile.google_thinking_levels and GoogleRealtimeModelProfile.google_thinking_levels, gains 'XHIGH', and GOOGLE_THINKING_LEVEL_SCALE gains it as its top level. Code that matches GoogleThinkingLevel exhaustively (assert_never) stops type-checking. GOOGLE_THINKING_LEVELS keeps its value.
Why this can ship in a minor release: it only adds a level the Gemini API now accepts. Every value GoogleThinkingLevel accepted before is still accepted, and requests to models without XHIGH don't change. The API compatibility check is waived for the three changes in .github/api-compatibility-waivers/.
Migration: handle or skip 'XHIGH' in exhaustive matches over GoogleThinkingLevel.
New public surface
'gemini-4-hydrogen'inLatestGoogleModelNamesandKnownModelName(google:,google-cloud:,gateway/google:,gateway/google-cloud:).'XHIGH'inGoogleThinkingLevelandGOOGLE_THINKING_LEVEL_SCALE.GOOGLE_THINKING_LEVELS, the set assumed for a model without a documented level set, keeps its four levels.
User-visible behavior
Agent('google:gemini-4-hydrogen', model_settings={'thinking': 'xhigh'})
# before: sends thinkingLevel HIGH
# after: sends thinkingLevel XHIGH; thinking='max' does the same. Models without XHIGH still send HIGH.
Agent('google:gemini-4-hydrogen', model_settings={'thinking': False})
# before: sends thinkingLevel MINIMAL: 400 "Thinking level MINIMAL is not supported for this model"
# after: sends thinkingLevel LOW, as on gemini-4-argon and gemini-4-carbon
google-genai'sThinkingLevelenum doesn't listXHIGHin any release yet, so the SDK warnsXHIGH is not a valid ThinkingLeveland sends it anyway.docs/models/google.mdsays so.- Docs:
docs/models/google.mdnames Hydrogen in the thinking and long decode sections, and the Google row ofdocs/capabilities/thinking.mdgives thexhighmapping.
Verification
tests/test_thinking_wire_contract.py: recorded Gemini API casesgoogle-gemini-4-hydrogen-xhigh(sendsXHIGH, accepted) andgoogle-gemini-3-flash-xhigh-snaps-to-high(sendsHIGH), matched on the request body.tests/test_thinking.py:test_thinking_xhigh_reaches_only_models_that_list_it.tests/profiles/test_google.py: Hydrogen rows.tests/test_capability_spec.py,tests/models/test_model_names.py,tests/realtime/test_google.py -k thinkingandtests/models/google/test_transport.pypass locally.- Live on the Gemini API (2026-11-12):
gemini-4-hydrogenanswers 400Thinking level MINIMAL is not supported for this modeland acceptsLOW,MEDIUM,HIGHandXHIGH, as Google's thinking table lists.gemini-3-flash-previewandgemini-3.1-flash-lite-previewanswer 400Thinking level XHIGH is not supported for this model, which is why no other model gets it. generateContentongemini-4-hydrogenwith function calling (AUTO,VALIDATED,ANY), code execution, URL context, sampling parameters andmax_output_tokens=200000succeeds. The free tier's daily request limit ran out before the end-to-endGoogleModelruns; #13301 repeats them.- An httpx request hook shows
google-genai2.30 sends"thinking_level": "XHIGH"despite its warning. - Google Cloud (Vertex) and Pydantic AI Gateway: not attempted. #13301 tracks checking both live.
What changes for existing users
Nothing on models without XHIGH: xhigh and max still resolve to HIGH. Code that matches exhaustively on GoogleThinkingLevel sees a new member.
Deliberately out of scope
GoogleInteractionsModel(#12636): Hydrogen support follows once it merges.MAX: the Gemini API acceptsthinkingLevel: MAXon every model probed, but Google doesn't document it, so nothing maps to it.- Docs aliases: at $7.50 per 1M output tokens, Hydrogen fits
google:mediumunderdocs/model_aliases/AGENTS.md, butgenai-pricesdoesn't price it yet, sogoogle:mediumstays ongemini-3.8-flash, as #13057 kept Carbon out ofgoogle:large. #13301 repoints it. - OpenRouter doesn't list
google/gemini-4-hydrogenyet, so_MANDATORY_REASONING_MODEL_PREFIXESis unchanged; #13301 checksreasoning.mandatoryonce it does.
PR decisions
2026-11-10 · Interactions API out of scope
- Decision: Add the id on
GoogleModel(generateContent) only;GoogleInteractionsModelsupport follows after #12636 merges - Why: Same scope David set for Carbon (#13057)
- Session: d4f40277-53c9-4e44-ba50-af7e5b77afe1
2026-11-10 · Hydrogen thinking levels on both transports
- Decision: The level entry applies on the Gemini API and Google Cloud alike
- Why: Only the Gemini API was probed, but Vertex's thinking table lists the same
LOW,MEDIUM,HIGH,XHIGHfor Gemini 4 Hydrogen; a missing entry 400sthinking=False - Session: d4f40277-53c9-4e44-ba50-af7e5b77afe1
2026-11-12 · XHIGH for Hydrogen only
- Decision: Unified
'xhigh'and'max'map toXHIGH, and onlygemini-4-hydrogenlists it;GOOGLE_THINKING_LEVELSstays the default set, so every other model still snaps toHIGH - Why: Gemini 3 models answer 400 to
XHIGH - Session: d4f40277-53c9-4e44-ba50-af7e5b77afe1
2026-11-12 · SDK XHIGH warning documented, not suppressed
- Decision: Leave
google-genai'sUserWarning; document it - Why: No release lists
XHIGH(googleapis/python-genai#3357 ships it in 3.3, and thegoogleextra capsgoogle-genai<3, #12732); suppressing it needswarnings.catch_warnings()around anawait, which isn't safe across tasks - Session: d4f40277-53c9-4e44-ba50-af7e5b77afe1
2026-11-12 · google:medium held until genai-prices prices Hydrogen
- Decision: Leave
docs/model_aliases/aliases.jsonunchanged - Why: Tiers are read from
genai-prices, which has nogemini-4-hydrogenentry in its bundled or live data; same call as Carbon in #13057 - Session: d4f40277-53c9-4e44-ba50-af7e5b77afe1
2026-11-10 · Vertex and Gateway verification is a follow-up
- Decision: Keep the
google-cloud:andgateway/ids; check them live in #13301 - Why: No Vertex project or Gateway key is available
- Session: d4f40277-53c9-4e44-ba50-af7e5b77afe1
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.