https://x.com/i/article/2120215370787409920
Gemini 4 Carbon: Developer Guide
Today, we are making Gemini 4 Carbon available to developers, enterprises, scientists, and consumers. First announced two weeks ago and released to cybersecurity defenders via our Fairwind Program, you can now start building using the paid tier of the Gemini API in Google AI Studio and for Google AI Ultra subscribers in AI Studio and Google Antigravity.
Gemini 4 Carbon is built to explore thoroughly, reason deeply, and run extended verification loops across sustained agentic workflows. From multi-step software engineering and full-stack web apps to open-ended questions, scientific discovery, and root-cause vulnerability patching, Carbon brings more intelligence to deeply complex tasks from start to finish.
Gemini 4 Carbon model overview
In this guide, we cover how to choose between Gemini 4 Carbon and Gemini 4 Argon, what is new in the API, and practical tips for building with Carbon. For more on how Gemini 4 Carbon is being used across software engineering, finance, legal, cybersecurity, and scientific research, check out our announcement blog post.
Choosing between Gemini 4 Carbon and Gemini 4 Argon
Gemini 4 Carbon joins Gemini 4 Argon in our family of frontier models, at the same introductory token price ($2 input and $10 output per 1M tokens through November 30, 2026; $4 input and $20 output starting December 1, with 95% off cached input tokens). Both models share the same unified 1M-token context window via the Gemini API, thinking_level controls, and built-in tool support, so switching or routing between them is a single model string change.
- Reach for Gemini 4 Carbon (gemini-4-carbon) when your task tests the limits of frontier intelligence: Carbon is our strongest model and spends more thinking tokens exploring large codebases thoroughly, reasoning deeply across dense multimodal files, isolating subtle root causes, and running extended build-and-verify loops. Choose Carbon for your hardest multi-step software engineering, architectural design and code auditing, formal math and scientific discovery, high-precision financial or legal synthesis, and vulnerability research.
- Reach for Gemini 4 Argon (gemini-4-argon) for the majority of software engineering and knowledge work: Argon remains an ideal choice for most advanced software engineering and knowledge work tasks. It provides strong frontier reasoning with tighter token usage and faster turnaround on interactive coding, day-to-day feature work, and fast production loops.
- Pair them in multi-agent workflows: Assign gemini-4-carbon to roles that benefit most from deep reasoning, such as upfront architecture, task coordination, and final verification (including in Google Antigravity’s /swarm preview), while delegating parallel implementation slices to gemini-4-argon or gemini-3.8-flash.
For more details on which model to use when, see Compare Gemini models
What Gemini 4 Carbon unlocks across developer workflows
Gemini 4 Carbon delivers frontier performance across sustained, multi-step workflows that demand deep reasoning, thorough exploration, and rigorous verification.
1. Long-horizon engineering, formal verification, and security tasks: Hand Carbon a complex target - like isolating root causes across a large codebase, translating security properties into formal mathematical proofs, or tracing multi-hop software flaws and generating verified patches - and let it test hypotheses against compiler and test output until every check passes.
1. High-precision multimodal knowledge work and scientific reasoning: Point Carbon at dense repositories mixing PDFs, long videos, financial ledgers, or experimental lab data. Carbon combines exhaustive retrieval with strict schema adherence to produce grounded spreadsheets, presentations, reports, and multi-step scientific derivations.
1. Full-stack web apps, 3D environments, and physics simulations: Carbon runs disciplined build-and-verify loops across both code and rendered UI, combining frontend design taste with strong spatial reasoning across Three.js, Blender, and WebGPU to build feature-complete apps, 3D reconstructions, and simulations. Check out our companion guide, Building 3D Games and Procedural Worlds, for practical workflows.
What’s new in the API
Before diving into workflow tips, here are the key API updates to know when calling gemini-4-carbon via the Gemini API:
Controlling reasoning depth with thinking_level
Gemini 4 Carbon uses thinking_level ("low" | "medium" | "high") to control how much reasoning (thinking) the model does before responding:
- "high": Maximizes reasoning depth for multi-file root-cause debugging, security vulnerability patching, formal math, and upfront architecture design.
- "medium" (default): Recommended when you want an optimal balance of speed, cost efficiency, and high first-pass accuracy across interactive coding and agentic tool use.
- "low": Minimizes latency and cost for high-speed classification, routing, and targeted extraction.
Unified 1M input-output token limit and long decodes
Earlier Gemini models capped max output (thinking + response) at 64K tokens. In Gemini 4 Carbon (and Argon), input, thinking, and output share a unified 1M-token window in the Gemini API, and you can use long decode to generate past 64K tokens (up to 1M tokens minus your input) so Carbon can think as long as needed and still return complete multi-file diffs, test suites, or long-form proofs in a single pass.
- Default output limit is 65,536 (64K) tokens: On the Interactions API, both streaming and non-streaming requests default to 65,536 tokens with no code changes required.
- Generate up to 1M tokens with background=True: To generate past 65,536 tokens on the Interactions API, set background=True and set max_output_tokens above 65536. Set it high enough that thinking doesn't cut the answer short, and low enough to limit spend when a hard prompt uses all of it.
See the What's new in Gemini 4 Carbon for details on updating hardcoded 64K synchronous output limits, background retention, dynamic output clamping, and stateless continuation.
Migrating from previous models
If you are already using gemini-4-argon, switching to gemini-4-carbon is a drop-in model string change with the same thinking_level controls, 1M context window via the Gemini API, and pricing. If you are migrating from Gemini 3 or earlier models, clean up the following parameters:
- Replace thinking_budget with thinking_level: thinking_budget is deprecated and returns a warning.
- Remove temperature, top_p, and top_k: Custom sampling values are ignored by gemini-4-carbon and return a deprecation warning.
- Move off explicit context caching: Remove calls that create or pass explicit cached_content. Implicit caching is enabled automatically at a 95% discount on cached input tokens.
- Increase client timeouts: Hard reasoning prompts can take several minutes. Use background=True on the Interactions API, or set your HTTP client timeout to at least 15 to 20 minutes.
For full details, check out our migration checklist, or install the gemini-api-dev skill in your coding agent and ask it to migrate your codebase to gemini-4-carbon.
Use Gemini 4 Carbon in managed agents
You can also use gemini-4-carbon as the model for Managed Agents in the Gemini API. Managed agents provide a hosted sandbox and the Antigravity harness where Carbon's frontier reasoning can search the web, write code, verify work, and call MCP tools all with a single API call.
5 practical tips for building with Gemini 4 Carbon
Here are five patterns we’ve seen our teams use to get the most out of the model and tackle their hardest problems.
1. Align on intent before long runs
Gemini 4 Carbon can work on a task independently for a long time. This means that clear alignment upfront on measurable goals and key milestones helps you get to your result most effectively. Once pointed at a clear goal, the model holds context across long runs on its own really well. To make sure a long autonomous run is pointed at the exact right target from step one:
- Share your goal and ask Carbon to surface clarifying questions about edge cases and success criteria upfront.
- Ideate with Carbon while scoping: Use the planning phase to pressure-test architecture and explore creative solutions. In our workflows, we’ve seen it suggest novel upgrades across the stack - from designing surprising gameplay mechanics and procedural visual effects to recommending cleaner data models and more intuitive API design.
- Run a quick pre-flight check: Have Carbon confirm it has access to the required tools, docs, and understands the intent before starting.
- Step back and let Carbon run to completion: Instead of prompting turn by turn, let Carbon execute the full plan autonomously - writing code, running checks, and iterating across files until it hits the target you agreed on, while pausing for your confirmation before taking irreversible steps.
2. Give the model a way to verify its work
Carbon does its best long-horizon work when it can test its own changes against a real feedback loop. Instead of making Carbon guess whether a fix worked, give it a concrete signal to check: point it at your test suite, pipe in runtime logs, let it take browser screenshots to inspect the rendered UI, or ask it to write a verification script and iterate in a loop until every check passes. Better yet, have Carbon write a reproducible verification script, record a baseline score, and test every change against that script in a loop until the target is met. With a concrete pass/fail target, Carbon can record a baseline, test hypotheses across extended verification loops, and iterate until the checks are green.
If you don’t have something to measure, ask Carbon to help analyze your project and build a baseline benchmark.
3. Use multimodal references and our frontend-design skill
Gemini models have long been strong at multimodal reasoning, and Gemini 4 Carbon expands what you can pass directly: images, audio, video, PDFs, code, and text. Pass reference images or architectural PDFs when building frontends and 3D reconstructions, drop in slide decks and spreadsheets for synthesis, or pass a video when recreating an animation or interaction. If you have a specific target style in mind for your project, point Carbon at 1–2 concrete visual references, or ask it to summarize your typography, color palette, and layout rules into a lightweight DESIGN.md file first so every component stays visually cohesive.
With the launch of Gemini 4 Carbon, we have also published a gemini-frontend-design skill to help you get the best frontend and UI design results out of Gemini 4 models. UIs built with this skill reliably outperform results generated without a skill or with popular third-party frontend design skills. Install it directly with npx skills add google-gemini/demolab --skill gemini-frontend-design, or browse the source in the google-gemini/demolab GitHub repository
Finally, Carbon is great at prompting other Gemini models to generate assets like images, videos, speech, or music. To make this easier, we recommend installing the Gemini API CLI alongside its agent skill (npx skills add google-gemini/gemini-skills --skill gemini-api-cli). This lets Carbon generate and save media files directly to your project folder from the terminal without writing one-off scripts or bloating its context window, so it can wire new visuals and audio straight into your build.
4. Use Carbon as an orchestrator and in multi-agent teams
For large, multi-file projects, Carbon shines at coordinating multi-agent teams - including in Google Antigravity’s new /swarm preview, which turns a single prompt into a coordinated team of agents working in isolated workspaces that you can track in real time. Assign Gemini 4 Carbon to roles demanding the deepest reasoning, such as architectural design, coordination, security auditing, and verification, while pairing it with Gemini 3.8 Flash (or Gemini 4 Argon) subagents for fast parallel implementation.
- Pin Gemini 4 Carbon (thinking_level="medium" or "high") as the lead orchestrator and verifier to break down the architecture, define interfaces, and audit completed changes.
- Delegate parallel implementation slices, such as migrating leaf modules, writing unit tests, or running high-frequency checks, to Gemini 3.8 Flash subagents (model: flash) for high-speed execution.
- Orchestrate specialized models across modalities: Let Carbon coordinate Nano Banana 2.1 for product imagery, textures, and 3D reference sheets, Gemini Omni 1.2 Flash for video references, and Gemini 3.8 Flash TTS or Lyria for voice and music.
5. Have Carbon reflect on past work
At the end of a complex task - or mid-session when tackling a particularly gnarly problem - ask Carbon to step back and review the trajectory so far. Because Carbon excels at synthesizing details across long histories, building a habit of reflection pays off in two ways:
- Skip repeated trial-and-error on codebase quirks: Every repo has non-obvious gotchas - custom test flags, strict lint rules, or deprecated helpers - that can cost extra turns to diagnose. Having Carbon write those lessons into AGENTS.md or a reusable skill means future sessions take the direct path on the first try
- Turn one-off debugging into reusable team skills: Once Carbon figures out a reliable multi-step workflow (like running a tricky local migration or verifying a build), ask it to package those exact steps into a reusable skill so you - and your teammates - never have to rediscover them from scratch.
Try prompting Carbon with:
When Carbon completes a long autonomous run across dozens of files, reading the raw diff isn't always the fastest way to build a mental model of what changed. Try asking Carbon to generate an interactive visual explainer of its solution - like a live architecture diagram, a data-flow map, or a step-by-step pipeline walkthrough. It’s a fast way to sanity-check the design before merging, get up to speed on unfamiliar math or rendering logic, or see the progress on your 3D render in a satisfying animation so you can understand which changes had the biggest impact.
Getting started
You can start building with Gemini 4 Carbon today across Google’s developer platforms:
- Google AI Studio: Test prompts in Playground or build full-stack apps in Google AI Studio Build, available to Google AI Ultra subscribers and developers using a paid tier in the Gemini API.
- Gemini API: Use gemini-4-carbon in the Interactions API with day-one support across the google-genai SDKs and in Managed Agents.
- Google Antigravity: For Google AI Ultra subscribers, select Gemini 4 Carbon (gemini-4-carbon) across the Google Antigravity desktop app, CLI, and IDE extensions for complex planning, /goal runs, and multi-agent /swarm teams. Scientists and researchers can also apply for six months of access in Google Antigravity at no charge, and cybersecurity defenders can apply to the Fairwind Program for access to Carbon for cyber.
- Developer Documentation: Read the full Gemini 4 Carbon, Long Decode, and Office and OpenDocument processing documentation, plus our companion guide on Building 3D Games and Procedural Worlds.
- Use your favorite development tools: You can also start building with Gemini 4 Carbon today across popular tools and harnesses such as Vercel, LiteLLM, OpenRouter, Pydantic, OpenCode, LiveKit, BrowserBase, Eigent, and Cua.
- Gemini API skill: Install the gemini-api-dev skill in your coding agent and ask it to migrate your codebase to gemini-4-carbon.
