Publishing
Your app's Gemini 2.5 calls switch models on December 1
Cataloged November 11, 2026 · Firebase · Lovable · Bolt · Cursor · Replit · v0
Symptom
The AI feature still answers. The model name in the code has not changed. Google's Gemini API deprecations page says gemini-2.5-pro is deprecated and is no longer available to select in Google AI Studio, and that API access is limited to existing users who have actively used it. Effective December 1, 2026, all API requests to gemini-2.5-pro automatically route to gemini-3.8-flash and are billed at Gemini 3.8 Flash rates. The same page says gemini-2.5-flash is deprecated and is no longer available to select in Google AI Studio. Effective December 1, 2026, all API requests to gemini-2.5-flash automatically route to gemini-3.5-flash-lite and are billed at Gemini 3.5 Flash-Lite rates. gemini-2.5-flash-lite is not deprecated and remains available through the API until further notice. After that date the feature can keep answering from a different model, billed at the newer model's rates, or it can start failing with HTTP 400. Firebase's November 2, 2026 release notes say that when a gemini-2.5-pro request is routed to gemini-3.8-flash, frequencyPenalty, presencePenalty, or candidateCount fails with a 400 error. A last non-empty turn that is a model turn fails with a 400. Setting the thinking level to MINIMAL on a request routed to gemini-3.8-flash fails with a 400. The migration guide for Gemini 3.6 Flash and 3.5 Flash-Lite says the same about that model turn: if the last non-empty turn in the request is a model turn, the API returns a 400 error. That guide says the default thinking level for gemini-3.5-flash-lite is minimal. For autonomous subagents with tool calls, code execution, or multi-step reasoning, set thinking_level to medium or high to prevent premature tool termination. For high-volume extraction or classification, leave minimal.
Root cause
The request still names a deprecated model id, gemini-2.5-pro or gemini-2.5-flash, hard-coded in the project. The deprecations page says those requests automatically route to a different model on December 1, 2026. The id in the project does not have to change for that routing to happen, so the feature does not fail loudly until the new model rejects a parameter the old request still sends. The Gemini 2.5 Flash page says: before December 1, 2026, update your model string to gemini-3.5-flash-lite. It lists the breaking API changes as function calling and thought_signature validation, thinking_level replacing thinking_budget, and removed sampling parameters and prefilled model turns. The migration guide for 3.6 Flash and 3.5 Flash-Lite says temperature, top_p, and top_k are deprecated and ignored, and that future model generations will return HTTP 400 if a request still sends them. Remove them, and use a system instruction with explicit rules when the answers need to stay steady. That guide says candidate_count is unsupported in Gemini 3 and later, and to replace thinking_budget with thinking_level. Firebase's November 2, 2026 release notes say the same routing for the Gemini Developer API (Google AI): gemini-2.5-pro routes to gemini-3.8-flash, gemini-2.5-flash routes to gemini-3.5-flash-lite, and gemini-2.5-flash-lite does not change. Inference is billed at the newer models' rates. Those notes say gemini-3.8-flash and gemini-3.5-flash-lite do not support several sampling parameters, and that all general-use Gemini 3.x models ignore temperature, topK, and topP. Thinking budgets are strongly discouraged. Migrate thinkingBudget to thinkingLevel. For the Agent Platform Gemini API, formerly Vertex AI, the same notes say gemini-2.5-pro, gemini-2.5-flash, and gemini-2.5-flash-lite were already shut down on October 20, 2026. Firebase AI Logic users still on Gemini 2.5 are strongly recommended to update explicitly to a newer model, such as gemini-4-argon, gemini-3.8-flash, or gemini-3.5-flash-lite, and to test before December 1, 2026. If the app sends the full history itself, the thinking docs say you must resend all thought blocks exactly as they were received, and that you should not remove or modify them.
Before and after
The before fields hard-code model to gemini-2.5-flash and send temperature: 0.7. The Gemini 2.5 Flash page says to update that model string to gemini-3.5-flash-lite before December 1, 2026. The migration guide for 3.6 Flash and 3.5 Flash-Lite says temperature, top_p, and top_k are deprecated and ignored, and to remove them and use a system instruction with explicit rules. The after fields set the model to gemini-3.5-flash-lite, drop temperature, and set systemInstruction. The guide does not publish this exact instruction text. This swap is not for gemini-2.5-flash-lite. The deprecations page says that id is not deprecated.
Before
model: "gemini-2.5-flash", temperature: 0.7,
After
model: "gemini-3.5-flash-lite", systemInstruction: "Return only the requested format. Do not add an introduction.",
Fix prompt
In this project only. Do not scan or test anyone else's app. Do not print keys, tokens, passwords, or environment variable values. When you mention a variable, print the name only. 1. Search this project's own code for the exact model ids gemini-2.5-pro and gemini-2.5-flash. A longer id that only contains one of those strings is not a match. gemini-2.5-flash-lite is not a match. The Gemini API deprecations page says gemini-2.5-flash-lite is not deprecated and remains available through the API until further notice. Firebase's November 2, 2026 release notes say it does not change on the Gemini Developer API. If neither exact id appears, say so and stop. Do not edit gemini-2.5-flash-lite. 2. List each call site. For each one, give the file, the line, and which of the two ids it uses. Do not print keys or env values. 3. Move that model id to one config or env place this project already uses for settings. Do not add a new secret. When you mention an env var, print the name only. Show me the diff. 4. Change the id. Where the call says gemini-2.5-flash, set it to gemini-3.5-flash-lite. The Gemini 2.5 Flash page says to update the model string to gemini-3.5-flash-lite before December 1, 2026. Where the call says gemini-2.5-pro, set it to gemini-3.8-flash. The deprecations page says those requests automatically route to gemini-3.8-flash, and Firebase's November 2, 2026 notes name gemini-3.8-flash as one model to update to explicitly. Do not switch a gemini-2.5-pro call to gemini-3.5-flash-lite unless I ask. Do not change gemini-2.5-flash-lite. Show me the diff. 5. Remove temperature, topP, topK, candidateCount, frequencyPenalty, and presencePenalty from those calls. Also remove top_p, top_k, candidate_count, frequency_penalty, and presence_penalty when the code uses those names. The migration guide says temperature, top_p, and top_k are deprecated and ignored, and that future model generations will return HTTP 400 if a request still sends them. It says candidate_count is unsupported in Gemini 3 and later. Firebase's notes say that on a gemini-2.5-pro request routed to gemini-3.8-flash, frequencyPenalty, presencePenalty, or candidateCount returns a 400 error, and that all general-use Gemini 3.x models ignore temperature, topK, and topP. Where this project used temperature to keep answers steady, add a system instruction with explicit rules, as that guide says. Use systemInstruction or system_instruction, whichever name this project already uses. Do not add an import. Show me the diff. 6. Replace thinkingBudget with thinkingLevel, including thinking_budget and thinking_level. The Gemini 2.5 Flash page says thinking_level replaces thinking_budget. Firebase's notes say thinking budgets are strongly discouraged and to migrate thinkingBudget to thinkingLevel. On a call that now says gemini-3.8-flash, or that still says gemini-2.5-pro, do not set the thinking level to MINIMAL. Firebase's notes say setting the thinking level to MINIMAL on a request routed to gemini-3.8-flash returns a 400 error. Use medium or high on that path. On a call that now says gemini-3.5-flash-lite, the migration guide says the default thinking level is minimal. If that call is an autonomous subagent with tool calls, code execution, or multi-step reasoning, set thinking_level to medium or high to prevent premature tool termination. If that call is high-volume extraction or classification, leave minimal. Show me the diff. 7. If a request ends with a model turn that this project wrote in advance, remove that trailing prefilled model turn. The migration guide says prefilled model turns are no longer supported: if the last non-empty turn in the request is a model turn, the API returns a 400 error. Put that instruction in a system instruction, or use structured outputs, as that guide says. Show me the diff. 8. If this project sends the conversation history itself, keep every thought block exactly as the API returned it. The thinking docs say that in that stateless mode you must resend all thought blocks exactly as they were received, and that you should not remove or modify them. Do not strip them while you edit the history. The Gemini 2.5 Flash page also lists function calling and thought_signature validation as breaking changes. Do not rewrite function or tool definitions in this pass. If a test fails on a function call, show me the error and stop. 9. Do not change auth, API keys, or Firebase App Check. Show me the diffs. Then run this project's tests and show me the result. Do not print keys. Do not edit unrelated files.
Paste this into the coding tool that has your own project open.
2-minute self-check
These steps are for an app you own. Do not run them against someone else's project.
- In your own repo, search for the exact strings gemini-2.5-pro and gemini-2.5-flash. Skip any line whose id is gemini-2.5-flash-lite. The deprecations page says that id is not deprecated and remains available through the API until further notice. Do not search anyone else's repo.
- In your own Google AI Studio account, open usage or billing for your own project and see whether gemini-2.5-pro or gemini-2.5-flash is still in use. The deprecations page says those two are no longer available to select in Google AI Studio, and that API access to gemini-2.5-pro is limited to existing users who have actively used it. Do not open anyone else's account.
- From your own dev environment, send one request that your own app already makes. If the code still says gemini-2.5-flash, the deprecations page says that on December 1, 2026 the request routes to gemini-3.5-flash-lite and is billed at Gemini 3.5 Flash-Lite rates. The migration guide lists that model at $0.30 per 1M input tokens and $2.50 per 1M output tokens. If the code still says gemini-2.5-pro, the same deprecations page says the request routes to gemini-3.8-flash and is billed at Gemini 3.8 Flash rates. Do not send the request to anyone else's project, and do not paste an API key.
- If that request returns HTTP 400, look at your own request body. Firebase's November 2, 2026 notes say a 400 can come from a last non-empty turn that is a model turn, from frequencyPenalty, presencePenalty, or candidateCount on a gemini-2.5-pro request routed to gemini-3.8-flash, or from thinking level MINIMAL on a request routed to gemini-3.8-flash. Do not print the key, and do not send the request to anyone else's project.
Common questions
Is gemini-2.5-flash-lite affected?
No, on the Gemini Developer API. The Gemini API deprecations page says gemini-2.5-flash-lite is not deprecated and remains available through the API until further notice. Firebase's November 2, 2026 release notes say the same for that API: gemini-2.5-flash-lite does not change. Do not replace that id because gemini-2.5-pro and gemini-2.5-flash are deprecated. A search for gemini-2.5-flash also matches the longer id gemini-2.5-flash-lite, so read the full string before you edit.
I use Firebase AI Logic with the Vertex or Agent Platform backend. Does December 1 still apply?
Firebase's November 2, 2026 release notes say that for the Agent Platform Gemini API, formerly Vertex AI, gemini-2.5-pro, gemini-2.5-flash, and gemini-2.5-flash-lite were already shut down on October 20, 2026. That shutdown includes flash-lite on that backend. The December 1 routing on the deprecations page is the Gemini Developer API, which those notes call Google AI. On that API, flash-lite does not change, and gemini-2.5-pro and gemini-2.5-flash route to newer models instead. The same notes say Firebase AI Logic users still on Gemini 2.5 should update explicitly to a newer model, such as gemini-4-argon, gemini-3.8-flash, or gemini-3.5-flash-lite, and test before December 1, 2026.
Will my bill change?
The request is billed at the newer model's rates. The deprecations page says requests to gemini-2.5-pro are billed at Gemini 3.8 Flash rates, and requests to gemini-2.5-flash are billed at Gemini 3.5 Flash-Lite rates, starting December 1, 2026. Firebase's November 2, 2026 notes say inference is billed at the newer models' rates. The migration guide lists gemini-3.5-flash-lite at $0.30 per 1M input tokens and $2.50 per 1M output tokens. This card does not have a listed price for gemini-3.8-flash.
Sources
- Gemini API deprecations: gemini-2.5-pro and gemini-2.5-flash route on December 1, 2026
- Gemini 2.5 Flash: update the model string to gemini-3.5-flash-lite before December 1, 2026
- What's new in Gemini 3.6 Flash and 3.5 Flash-Lite (migration guide)
- Firebase release notes, November 2, 2026: Gemini API routing on December 1, 2026
- Gemini thinking: resend thought blocks in stateless mode