# Gemini 4 Carbon

> A closed, large-context model from Google, ranked first on the registry's composite intelligence index at 87. It accepts text, image, audio, video and file inputs, and costs more than the median.

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

## Spec sheet

- **Family:** Gemini
- **Released:** 10 Nov 2026
- **Weights:** closed
- **Context window:** 1,048,576 tokens
- **Largest response:** 32,768 tokens
- **Accepts:** text, image, audio, video, file
- **Tool calling:** yes
- **Knowledge cutoff:** 2026-03
- **Intelligence index:** 87 (rank 1)
- **Price:** $2 input, $10 output, $4 blended per 1M tokens
- **Index points per $:** 21.8 (rank 74)
- **Speed:** 40 tokens/sec (rank 150)
- **Popularity:** rank 15 of 194 by usage
- **Pydantic AI Gateway:** built in

## Benchmarks

| Benchmark | Score | Rank among models tested | What it measures | Source |
| --- | --- | --- | --- | --- |
| Intelligence index | 87 | 1 | Our composite of the benchmarks below, 0-100 | Pydantic, from the sources credited below |
| GPQA Diamond | 96.5% | 3 | 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 | 90.5% | 8 | Original research-level mathematics problems, tiers 1 to 3 | Epoch AI (CC BY 4.0) |
| ARC-AGI-2 | 94.2% | 3 | Abstract visual puzzles that test learning a new rule from a few examples | ARC Prize, via Epoch AI (CC BY 4.0) |
| SimpleQA Verified | 77.7% | 3 | Short factual questions answered from memory, without search | Epoch AI (CC BY 4.0) |
| SciCode | 64.2% | 3 | Scientific programming problems written by researchers | SciCode, via Epoch AI (CC BY 4.0) |
| APEX-Agents | 84.2% | 1 | Long professional tasks (banking, consulting, law) passed on the first attempt | Mercor, via Epoch AI (CC BY 4.0) |
| LMArena text | 1538.9 | 1 | Rating from blind human votes between pairs of chat responses | LMArena (CC BY 4.0) |
| Epoch Capabilities Index | 169.7 | 3 | 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 Vertex | built in | `gateway/google-cloud:gemini-4-carbon` | $2 | $0.1 | $10 |

## Example code

### hello.py

Ask Gemini 4 Carbon 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-carbon', 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 Carbon 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-carbon', 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 Carbon 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-carbon',
    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 Carbon'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-carbon')


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

Chat with Gemini 4 Carbon in your terminal using pax, the TUI for pydantic-ai-harness. Coming soon.

```sh
export PYDANTIC_AI_GATEWAY_API_KEY='...'

uvx pax --model 'gateway/google-cloud:gemini-4-carbon'
```

### ai_sdk.ts

Call Gemini 4 Carbon 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-carbon'),
  system: 'Be concise, reply with one sentence.',
  prompt: 'Where does "hello world" come from?',
})
console.log(text)
```

## About Gemini 4 Carbon

Gemini 4 Carbon is a closed model from Google, released in November 2026, and it leads this registry on the composite intelligence index with a score of 87, well above the median of 59.5. Its strongest results are in mathematics and reasoning: it scores 100% on OTIS Mock AIME and 94.2% on ARC-AGI-2, and it ranks first on APEX-Agents, which measures long professional tasks such as banking, consulting and law. Its GPQA Diamond score of 96.5% ranks third of 94.

The model has a context window of 1M tokens and a maximum response of 32k tokens. It accepts text, image, audio, video and file inputs, and supports tool calling, reasoning mode and structured output. It is offered through Google Vertex only.

The main cost is price. At $2 per million input tokens and $10 per million output tokens, its blended price is $4, roughly four times the registry median, and its price rank is 147 of 194. Its efficiency rank of 74 of 194 suggests the intelligence it delivers does not fully offset that cost.

**Strengths**

- Intelligence index 87.0, 1st of 114, against a median of 59.5
- OTIS Mock AIME 100%, 1st of 95
- APEX-Agents 84.2%, 1st of 60 on long professional tasks
- ARC-AGI-2 94.2%, 3rd of 68

**Weaknesses**

- Blended price $4 per million tokens, well above the $1.01 median
- Available only through Google Vertex, a single provider
- Efficiency rank 74 of 194 shows a modest intelligence-per-dollar return

**Best for:** Agents that need top reasoning, maths or long professional task accuracy, and can accept a higher token price.

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); the index and its sources are described at https://models.pydantic.dev/methodology.md. Data built 2026-11-25. Compare with other models: https://models.pydantic.dev/models.md
