---
title: "Gemini 4 Hydrogen"
description: "A closed Google model with a 1M context window and image, audio, video and file input. It ranks near the top on science and math benchmarks but is priced well above the median."
canonical: https://pydantic.dev/models/list/gemini-4-hydrogen/
---

# Gemini 4 Hydrogen

> A closed Google model with a 1M context window and image, audio, video and file input. It ranks near the top on science and math benchmarks but is priced well above the median.
>
> Markdown copy of https://pydantic.dev/models/list/gemini-4-hydrogen/. Index for agents: https://pydantic.dev/models/llms.txt

**Agents: use the API for model information.** It answers a question in one request, where the pages need several.

- Choose a model for an agent: `POST https://pydantic.dev/models/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://pydantic.dev/models/select.md
- Search models by name: `GET https://pydantic.dev/models/api/search?query=<text>`
- List, filter and sort models: `GET https://pydantic.dev/models/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://pydantic.dev/models/api/models/<slug>`
- Any other question about the models: `GET https://pydantic.dev/models/api/ask?query=<question>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of all but the single model. An `OPTIONS` request to any endpoint returns its schema. The same five are tools of the MCP server at `https://pydantic.dev/models/mcp`. More: https://pydantic.dev/models/usage.md

Use it with Pydantic AI as `gateway/google-cloud:gemini-4-hydrogen`.

## Spec sheet

- **Family:** Gemini
- **Released:** 12 Nov 2026
- **Weights:** closed
- **Context window:** 1,048,576 tokens
- **Largest response:** 65,536 tokens
- **Accepts:** text, image, audio, video, file
- **Tool calling:** yes
- **Knowledge cutoff:** 2026-03
- **Intelligence index:** 81 (rank 3)
- **Scores updated:** 2026-11-30
- **Price:** $1.5 input, $7.5 output, $3 blended per 1M tokens
- **Index points per $:** 27 (rank 59)
- **Speed:** 134.5 tokens/sec (rank 21)
- **Popularity:** rank 36 of 194 by usage
- **Pydantic AI Gateway:** built in

## Benchmarks

### Pydantic AI benchmarks

Our own benchmarks, each about 10 tasks run once with tool calling and once in code mode (https://pydantic.dev/models/codemode.md). Not part of the intelligence index. Cost is the mean cost of one task. For the combined score, code mode is compared over the four benchmarks run in both modes.

| Benchmark                                                                                      | Tool calling | Code mode | Change | Cost per task | Cost per task, code mode | Rank     | Runs                                                                    |
| ---------------------------------------------------------------------------------------------- | ------------ | --------- | ------ | ------------- | ------------------------ | -------- | ----------------------------------------------------------------------- |
| [Pydantic AI Combined](https://pydantic.dev/models/benchmarks/pydantic_ai.md)                  | 84.3%        | 85.6%     | +1.7   | $0.31         | $0.29                    | 5 of 44  | https://pydantic.dev/models/list/gemini-4-hydrogen/pydantic_ai.md       |
| [Pydantic AI - Billing ops](https://pydantic.dev/models/benchmarks/billing_ops.md)             | 90%          | 100%      | +10    | $0.58         | $0.079                   | 4 of 44  | https://pydantic.dev/models/list/gemini-4-hydrogen/billing_ops.md       |
| [Pydantic AI - Customer support](https://pydantic.dev/models/benchmarks/customer_support.md)   | 60%          | 60%       | ±0     | $0.11         | $0.16                    | 3 of 44  | https://pydantic.dev/models/list/gemini-4-hydrogen/customer_support.md  |
| [Pydantic AI - SQL data analysis](https://pydantic.dev/models/benchmarks/sql_data_analysis.md) | 100%         | 90%       | −10    | $0.38         | $0.36                    | 1 of 44  | https://pydantic.dev/models/list/gemini-4-hydrogen/sql_data_analysis.md |
| [Pydantic AI - Research & deck](https://pydantic.dev/models/benchmarks/research_deck.md)       | 85.9%        | 92.6%     | +6.7   | $0.71         | $0.57                    | 14 of 44 | https://pydantic.dev/models/list/gemini-4-hydrogen/research_deck.md     |
| [Pydantic AI - Structured output](https://pydantic.dev/models/benchmarks/structured_output.md) | 100%         | –         | –      | $0.060        | –                        | 1 of 44  | https://pydantic.dev/models/list/gemini-4-hydrogen/structured_output.md |
| [Pydantic AI - LLM Judge](https://pydantic.dev/models/benchmarks/llm_judge.md)                 | 70%          | –         | –      | $0.032        | –                        | 18 of 44 | https://pydantic.dev/models/list/gemini-4-hydrogen/llm_judge.md         |
| [Pydantic AI - Cyber Willing](https://pydantic.dev/models/benchmarks/cyber_willing.md)         | 44.4%        | –         | –      | $0.034        | –                        | 30 of 32 | https://pydantic.dev/models/list/gemini-4-hydrogen/cyber_willing.md     |

### Other benchmarks


| Benchmark                | Score  | Rank among models tested | What it measures                                                                                 | Source                                    |
| ------------------------ | ------ | ------------------------ | ------------------------------------------------------------------------------------------------ | ----------------------------------------- |
| Intelligence index       | 81     | 3                        | Our composite of the benchmarks below, 0-100                                                     | Pydantic, from the sources credited below |
| GPQA Diamond             | 96.8%  | 1                        | Graduate-level science questions, multiple choice                                                | Epoch AI (CC BY 4.0)                      |
| OTIS Mock AIME           | 100%   | 1                        | Competition mathematics problems with exact answers                                              | Epoch AI (CC BY 4.0)                      |
| FrontierMath             | 88.1%  | 13                       | Original research-level mathematics problems, tiers 1 to 3                                       | Epoch AI (CC BY 4.0)                      |
| ARC-AGI-2                | 92.5%  | 8                        | Abstract visual puzzles that test learning a new rule from a few examples                        | ARC Prize, via Epoch AI (CC BY 4.0)       |
| SimpleQA Verified        | 70.9%  | 10                       | Short factual questions answered from memory, without search                                     | Epoch AI (CC BY 4.0)                      |
| APEX-Agents              | 78%    | 5                        | Long professional tasks (banking, consulting, law) passed on the first attempt                   | Mercor, via Epoch AI (CC BY 4.0)          |
| LMArena text             | 1502.1 | 8                        | Rating from blind human votes between pairs of chat responses                                    | LMArena (CC BY 4.0)                       |
| FrontierMath Tier 4      | 87.8%  | 11                       | Research-level mathematics problems, the hardest tier, with checkable answers                    | Epoch AI (CC BY 4.0)                      |
| Chess Puzzles            | 60%    | 12                       | Find the single best move in a chess position                                                    | Epoch AI (CC BY 4.0)                      |
| Mystery Game Puzzles     | 65%    | 9                        | Best-move puzzles in an undisclosed well-known game                                              | Epoch AI (CC BY 4.0)                      |
| Furniture Assembly       | 57.5%  | 14                       | Spot assembly mistakes in photos of flat-pack furniture builds                                   | Epoch AI (CC BY 4.0)                      |
| SimpleBench              | 91.7%  | 4                        | Six-option trick questions that test common sense                                                | SimpleBench, via Epoch AI (CC BY 4.0)     |
| ALE-Bench                | 1825.7 | 19                       | Hard optimisation contest problems, as a rating against human contestants                        | Sakana AI, via Epoch AI (CC BY 4.0)       |
| Epoch Capabilities Index | 166.5  | 10                       | Epoch AI's own composite across about 40 benchmarks; shown for comparison, not part of our index | Epoch AI (CC BY 4.0)                      |

## Providers and prices

US dollars per million tokens.

| Provider     | Gateway  | Pydantic AI string                       | Input | Cached input | Output |
| ------------ | -------- | ---------------------------------------- | ----- | ------------ | ------ |
| Google Cloud | built in | `gateway/google-cloud:gemini-4-hydrogen` | $1.5  | $0.075       | $7.5   |

## Use Gemini 4 Hydrogen with Pydantic AI

### hello.py

Ask Gemini 4 Hydrogen a question with a Pydantic AI agent and print the answer. Run it with uv run hello.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os

from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent('gateway/google-cloud:gemini-4-hydrogen', instructions='Be concise, reply with one sentence.')

result = agent.run_sync('Where does "hello world" come from?')
print(result.output)
```

### structured_output.py

Get validated, typed output from Gemini 4 Hydrogen by giving the agent a Pydantic model. Run it with uv run structured_output.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os

from pydantic import BaseModel
from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'


class CityLocation(BaseModel):
    city: str
    country: str


agent = Agent('gateway/google-cloud:gemini-4-hydrogen', output_type=CityLocation)

result = agent.run_sync('Where were the olympics held in 2012?')
print(result.output)
#> city='London' country='United Kingdom'
```

### tools.py

Give Gemini 4 Hydrogen two tools to call, one of which reads the agent's dependencies. Run it with uv run tools.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os
import random

from pydantic_ai import Agent, RunContext

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent(
    'gateway/google-cloud:gemini-4-hydrogen',
    deps_type=str,
    instructions="You're a dice game, roll the die and see if it matches the user's guess.",
)


@agent.tool_plain
def roll_dice() -> str:
    """Roll a six-sided die and return the result."""
    return str(random.randint(1, 6))


@agent.tool
def get_player_name(ctx: RunContext[str]) -> str:
    """Get the player's name."""
    return ctx.deps


result = agent.run_sync('My guess is 4', deps='Anne')
print(result.output)
```

### streaming.py

Stream Gemini 4 Hydrogen's reply to the terminal as it is generated. Run it with uv run streaming.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import asyncio
import os

from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent('gateway/google-cloud:gemini-4-hydrogen')


async def main():
    async with agent.run_stream('Explain prompt caching in three bullet points.') as response:
        async for text in response.stream_text(delta=True):
            print(text, end='', flush=True)


asyncio.run(main())
```

### pax.sh

Code with Gemini 4 Hydrogen in your terminal using Pax, the Pydantic AI coding agent. On macOS, open a new terminal after installing, so pax isn't the system's archiver.

```sh
# uv tool install pydantic-ai-pax
export PYDANTIC_AI_GATEWAY_API_KEY='...'

pax -m 'gateway/google-cloud:gemini-4-hydrogen'
```

### ai_sdk.ts

Call Gemini 4 Hydrogen from TypeScript with the Vercel AI SDK, through Pydantic AI Gateway.

```ts
// npm install ai @ai-sdk/google-vertex
import { createVertex } from '@ai-sdk/google-vertex'
import { generateText } from 'ai'

process.env.PYDANTIC_AI_GATEWAY_API_KEY = '...'

const googleCloud = createVertex({
  baseURL: 'https://gateway.pydantic.dev/proxy/google-vertex',
  apiKey: process.env.PYDANTIC_AI_GATEWAY_API_KEY,
})

const { text } = await generateText({
  model: googleCloud('gemini-4-hydrogen'),
  system: 'Be concise, reply with one sentence.',
  prompt: 'Where does "hello world" come from?',
})
console.log(text)
```

## About Gemini 4 Hydrogen

Gemini 4 Hydrogen costs $1.5 per million input tokens and $7.5 per million output tokens, has a 1M token context window and scores 81 on our intelligence index, #3 of 101.

Gemini 4 Hydrogen is a closed model from Google, released in November 2026. It accepts text, image, audio, video and file inputs, with a 1M token context window and up to 65k tokens of output. Tool calling, reasoning mode and structured output are all supported.

Its benchmark results are strong. It ranks sixth of 114 on the intelligence index with 81.4 against a median of 59.5, and first on GPQA Diamond and OTIS Mock AIME. It also places fifth of 60 on APEX-Agents, while its FrontierMath result of 88.1% is 13th of 80.

The cost is the main drawback. At $1.5 per million input tokens and $7.5 per million output tokens, its blended price is $3, roughly three times the registry median, and it is served only through Google Cloud.

**Strengths**

- GPQA Diamond 96.8%, 1st of 94 models tested
- OTIS Mock AIME 100%, 1st of 95 models tested
- Intelligence index 81.4, 6th of 114 against a median of 59.5
- APEX-Agents 78%, 5th of 60 models tested

**Weaknesses**

- Blended price $3 per million tokens, 132nd of 194 on price rank
- Available only from one provider, Google Cloud
- Efficiency rank 69 of 194, below its intelligence rank

**Best for:** Agents needing strong reasoning, math or science answers from long multimodal inputs, where cost per token matters less.

## How it did on the Pydantic AI benchmarks

Written by an LLM from reviews of every run.

#### Overall
This model passed most cases across five benchmarks: Billing ops (tools 90%, code mode 100%), Research & deck (tools 86%, code mode 93%), Structured output (tools 100%), LLM Judge (tools 70%) and SQL data analysis (tools 100%, code mode 90%). It reads source data thoroughly and re-checks figures before answering, and it recovers from tool errors on the next call. Its failures came from incomplete coverage of large datasets, over-strict judgments, and one ambiguous rule interpretation.

#### Strengths
- In Structured output it passed 10 of 10 cases in a single `accounts` call each, keeping group and parent figures apart, scaling £000 accounts by 1,000 and getting signs right in every case.
- In Billing ops all four change cases passed, with corrections run as `update_attendance`, `void_invoice` and `create_invoice` in order and payments allocated oldest due date first.
- In Research & deck both runs read every text, CSV, table, PDF and image before asking the founder, and recomputed the £4.40m run-rate and 39.4% gross margin before using them.
- In SQL data analysis it handled service days, repeats, untimed-call interpolation and after-midnight trips correctly in both modes, and fixed every tool error on the next call.
- In LLM Judge each reason cited the specific slide, invoice, date or quoted phrase it relied on, and 23 of 24 seed-deck verdicts matched the reference majority.

#### Weaknesses
- In Billing ops `large-wrong_invoices-1` with tool calling it fetched only about 30 of 384 invoices and relied on shortcuts, finding 6 of 12 wrong invoices.
- In LLM Judge all three failures were over-strict "no" verdicts, while some "yes" verdicts on contradiction and false-promise questions did not address the claims in question.
- In SQL data analysis at least 11 of 20 runs hit a DuckDB parser error from an unquoted `at` column, and the code-mode `tour` failure came from modelling the 15-minute stay rule differently.
- In Research & deck the tool-calling run never asked about slide order or naming, re-sent the whole 51,967-character deck after `check_deck` already returned `ok`, and both final notes ran to 2,200–2,900 characters.
- In Structured output it returned 0 where `null` was likely intended in three cases and omitted a zero line, though the checks did not penalise these.

#### Tool calling compared with code mode
- In Billing ops code mode was about 7x cheaper ($0.79 vs $5.76) and passed the large audit that tool calling failed, because it joined records in the sandbox instead of pulling thousands into context.
- In Billing ops code mode guessed nonexistent pagination keys (`has_more`, `next_page`) in five cases, and on small lookups tool calling was slightly cheaper and used 1 to 2 fewer requests.
- In Research & deck code mode cost $0.57 against $0.71 despite five more requests, but re-extracted the same PDFs in separate calls because each sandbox call started fresh.
- In SQL data analysis code mode ran the hardest cases in 28–31 requests versus 35–37 with tools, but cost more on simple cases due to 60–115k-character SVGs.
- In SQL data analysis code mode also hit sandbox limits such as `time.monotonic()`, `date.timetuple()` and `next()` on a generator.

Prices come from [genai-prices](https://github.com/pydantic/genai-prices), in US dollars per million tokens. Benchmark scores come from Epoch AI and LMArena (CC BY 4.0), Browser Use, and our own Pydantic AI benchmarks (CC BY 4.0); the index and its sources are described at https://pydantic.dev/models/methodology.md. Data built 2026-11-30. This model from the API: `https://pydantic.dev/models/api/models/gemini-4-hydrogen`. Compare it with others: `https://pydantic.dev/models/api/models?slug=gemini-4-hydrogen,<other slug>`
