What to Do Before Gemini 2.5 Pro and 2.5 Flash Are Retired on December 1, 2026
Shutdown: Tuesday, Dec 1, 2026. Google's Gemini API retires gemini-2.5-pro and gemini-2.5-flash. From that date, requests to gemini-2.5-pro are automatically routed to gemini-3.8-flash and requests to gemini-2.5-flash to
Shutdown: Tuesday, Dec 1, 2026. Google's Gemini API retires gemini-2.5-pro and gemini-2.5-flash. From that date, requests to gemini-2.5-pro are automatically routed to gemini-3.8-flash and requests to gemini-2.5-flash to gemini-3.5-flash-lite, billed at the new model's rates. Your calls keep answering, but with a different model and different parameter rules.
Free AI model shutdown alerts: get an email only when a model you might use is being retired. No digest, no spam. Subscribe at aideprecations.com/subscribe (double opt-in).
Affected model IDs (from Google)
| Model ID | Released | Shutdown | Recommended replacement | After Dec 1, requests route to |
|---|---|---|---|---|
gemini-2.5-pro |
Jun 17, 2025 | Dec 1, 2026 | gemini-3.8-flash |
gemini-3.8-flash, billed at Gemini 3.8 Flash rates |
gemini-2.5-flash |
Jun 17, 2025 | Dec 1, 2026 | gemini-3.5-flash-lite |
gemini-3.5-flash-lite, billed at Gemini 3.5 Flash-Lite rates |
Source: Gemini API deprecations (read Nov 10, 2026).
- Both models are deprecated and no longer selectable in Google AI Studio. API access to
gemini-2.5-prois limited to existing users who have actively used it. -
Not affected:
gemini-2.5-flash-lite"is not deprecated and remains available through the API until further notice." - Vertex AI is different: on Google Cloud (Gemini Enterprise Agent Platform), these IDs already reached their retirement date on Oct 20, 2026 per Google Cloud model versions. If you use Vertex, check that page.
Why "auto-routing" is still a breaking change
- Cost: routed requests are billed at the new model's rates (pricing). Google lists introductory pricing for Gemini 3.8 Flash through Dec 31, 2026.
-
Sampling parameters:
temperature,top_pandtop_kare deprecated and ignored on Gemini 3.6 Flash / 3.5 Flash-Lite and later; Google says future generations will return HTTP 400 (API changes). -
Prefilled model turns: a request whose last non-empty turn is a
modelturn returns HTTP 400. -
Thinking:
thinking_budgetis replaced bythinking_level.gemini-3.8-flashsupportslow,medium(default) andhigh, notminimal.gemini-3.5-flash-litedefaults tominimal. -
Function calling: audit it; with generateContent every
FunctionResponsemust includecall_idandname.
Step 1: Find every call site
rg -n --hidden -g '!node_modules' -e 'gemini-2\.5-(pro|flash)\b' . | rg -v 'flash-lite'
rg -n --hidden -g '*.{yml,yaml,json,toml,tf,tfvars}' -g '.env*' -e 'gemini-2\.5-(pro|flash)' .
Step 2: Pick the replacement explicitly
-
gemini-2.5-proโgemini-3.8-flash(Google checklist) -
gemini-2.5-flashโgemini-3.5-flash-lite(Google checklist)
Switch on your schedule instead of letting the Dec 1 routing do it, so you can test first.
Step 3: Update the code (google-genai SDK)
import os
from google import genai
from google.genai import types
client = genai.Client() # reads GEMINI_API_KEY
# was: "gemini-2.5-pro" (gemini-2.5-flash -> "gemini-3.5-flash-lite")
MODEL = os.environ.get("GEMINI_MODEL", "gemini-3.8-flash")
resp = client.models.generate_content(
model=MODEL,
contents="Summarize this ticket in 3 bullets: ...",
config=types.GenerateContentConfig(
system_instruction="Output only the bullets.",
# removed: temperature=0.2, top_p=0.9, top_k=40 (ignored on Gemini 3.x)
# was: thinking_config=types.ThinkingConfig(thinking_budget=1024)
thinking_config=types.ThinkingConfig(thinking_level="low"),
),
)
print(resp.text, resp.model_version)
Interactions API (the style Google's current docs use):
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Summarize this ticket in 3 bullets: ...",
system_instruction="Output only the bullets.",
generation_config={"thinking_level": "low"},
)
print(interaction.output_text)
Upgrade first: pip install -U google-genai.
Step 4: Remove prefilled model turns
If you ended contents with a model turn (e.g. "Translation:" or "{" to force JSON), that now returns HTTP 400. Use system_instruction or structured outputs instead.
Step 5: Testing checklist
- Frozen prompt set on old vs new: quality, refusals, length, latency.
- Compare
thinking_levellow / medium / high; forgemini-3.5-flash-liteagents with tools, Google suggestsmediumorhigh. - With temperature ignored, re-check tests that relied on low-temperature output.
- Function calling: validate against schemas, include
call_id+name, watch forMalformed_Function_Call. - Parse 100% of structured output with your production parser.
- Preserve thought signatures across multi-turn calls.
- Price real token counts (including thought tokens) at the new rates.
- Log
model_versionand alert if it isn't the model you set: after Dec 1 that's how silent routing shows up.
Step 6: Roll out before Dec 1
- Canary 5โ10%, then 100%, with the model ID in config.
- After cutover, fail CI if
gemini-2.5-proorgemini-2.5-flash(not-lite) appears in the repo.
Free alerts + checklist
- Full guide (canonical, updated daily): https://aideprecations.com/guides/gemini-2-5-pro-flash-shutdown/
- Subscribe (email only when a model is being retired; also calendar, webhooks, MCP): https://aideprecations.com/subscribe/
- Every Gemini date: https://aideprecations.com/google-gemini/ ยท Calendar: https://aideprecations.com/calendar/
Dates come from official provider pages. Always confirm on the linked source.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.