Migration Checklist
From gemini-3-flash-preview to gemini-3.5-flash — without silently regressing.
Set thinking_level explicitly
criticalWhy: The default changed from "high" (gemini-3-flash-preview) to "medium" (gemini-3.5-flash). No error is thrown. Your outputs silently become less reasoned.
Fix: Add thinkingConfig.thinkingLevel = "high" to your generation config (see code blocks below).
Update model ID string
criticalWhy: You must change the model string from gemini-3-flash-preview to gemini-3.5-flash.
Fix: Replace "gemini-3-flash-preview" with "gemini-3.5-flash" in all model instantiation calls.
Remove temperature / top_p / top_k
criticalWhy: These parameters are no longer recommended for Gemini 3.5 Flash and may be silently ignored or produce unexpected behavior.
Fix: Remove temperature, top_p, top_k from your GenerationConfig. If you need output diversity control, use thinking_level instead.
Add id and name to FunctionResponse
criticalWhy: The FunctionResponse schema now requires both id and name fields. Calls without them return 400.
Fix: Update all FunctionResponse objects to include both the function call id and the function name. See /function-calling for details.
Audit thought preservation in multi-turn chats
Why: Thought preservation is now ON by default. Thinking tokens from each turn accumulate in chat history, which can cause token blowup in long conversations.
Fix: Either set thoughtsInContent: false in your ThinkingConfig for chat sessions, or implement explicit context truncation after each turn.
Remove thinking_budget (if set)
Why: mixing thinking_level and thinking_budget in the same config throws a 400 error. thinking_budget is deprecated in favor of thinking_level.
Fix: Delete any thinking_budget / thinkingBudget fields from your config. Use thinking_level only.
Update pricing estimate
Why: At thinking_level="high", Gemini 3.5 Flash uses ~$0.35/1M input + $3.50/1M output + thinking tokens at $3.50/1M. This is higher than gemini-3-flash-preview.
Fix: Re-run your cost model. Use the pricing calculator at /pricing-calculator to compare scenarios.
Copy-paste configs
PyPython SDK
import google.generativeai as genai
model = genai.GenerativeModel(
model_name="gemini-3-flash-preview",
# No thinking config — used API default (thinking_level="high")
)
response = model.generate_content("Analyze this code...")import google.generativeai as genai
from google.generativeai.types import GenerationConfig, ThinkingConfig
model = genai.GenerativeModel(
model_name="gemini-3.5-flash", # ← Step 1: update model ID
generation_config=GenerationConfig(
thinking_config=ThinkingConfig(
thinking_level="high", # ← Step 2: MUST set explicitly
)
),
)
response = model.generate_content("Analyze this code...")TSTypeScript / Node.js SDK
import { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY!);
const model = genAI.getGenerativeModel({
model: "gemini-3-flash-preview",
// No thinkingConfig — used API default (high)
});
const result = await model.generateContent("Analyze this code...");import { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY!);
const model = genAI.getGenerativeModel({
model: "gemini-3.5-flash", // ← Step 1: update model ID
generationConfig: {
thinkingConfig: {
thinkingLevel: "high", // ← Step 2: MUST set explicitly
},
},
});
const result = await model.generateContent("Analyze this code...");RESTREST API / curl
curl -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"parts": [{"text": "Analyze this code..."}]}]
}'curl -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"parts": [{"text": "Analyze this code..."}]}],
"generationConfig": {
"thinkingConfig": {
"thinkingLevel": "HIGH"
}
}
}'