What to Do Before Gemini 2.5 Pro and 2.5 Flash Are Retired on December 1, 2026
Shutdown: Dec 1, 2026 (Tuesday). 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. 2026-12-01
Get an email only when a model you might use is being retired. No digest, no spam. Every alert links the official provider source. Confirming unlocks the AI Model Migration Checklist and your personal .ics shutdown calendar.
Double opt-in. Unsubscribe anytime. No spam, no selling your email.
Affected model IDs (from Google)
| Model ID | Released | Shutdown | Google's 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 ("Gemini 2.5 Pro models" and "Gemini 2.5 Flash models"), read Nov 10, 2026.
- Both models are deprecated and no longer selectable in Google AI Studio. Google says 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" (Google). - The older 2.5 preview IDs (
gemini-2.5-pro-preview-03-25,-05-06,-06-05,gemini-2.5-flash-preview-05-20,-09-2025) are already past their shutdown dates. The 2.5 TTS previews shut down on Nov 17, 2026. - Vertex AI is different: on Google Cloud (Gemini Enterprise Agent Platform), our tracker shows
gemini-2.5-proandgemini-2.5-flashalready reached their retirement date on Oct 20, 2026 (Google Cloud model versions). If you call Gemini through Vertex, check that page, not this date. - Every Gemini date: Gemini API page · shutdown calendar.
Why "auto-routing" is still a breaking change
- Cost: routed requests are billed at the new model's rates (Gemini API pricing). Google lists introductory pricing for Gemini 3.8 Flash through Dec 31, 2026, with standard pricing from Jan 1, 2027.
- Sampling parameters: from Gemini 3.6 Flash / 3.5 Flash-Lite on,
temperature,top_pandtop_kare deprecated and ignored; Google says future model generations will return HTTP 400 for them (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: Google's checklist says to audit it, and 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)' .
- Also check
models/gemini-2.5-prostyle names, LangChain/LlamaIndex/LiteLLM configs, eval harnesses, notebooks and CI.
Step 2: Pick the replacement explicitly
gemini-2.5-pro→gemini-3.8-flash(Google migration checklist)gemini-2.5-flash→gemini-3.5-flash-lite(Google migration checklist)
Switch on your schedule rather than letting the Dec 1 routing switch for you, so you can test first and roll back if needed.
Step 3: Update the code (google-genai SDK)
Existing generate_content code: change the model ID, drop sampling parameters, set a thinking level.
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 the SDK first (pip install -U google-genai). The legacy google-generativeai package uses a different client; see Google's SDK migration page.
Step 4: Remove prefilled model turns
If you ended contents with a model turn (for example "Translation:" or "{" to force JSON), that now returns HTTP 400. Use system_instruction or structured outputs (response_mime_type="application/json" plus a schema) instead.
Step 5: Testing checklist
- Run a frozen set of real prompts on old and new models; compare quality, refusals, length and latency.
- Thinking level: compare
low/medium/highon your eval set; thought tokens affect latency and cost. Forgemini-3.5-flash-liteagents with tool calls, Google suggestsmediumorhighto prevent premature tool termination. - Determinism: with temperature ignored, check any test that relied on low-temperature output; tighten the system instruction instead.
- Function calling: validate every call against your schema, include
call_idandnameon eachFunctionResponse, and watch forMalformed_Function_Call. - Structured output: parse 100% of responses with your production JSON parser.
- Multi-turn: preserve thought signatures across turns (Google: thought signatures).
- Cost: price your real token counts, including thought tokens, at the new model's rates.
- Monitoring: log
model_versionfrom responses and 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% of traffic, 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.
Grep commands for code/YAML/Terraform, direct API vs Bedrock/Vertex/Azure date diff, replacement parity matrix, eval + shadow-traffic cutover, post-shutdown 404 guardrails. Preview it, or get it now:
FAQ
When are gemini-2.5-pro and gemini-2.5-flash shut down?
Google's Gemini API deprecations page lists a shutdown date of December 1, 2026 for both gemini-2.5-pro and gemini-2.5-flash. Both are already unavailable to select in Google AI Studio.
Will my API calls fail on December 1?
Not immediately. Google says that effective December 1, 2026, all API requests to gemini-2.5-pro automatically route to gemini-3.8-flash and requests to gemini-2.5-flash route to gemini-3.5-flash-lite, billed at the new model's rates. Behavior, parameters and cost change even if the model ID in your code doesn't.
What should I replace them with?
Google recommends gemini-3.8-flash for gemini-2.5-pro and gemini-3.5-flash-lite for gemini-2.5-flash. Switch explicitly and test before December 1 instead of relying on the automatic routing.
Is gemini-2.5-flash-lite affected?
No. Google says gemini-2.5-flash-lite is not deprecated and remains available through the API until further notice.
What breaks when moving to Gemini 3.x models?
Per Google's migration guides: temperature, top_p and top_k are deprecated and ignored; prefilled model turns return HTTP 400; thinking_budget is replaced by thinking_level (gemini-3.8-flash supports low, medium and high, not minimal); and function calling needs an audit, including call_id and name on every FunctionResponse with generateContent.
Get an email only when a model you might use is being retired. No digest, no spam. Every alert links the official provider source. Confirming unlocks the AI Model Migration Checklist and your personal .ics shutdown calendar.
Double opt-in. Unsubscribe anytime. No spam, no selling your email.
Dates come from official provider pages and are re-checked daily. Always confirm on the linked source. Related: all Gemini API shutdowns · Vertex AI · shutdown calendar · all guides