Gemini 2.5 Pro and Flash Retirement: API Migration Guide Before 1 December 2026
From 1 December 2026, Gemini API requests to gemini-2.5-pro and gemini-2.5-flash are rerouted to newer models, with breaking changes to thinking settings, sampling parameters and function calling. Here is what changes, what it costs and how to migrate safely.
On this page
- Key takeaways
- What changes on 1 December 2026
- Price changes
- Breaking changes to fix
- Step-by-step migration checklist
- Choosing the right thinking level
- Cost example
- Vertex AI users
- No-code tools and plugins
- Other model retirements to plan for
- A full before-and-after request example
- Testing plan before you switch
- Monitoring after migration
- Cutting costs on the new models
- Migration checklist for non-developers
- Frequently asked questions
Last updated: 9 November 2026
Quick answer: Google announced on 2 November 2026 that, from 1 December 2026, Gemini Developer API requests to gemini-2.5-pro will be routed to gemini-3.8-flash, and requests to gemini-2.5-flash will be routed to gemini-3.5-flash-lite, billed at the new models’ rates. gemini-2.5-flash-lite is not rerouted for now. The newer models have breaking changes: thinking_level replaces thinking_budget, sampling parameters such as temperature are ignored and will later return errors, prefilled model turns return errors, and function calling handles thought signatures differently. Migrate deliberately before 1 December: change the model string, update parameters and function-calling code, and test on real traffic so the switch does not happen silently in production.
Key takeaways
- Two Gemini 2.5 models are rerouted on 1 December 2026. The notice covers the Gemini Developer API, not Vertex AI.
- Silent rerouting can break code that relies on old parameters or function-calling behaviour.
- Gemini 3.8 Flash is cheaper than 2.5 Pro in December, but its price doubles from 1 January 2027.
- Both deprecated models are already gone from the Google AI Studio model picker.
- Test with production-like traffic, because thinking tokens change real costs.
What changes on 1 December 2026
| Old model | Routed to | Billing from 1 December |
|---|---|---|
gemini-2.5-pro |
gemini-3.8-flash |
Gemini 3.8 Flash rates |
gemini-2.5-flash |
gemini-3.5-flash-lite |
Gemini 3.5 Flash-Lite rates |
gemini-2.5-flash-lite |
Not rerouted | Available until further notice |
Key dates:
- 2 November 2026: Google published the deprecation in the Gemini API release notes.
- 1 December 2026: rerouting begins.
- 31 December 2026: end of the current Gemini 3.8 Flash price.
- 1 January 2027: Gemini 3.8 Flash prices double.
New projects cannot start on the deprecated models; API access is limited to existing users who have used them recently.
Price changes
| Item (per 1M tokens, up to 200K context) | Gemini 2.5 Pro | Gemini 3.8 Flash in December | Gemini 3.8 Flash from January |
|---|---|---|---|
| Input | $1.25 | $0.75 | $1.50 |
| Output | $10.00 | $3.75 | $7.50 |
Gemini 2.5 Pro charged more above 200,000 tokens ($2.50 input, $15.00 output). Gemini 3.8 Flash has no long-context surcharge, so long-context workloads may get cheaper.
| Item (per 1M tokens) | Gemini 2.5 Flash | Gemini 3.5 Flash-Lite |
|---|---|---|
| Text, image and video input | $0.30 | $0.30 |
| Audio input | $1.00 | $0.30 |
| Output | $2.50 | $2.50 |
Thinking tokens count as output, so real costs depend on the thinking level you choose. See Gemini API pricing.
Breaking changes to fix
1. Thinking settings
thinking_level replaces thinking_budget. Gemini 3.8 Flash accepts low, medium and high, and returns an error for minimal. Gemini 3.5 Flash-Lite defaults to minimal.
# Before (Gemini 2.5)
config = {"thinking_config": {"thinking_budget": 1024}}
# After (Gemini 3.8 Flash)
config = {"thinking_config": {"thinking_level": "low"}}
2. Sampling parameters
temperature, top_p and top_k are deprecated and ignored, and Google says they will return HTTP 400 errors in future generations. candidate_count is not supported in Gemini 3 and later. Remove them from your requests.
3. Prefilled model turns
A request that ends with a non-empty model turn, a technique some developers use to force an output format, now returns HTTP 400. Use system_instruction or structured outputs instead.
4. Function calling
- Thought signatures must be preserved between turns.
- Multimodal assets go inside the function response payload.
Malformed_Function_Callerrors can occur if the model emits text before a tool call. Handle this in your code.
Step-by-step migration checklist
- Inventory usage. Search your code and configuration for
gemini-2.5-proandgemini-2.5-flash, including in no-code tools and plugins. - Choose targets. Usually Gemini 3.8 Flash for 2.5 Pro workloads and Gemini 3.5 Flash-Lite for 2.5 Flash, or a different model if quality needs it.
- Update model strings in a test branch.
- Replace thinking settings with
thinking_level. - Remove sampling parameters and
candidate_count. - Remove prefilled model turns. Use system instructions or structured outputs.
- Update function-calling code for thought signatures, payload format and malformed call handling.
- Run an evaluation set of real prompts and compare quality.
- Measure cost per request, including thinking tokens, at December and January prices.
- Deploy before 1 December and monitor errors and costs.
Choosing the right thinking level
| Workload | Suggested starting level |
|---|---|
| Classification, extraction, short answers | low |
| Customer support replies, summaries | low or medium |
| Multi-step reasoning, code generation | medium or high |
| Hard analysis where accuracy matters most | high |
Start low and raise the level only where quality suffers. Higher levels cost more because thinking tokens are billed as output.
Cost example
A support workload of 20,000 requests a day, previously on Gemini 2.5 Pro, was estimated in one analysis to cost about $9,300 a month, falling to about $4,500 in December on Gemini 3.8 Flash and rising to about $9,000 from January. Those figures assume the same output tokens, which will not hold exactly because thinking behaviour differs. Run your own numbers. See how to estimate AI API costs.
Vertex AI users
This notice covers the Gemini Developer API. Vertex AI has its own model lifecycle documentation. If you use Gemini through Vertex AI, check Google Cloud’s model versions page for your dates rather than assuming the same schedule.
No-code tools and plugins
Many WordPress plugins, automation tools and chatbots let you pick a Gemini model by name. If they are set to gemini-2.5-pro or gemini-2.5-flash, they will be rerouted too. Check settings in tools such as n8n, Zapier, Make and AI plugins, and update to a supported model. See AI WordPress plugins and Zapier vs Make vs n8n.
Other model retirements to plan for
- OpenAI retired o1 and o1-pro from its API on 23 October 2026, and GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini leave the API on 14 January 2027. See GPT-4o API retirement.
- Gemini 2.5 Pro was also deprecated in GitHub Copilot earlier in 2026.
A model inventory and a regular review of provider deprecation pages saves emergency migrations.
A full before-and-after request example
Here is a simplified example of a request that would need changes. It uses the Google Gen AI SDK for Python; adapt it to your language and SDK version.
# Before: Gemini 2.5 Pro with old settings
from google import genai
client = genai.Client()
resp = client.models.generate_content(
model="gemini-2.5-pro",
contents=[
{"role": "user", "parts": [{"text": "Classify this ticket: ..."}]},
{"role": "model", "parts": [{"text": "{\"category\": \""}]}, # prefilled turn
],
config={
"temperature": 0.2,
"top_p": 0.9,
"thinking_config": {"thinking_budget": 512},
},
)
# After: Gemini 3.8 Flash
resp = client.models.generate_content(
model="gemini-3.8-flash",
contents="Classify this ticket: ...",
config={
"system_instruction": "Reply only with JSON: {\"category\": string}",
"response_mime_type": "application/json",
"thinking_config": {"thinking_level": "low"},
},
)
The changes: a new model string, the prefilled model turn replaced with a system instruction and structured output, sampling parameters removed, and thinking_budget replaced with thinking_level. Check the current SDK documentation for exact parameter names in your version.
Testing plan before you switch
- Build an evaluation set of 50 to 200 real requests with known good answers.
- Run old and new models side by side and compare outputs automatically where possible, for example by checking JSON validity and categories.
- Have a person review a sample of free-text answers for tone and accuracy.
- Measure latency at realistic concurrency.
- Measure cost per request, including thinking tokens, at both December and January prices.
- Test error handling for malformed function calls and HTTP 400 responses.
- Roll out gradually, for example 10% of traffic first, then 50%, then 100%.
Monitoring after migration
- Error rates by status code, especially new HTTP 400 errors.
- Token usage by type: input, output and thinking.
- Quality signals such as user ratings, escalation rates or validation failures.
- Cost per day with an alert threshold, especially around 1 January 2027 when prices change.
Cutting costs on the new models
- Use the lowest thinking level that meets your quality bar.
- Cache repeated context where the API supports it. See prompt caching explained.
- Batch non-urgent work for lower prices. See batch API savings.
- Route simple tasks to Flash-Lite and keep Flash for harder ones. See model routing explained.
- Trim prompts by removing repeated instructions and unnecessary examples. See how to reduce token usage.
Migration checklist for non-developers
If you use Gemini through a plugin, chatbot builder or automation tool rather than code:
- List every tool where you entered a Gemini API key.
- Open each tool’s settings and check the selected model.
- If it says Gemini 2.5 Pro or 2.5 Flash, switch to a current model offered by the tool.
- Run a few typical requests and check the answers.
- Ask the tool’s support team whether they handle the parameter changes automatically.
- Check your Google AI Studio billing page in December and January for unexpected changes.
Frequently asked questions
When is Gemini 2.5 Pro retired from the Gemini API?
From 1 December 2026, requests are routed to Gemini 3.8 Flash.
What happens to gemini-2.5-flash?
It is routed to Gemini 3.5 Flash-Lite from 1 December 2026.
Is gemini-2.5-flash-lite affected?
Not now. It remains available until further notice.
Will my code break when rerouting happens?
It may, if you use thinking_budget, sampling parameters, prefilled model turns or older function-calling patterns.
Will my costs go up?
Moving from 2.5 Pro to 3.8 Flash is cheaper in December, but 3.8 Flash prices double from 1 January 2027. Thinking tokens also affect cost.
Does this affect Vertex AI?
The notice covers the Gemini Developer API. Check Vertex AI’s own model lifecycle pages.
What replaces thinking_budget?
thinking_level, with values such as low, medium and high on Gemini 3.8 Flash.
Can I keep using Gemini 2.5 Pro after 1 December?
Requests will be served by Gemini 3.8 Flash instead, so you should migrate deliberately before then.
Product details, prices and features are checked at the time of writing and can change. Sources are linked in the text so you can check them yourself.
How does your brand appear in AI answers?
We test the questions your buyers ask across the major AI assistants and search engines, then show you what to fix first.
Get an AI Visibility Audit