7-step migration checklist

Migration Checklist

From gemini-3-flash-preview to gemini-3.5-flash — without silently regressing.

1

Set thinking_level explicitly

critical

Why: 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).

2

Update model ID string

critical

Why: 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.

3

Remove temperature / top_p / top_k

critical

Why: 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.

4

Add id and name to FunctionResponse

critical

Why: 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.

5

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.

6

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.

7

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

Before
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...")
After (correct)
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

Before
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...");
After (correct)
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

Before
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..."}]}]
  }'
After (correct)
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"
      }
    }
  }'

Explore related reference pages