---
title: "Gemini 4 Carbon"
description: "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."
canonical: https://pydantic.dev/models/list/gemini-4-carbon/
---

# 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.
>
> Markdown copy of https://pydantic.dev/models/list/gemini-4-carbon/. 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-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:** 82.4 (rank 2)
- **Scores updated:** 2026-11-30
- **Price:** $2 input, $10 output, $4 blended per 1M tokens
- **Index points per $:** 20.6 (rank 67)
- **Speed:** 40 tokens/sec (rank 150)
- **Popularity:** rank 19 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)                  | 83.5%        | 82.2%     | −5.6   | $0.58         | $0.53                    | 7 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/pydantic_ai.md       |
| [Pydantic AI - Billing ops](https://pydantic.dev/models/benchmarks/billing_ops.md)             | 100%         | 100%      | ±0     | $1.10         | $0.12                    | 1 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/billing_ops.md       |
| [Pydantic AI - Customer support](https://pydantic.dev/models/benchmarks/customer_support.md)   | 60%          | 40%       | −20    | $0.18         | $0.24                    | 3 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/customer_support.md  |
| [Pydantic AI - SQL data analysis](https://pydantic.dev/models/benchmarks/sql_data_analysis.md) | 100%         | 100%      | ±0     | $0.73         | $0.65                    | 1 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/sql_data_analysis.md |
| [Pydantic AI - Research & deck](https://pydantic.dev/models/benchmarks/research_deck.md)       | 91.1%        | 88.9%     | −2.2   | $1.32         | $1.14                    | 7 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/research_deck.md     |
| [Pydantic AI - Structured output](https://pydantic.dev/models/benchmarks/structured_output.md) | 100%         | –         | –      | $0.082        | –                        | 1 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/structured_output.md |
| [Pydantic AI - LLM Judge](https://pydantic.dev/models/benchmarks/llm_judge.md)                 | 50%          | –         | –      | $0.047        | –                        | 32 of 44 | https://pydantic.dev/models/list/gemini-4-carbon/llm_judge.md         |
| [Pydantic AI - Cyber Willing](https://pydantic.dev/models/benchmarks/cyber_willing.md)         | 41.7%        | –         | –      | $0.073        | –                        | 31 of 32 | https://pydantic.dev/models/list/gemini-4-carbon/cyber_willing.md     |

### Other benchmarks


| Benchmark                | Score  | Rank among models tested | What it measures                                                                                 | Source                                    |
| ------------------------ | ------ | ------------------------ | ------------------------------------------------------------------------------------------------ | ----------------------------------------- |
| Intelligence index       | 82.4   | 2                        | 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)                       |
| FrontierMath Tier 4      | 95.1%  | 6                        | Research-level mathematics problems, the hardest tier, with checkable answers                    | Epoch AI (CC BY 4.0)                      |
| Chess Puzzles            | 78%    | 3                        | Find the single best move in a chess position                                                    | Epoch AI (CC BY 4.0)                      |
| Mystery Game Puzzles     | 73%    | 7                        | Best-move puzzles in an undisclosed well-known game                                              | Epoch AI (CC BY 4.0)                      |
| Furniture Assembly       | 77.5%  | 8                        | Spot assembly mistakes in photos of flat-pack furniture builds                                   | Epoch AI (CC BY 4.0)                      |
| SimpleBench              | 92.6%  | 3                        | Six-option trick questions that test common sense                                                | SimpleBench, via Epoch AI (CC BY 4.0)     |
| ALE-Bench                | 2374.7 | 9                        | Hard optimisation contest problems, as a rating against human contestants                        | Sakana AI, via Epoch AI (CC BY 4.0)       |
| Epoch Capabilities Index | 169.1  | 4                        | 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-carbon` | $2    | $0.1         | $10    |

## Use Gemini 4 Carbon with Pydantic AI

### 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

Code with Gemini 4 Carbon 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-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 costs $2 per million input tokens and $10 per million output tokens, has a 1M token context window and scores 82.4 on our intelligence index, #2 of 101.

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 Cloud 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 Cloud, 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.

## How it did on the Pydantic AI benchmarks

Written by an LLM from reviews of every run.

#### Overall
The model passed every run on Billing ops, Structured output and SQL data analysis, scored 91% (tools) and 89% (code mode) on Research & deck, and 50% on LLM Judge. Its answers were accurate on rule-heavy calculations, unit and sign handling, and exhaustive search, with no provider-side format failures in single-request tasks. Its main costs were brute-force data pulling in tool-calling mode, very large single-shot writes, and repeated small query and sandbox errors. As a judge it leaned one way, toward over-strict "no" verdicts.

#### Strengths
- On Billing ops it got all 16 wrong-invoice amounts right in both modes, including half-up rounding cases, and carried out multi-step write sequences (update, void, re-create; oldest-first payment allocation) correctly.
- On Structured output it passed all 10 cases in a single request each, correctly scaling £000 figures, keeping signs consistent, and separating group from parent figures that differed by small amounts.
- On SQL data analysis it handled service-day bitmasks, interpolation, after-midnight service and walk rules in every run, and evaluated all 120 and all 24 orders in the tour cases.
- On Research & deck it batched research reads in parallel, recomputed figures before writing, and in code mode flagged a conflict between a case study and the orders table.
- On LLM Judge its reasons quoted specific evidence such as invoice ids, card endings and slide numbers, and it cross-checked claims against account JSON.

#### Weaknesses
- On LLM Judge all 5 failures were over-strict "no" verdicts, including treating unsupported or polite statements as contradictions and adding requirements not in the question.
- On Research & deck in tool mode it wrote a 74,324-character file in one call taking 487 s, then started re-sending the whole file and hit the 1200 s limit.
- On Billing ops in tools mode it pulled nearly all records into context for large audits, for example 1.36 MB and $4.48 on large wrong_invoices.
- On SQL data analysis it left the reserved column `at` unquoted in 19 of 20 runs, and spent 3 to 15 extra requests re-checking answers it already had.
- On Structured output it was inconsistent on unscored fields, writing 0 where a dash appeared on one side only and using mixed shapes for empty objects.

#### Tool calling compared with code mode
- On Billing ops both modes scored 100%, but code mode cut total cost from about $11.03 to $1.15 by filtering in Python, for example missed_billed fell from $3.69 to $0.12.
- On Research & deck code mode passed and tool mode timed out, because code mode built the deck from templates and patched it with string replacement instead of re-emitting full HTML as a tool argument.
- On SQL data analysis code mode used 13% fewer requests and cost 11% less, with the largest gains on timed_tour (40 to 26 requests), though one_change got worse (21 to 29 requests).
- Across Billing ops small cases and SQL data analysis, code mode sometimes added requests and introduced errors tool calling did not hit, such as `KeyError` on error dicts, sandbox limits and a 30-second time-out.
- Only tool-calling runs exist for Structured output and LLM Judge, so those benchmarks give no basis for comparing the modes.

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-carbon`. Compare it with others: `https://pydantic.dev/models/api/models?slug=gemini-4-carbon,<other slug>`
