Google made Gemini 4 Carbon generally available on 10 November 2026. It is the new top-end reasoning model in the Gemini 4 family, built for long agentic jobs such as multi-step debugging, architecture reviews, dense document analysis and security auditing. This guide shows you how to call it from Python, how to pick a thinking level, how to generate very long outputs, and what to change if you are migrating from Gemini 4 Argon or Gemini 3.

What Gemini 4 Carbon is (and when not to use it)

According to Google’s launch post and the developer guide, Carbon is tuned to spend more thinking tokens than Argon. It explores hypotheses, verifies its work and checks edge cases before it answers. That makes it slower and more token-hungry per turn, so it is not the right default for every request.

  • Use Carbon for hard root-cause debugging, multi-package migrations, architectural design, synthesis over large PDFs and spreadsheets, scientific reasoning and security review.
  • Keep Argon (gemini-4-argon) for interactive coding, everyday feature work and fast production loops where latency matters.

Both models share the same unified 1M-token context window (1,048,576 tokens shared between input, thinking and output), the same built-in tools and the same per-token price.

Pricing and availability

Carbon is available on the paid tier of the Gemini API and in Google AI Studio. It is not on the free tier. Introductory pricing runs until 30 November 2026:

  • Input: $2 per 1M tokens ($4 from 1 December 2026)
  • Output, including thinking tokens: $10 per 1M tokens ($20 from 1 December 2026)
  • Implicitly cached input: discounted by 95%

Because thinking tokens are billed as output, the thinking level you choose has a direct effect on cost. Plan your evaluation budget with that in mind.

Step 1: Install the SDK and set your key

The examples below use the official google-genai Python SDK and the Interactions API, which is what Google’s Carbon guide uses.

pip install -U google-genai
export GEMINI_API_KEY="your-paid-tier-key"

The client reads GEMINI_API_KEY from the environment, so you do not need to hard-code it.

Step 2: Your first request

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-carbon",
    input="Review this function for race conditions and explain the fix:\n\n"
          "def transfer(a, b, amount):\n"
          "    if a.balance >= amount:\n"
          "        a.balance -= amount\n"
          "        b.balance += amount\n",
)

print(interaction.output_text)

The model ID is simply gemini-4-carbon. If you do not set a thinking level, the default is medium.

Step 3: Choose a thinking level

The thinking level is your main control over quality, latency and spend. Carbon accepts low, medium (default) and high:

Level Best for
low Simple or cost-sensitive work, light analysis and writing
medium Most tasks, including complex code and agent workflows
high Hard math and science, the most difficult code and agent tasks
interaction = client.interactions.create(
    model="gemini-4-carbon",
    input="Design a migration plan to split our monolith's billing module into a service.",
    generation_config={"thinking_level": "high"},
)
print(interaction.output_text)

Google’s advice is practical: run your evaluation set at all three levels, then pick the lowest level that meets your quality bar.

Set max_output_tokens with thinking in mind

max_output_tokens caps thinking and answer tokens together. If it is too low, the model can spend the budget thinking and cut the answer short. The guide recommends at least 32,768 for apps that currently use a smaller limit. If you want to spend less, lower the thinking level rather than squeezing the token limit.

Step 4: Long outputs with background execution

A normal synchronous response stops at 65,536 tokens. For longer outputs, set background=True and raise max_output_tokens. The server then generates the response in 64K-token hops, and each hop appears as a model_output step. Poll until it finishes, then join the text:

import time
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-4-carbon",
    input="Write a complete technical design doc for a multi-tenant job scheduler.",
    background=True,
    generation_config={
        "max_output_tokens": 131072,
        "thinking_level": "high",
    },
)

while interaction.status in ("in_progress", "queued"):
    time.sleep(5)
    interaction = client.interactions.get(id=interaction.id)

text = "".join(
    content.text
    for step in interaction.steps
    if step.type == "model_output"
    for content in step.content
    if content.type == "text"
)
print(text)
print("Usage:", interaction.usage)

Note: if you set background to true but leave out max_output_tokens, the server still stops after 64K tokens.

Step 5: Multi-turn conversations

For chats and function-calling loops, Google recommends keeping state on the server with previous_interaction_id instead of resending the full history each time:

first = client.interactions.create(
    model="gemini-4-carbon",
    input="Here is our API error log summary: ... What is the most likely root cause?",
)

follow_up = client.interactions.create(
    model="gemini-4-carbon",
    previous_interaction_id=first.id,
    input="Write a failing test that reproduces it.",
)
print(follow_up.output_text)

Migration checklist

From Gemini 4 Argon

  • Change the model string from gemini-4-argon to gemini-4-carbon. No request schema changes are needed.
  • Expect longer reasoning passes. Make sure max_output_tokens and HTTP timeouts allow for them.

From Gemini 3 and earlier

  • Remove sampling parameters. temperature, top_p and top_k are ignored by Carbon.
  • Drop explicit context caching. cachedContents / caches.create are not supported. Implicit caching is on by default for prompts of at least 4,096 tokens.
  • Raise timeouts. Hard prompts can take several minutes. Use background execution, or set client timeouts to at least 15 minutes.
  • Re-check cost estimates. Every processed token is billed, including thinking tokens and tool instructions when grounding is used.

Practical tips

  • Route by difficulty. Send routine requests to Argon and escalate only hard ones to Carbon. A simple rule (for example, “failed once on Argon” or “touches more than N files”) keeps costs predictable.
  • Log usage per request. Print or store interaction.usage so you can see how much each thinking level really costs on your workload.
  • Use it in Copilot too. GitHub announced the same day that Gemini 4 Carbon is rolling out in Copilot for Pro+, Max, Business and Enterprise users.

Key takeaway

Gemini 4 Carbon is a “think harder” model: call it with the model ID gemini-4-carbon, start at the default medium thinking level, give it a generous output budget, and use background execution for very long answers. Keep Argon for fast everyday work, and move to Carbon where depth and verification are worth the extra tokens. Check the official Gemini 4 Carbon guide before you change production settings, especially with the price change on 1 December.