Gemini Reasoning Models
Configurable Reasoning in Gemini
Starting with Gemini 2.0 and refined in 3.x, Gemini models support a thinking_level parameter that controls how much internal reasoning (chain-of-thought) the model performs before answering. This allows developers to calibrate between speed/cost and reasoning depth.
ThinkingConfig on Gemini 3.8 Flash
The ThinkingConfig object controls reasoning behavior via the thinking_level parameter:
| Level | Behavior | Best For |
|---|---|---|
| LOW | Minimal internal reasoning, fastest response | Simple lookups, classification, quick answers |
| MEDIUM | Balanced reasoning depth (Default for 3.8 Flash) | Standard coding, analysis, summarization |
| HIGH | Maximum reasoning, longest latency | Complex math, multi-step logic, architectural research |
thinking_level="MINIMAL" is not available for Gemini 3.8 Flash. Explicitly setting thinking_level to MINIMAL will return an API validation error. The supported values for 3.8 Flash are LOW, MEDIUM (default), and HIGH.
from google.genai import GenerativeModel
model = GenerativeModel("gemini-3.8-flash")
# Use LOW thinking for fast classification
fast_response = model.generate_content(
"Classify this email as spam or not spam: 'You won a prize!'",
generation_config={"thinking_config": {"thinking_level": "LOW"}}
)
# Use HIGH thinking for complex reasoning
deep_response = model.generate_content(
"Prove that there are infinitely many prime numbers.",
generation_config={"thinking_config": {"thinking_level": "HIGH"}}
)
Deep Think
Deep Think is a feature of Gemini reasoning models that significantly extends the model's internal chain-of-thought for the most complex tasks - mathematical proofs, multi-file code refactoring, scientific analysis. Deep Think automatically engages when thinking_level is set to HIGH on capable models.
Thought Token Metering
Thinking tokens (the model's internal reasoning) are billed as output tokens. When using HIGH thinking, the model may generate thousands of internal tokens before producing a visible answer. Monitor your usage carefully - setting thinking_level appropriately per task is essential for cost control.