Gemini API Migration Guide: Replace Deprecated 3.7 and 3.5 Flash

Update model IDs, fix Gemini 3 API differences, and migrate Deep Research before the October 23 shutdown.

Gemini API migration from deprecated Flash models to current replacements
Gemini API migration: replace deprecated model identifiers, then validate behavior rather than assuming automatic routing is enough.

Google changed several Gemini API migration paths on October 8, 2026. gemini-3.7-flash is deprecated and requests are automatically routed to gemini-3.8-flash. gemini-3.5-flash is also deprecated and routed to gemini-3.6-flash. Separately, the older Deep Research agent deep-research-pro-preview-12-2025 is scheduled to shut down on October 23, 2026.

Automatic routing reduces the chance of an immediate outage, but it is not a complete migration. Your source code, configuration, dashboards and evaluation records can still name an obsolete model. More importantly, the replacement may have different default reasoning behavior, parameter rules, pricing and tool-call requirements. A production migration should therefore update the model identifier explicitly and test the complete application workflow.

This guide separates what Google has officially documented from practical recommendations. It does not claim an independent Rubic8 benchmark, and it does not assume that a model upgrade improves every workload.

What changed in the Gemini API on October 8?

Current identifier Status Recommended action
gemini-3.7-flash Deprecated; automatically routed to 3.8 Flash Change the model string to gemini-3.8-flash
gemini-3.5-flash Deprecated; automatically routed to 3.6 Flash Use gemini-3.6-flash, or evaluate 3.8 Flash
deep-research-pro-preview-12-2025 Deprecated; shutdown scheduled for October 23, 2026 Move to deep-research-preview-04-2026 or deep-research-max-preview-04-2026

Google describes gemini-3.8-flash as its current production-ready Flash model for long-horizon software engineering, autonomous agents and complex enterprise workflows. Its official model page lists a 1,048,576-token input limit, a 65,536-token output limit, thinking levels of low, medium and high, structured output, function calling, code execution, file search, URL context and Google Search grounding. Computer use is listed as preview.

Those are product capabilities, not proof that your prompts will become more accurate or cheaper. Treat model selection as an application decision backed by representative tests.

Why explicit migration matters when Google already routes requests

An alias-like routing layer is useful during a transition, but leaving the deprecated name in production creates avoidable ambiguity:

  • Engineers reading the code cannot tell which model actually served a request.
  • Cost dashboards and experiment labels may group replacement traffic under the old name.
  • Behavior may change without a corresponding configuration change in your repository.
  • Future removal of the routing rule can turn a warning into an outage.
  • Documentation and incident reports may describe different effective models.

The safe pattern is to make the effective model explicit, record the change in version control and run the same evaluation set before and after deployment. Automatic routing is a temporary compatibility mechanism, not a substitute for ownership.

Choose the right replacement

For Gemini 3.7 Flash workloads

The direct replacement is gemini-3.8-flash. This is the lowest-ambiguity path because it matches Google's routing and current recommendation. It is a strong starting point for agentic coding, multi-step tool use, large-context analysis and applications that need the current Flash capability set.

For Gemini 3.5 Flash workloads

Google routes these requests to gemini-3.6-flash. Choose 3.6 when you want to align with that direct replacement and limit the number of variables in the first migration. Evaluate 3.8 when its newer agent and coding focus is relevant, but treat that as a model-selection exercise rather than a mechanical rename.

For very high-volume extraction, routing or classification, do not confuse gemini-3.5-flash with gemini-3.5-flash-lite. Flash-Lite remains a separate model and has different performance and pricing goals.

For Deep Research

Google provides two April 2026 replacements. deep-research-preview-04-2026 is positioned for speed and streaming results to a client interface. deep-research-max-preview-04-2026 is the option for more comprehensive automated research. Do not wait for October 23 to discover whether your application depends on an older response shape, latency profile or citation workflow.

Update Gemini Flash in Python

First update the Google Gen AI SDK in the same environment used by your application:

python -m pip install -U google-genai

Then change the configured model name. Keeping it in an environment variable makes staged rollout and rollback easier:

import os
from google import genai

client = genai.Client()
model_id = os.getenv("GEMINI_MODEL", "gemini-3.8-flash")

response = client.models.generate_content(
    model=model_id,
    contents="Return a short JSON migration checklist."
)

print(response.text)

The example demonstrates the model-string change; it is not a complete production integration. Preserve your existing authentication controls, timeouts, retry policy, logging redaction and output validation.

Update Gemini Flash in JavaScript

npm install @google/genai
import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});
const model = process.env.GEMINI_MODEL || "gemini-3.8-flash";

const response = await ai.models.generateContent({
  model,
  contents: "Return a short JSON migration checklist."
});

console.log(response.text);

When testing request or response fixtures, use Rubic8's JSON Formatter for readable indentation and the JSON Validator for syntax checks. Remove API keys, personal data, internal URLs and proprietary prompts before pasting a payload into any browser-based tool.

Audit Gemini 3 API differences, not only the model string

Google's current migration guidance identifies several changes that can break an application even when the request reaches a replacement model:

  • Remove deprecated sampling parameters such as temperature, top_p and top_k where the target API no longer accepts them.
  • Remove unsupported candidate_count usage and prefilled model turns.
  • Replace older thinking-budget configuration with supported thinking_level values.
  • For function calling, include both call_id and name in every FunctionResponse.
  • Preserve thought signatures as required by the Gemini 3 guidance.
  • Test multimodal assets inside function-response payloads if your tools return images or documents.

Do not delete parameters blindly across every model. Create a target-specific request schema, validate it in tests and deploy it together with the model-ID change. A shared client supporting several model generations may need separate adapters.

Migrate the Deep Research agent before October 23

The Deep Research change is more urgent because Google has published a shutdown date for deep-research-pro-preview-12-2025. Search configuration, environment variables, infrastructure templates and secret-manager metadata for that exact identifier.

# Before
agent = "deep-research-pro-preview-12-2025"

# Faster, stream-oriented replacement
agent = "deep-research-preview-04-2026"

# More comprehensive replacement
agent = "deep-research-max-preview-04-2026"

Run at least one realistic end-to-end research job for each candidate. Inspect citation completeness, source relevance, time to first useful output, total completion time, token consumption, cancellation behavior and how partial failures are represented. A successful HTTP response does not prove that the report meets your application's evidence requirements.

Current Gemini 3.8 Flash pricing

Google's pricing page currently lists introductory Gemini 3.8 Flash Standard rates through December 31, 2026: $0.75 per million input tokens and $3.75 per million output tokens, with output pricing including thinking tokens. Standard context caching is $0.075 per million cached tokens plus $0.50 per million tokens per hour of storage. On January 1, 2027, the published Standard rates rise to $1.50 input, $7.50 output, $0.15 cached tokens and $1.00 per million tokens per hour of cache storage.

Batch and Flex are currently listed at half the Standard token rates through the end of 2026, while Priority uses a higher multiplier. Grounding with Google Search has a separate request allowance and overage price. Pricing, free-tier availability and regional terms can change; check the official Gemini API pricing page before committing a production budget.

A simple cost example

At the introductory Standard rates, a request using 20,000 uncached input tokens and producing 4,000 output tokens costs approximately:

  • Input: 20,000 / 1,000,000 × $0.75 = $0.015
  • Output: 4,000 / 1,000,000 × $3.75 = $0.015
  • Total text-token cost: approximately $0.03

This calculation excludes grounding, cache storage, retries and other billable services. It is an arithmetic example, not a prediction of the tokens your workload will use.

Build a migration evaluation set

Use 20 to 100 representative tasks rather than a few polished demo prompts. Include ordinary traffic, long inputs, ambiguous instructions, malformed tool results, safety-sensitive requests and known failure cases. For each task, record:

  • task success according to a written rubric;
  • structured-output validity;
  • tool-selection and argument accuracy;
  • end-to-end latency, including tools and network time;
  • input, output and thinking-token usage;
  • retry and timeout frequency;
  • cost per successfully completed task.

Keep human review for subjective or high-impact outputs. If an automated grader is used, test the grader too. A model can produce a fluent answer that fails a business rule, modifies the wrong record or omits a required citation.

Production rollout checklist

  1. Inventory every deprecated model or agent identifier in code, configuration, CI, dashboards and documentation.
  2. Update the SDK in a test branch and read its release notes.
  3. Make the replacement identifier explicit; do not rely indefinitely on automatic routing.
  4. Remove or adapt parameters that are unsupported by the target model and API path.
  5. Run a fixed evaluation set and compare quality, cost and end-to-end latency.
  6. Validate structured output and tool calls against application schemas.
  7. Deploy to a small traffic segment with model ID, request ID and safe usage metrics in logs.
  8. Set alerts for error rate, malformed function calls, timeouts and cost changes.
  9. Keep a tested rollback path that does not depend on an already deprecated identifier.
  10. Complete the Deep Research migration before October 23, 2026.

Common migration mistakes

Assuming automatic routing means no work is required. It keeps requests moving but hides the effective dependency.

Changing the model and every prompt simultaneously. That makes regressions difficult to attribute. Start with the smallest compatible change, measure it, then optimize prompts.

Comparing only response speed. Measure complete task latency and successful outcomes. Tool calls, retries and validation can dominate user-perceived time.

Using advertised capability as an application benchmark. Official specifications describe what the model supports. They do not guarantee your accuracy, cost or throughput.

Logging full prompts during the migration. Improve observability without copying secrets or personal data into logs. Prefer request IDs, redacted error categories and aggregated usage metrics.

Frequently asked questions

Will Gemini 3.7 Flash stop working immediately?

Google's October 8 release note says requests are automatically routed to Gemini 3.8 Flash. Google had not published a shutdown date for the 3.7 identifier in the official deprecations table when this guide was reviewed. Update explicitly anyway so your configuration matches the model actually used.

Should every Gemini 3.5 Flash application move directly to 3.8?

No. Google routes 3.5 Flash to 3.6 Flash, making 3.6 the conservative first replacement. Evaluate 3.8 if its capabilities fit your workload, but compare behavior and cost with representative tests.

What happens to Deep Research Pro preview on October 23?

Google says deep-research-pro-preview-12-2025 will be shut down. Migrate to one of the April 2026 Deep Research agents before that date and test citations, streaming and completion behavior.

Is Gemini 3.8 Flash pricing permanent?

No. The official pricing page labels the current $0.75 input and $3.75 output rates as introductory through December 31, 2026, with higher published rates beginning January 1, 2027.

Final recommendation

Update gemini-3.7-flash to gemini-3.8-flash explicitly. For gemini-3.5-flash, use 3.6 as the direct replacement or evaluate 3.8 as a deliberate model change. Prioritize the Deep Research migration because its October 23 shutdown date creates a clear operational deadline.

The reliable migration process is straightforward: inventory identifiers, update the SDK, adapt request parameters, evaluate realistic tasks, deploy gradually and monitor cost per successful outcome. That produces evidence your application works—not merely evidence that the API returned a response.

Official sources

Editorial verification: product facts, dates, specifications and pricing were checked against Google's official documentation on October 12, 2026. Recommendations and cost interpretation are Rubic8 analysis. No independent performance benchmark is claimed.


Rubic8 Editorial Team

Editorial Team

Rubic8 creates practical guides and free tools for developers, webmasters, and digital publishers. Our fast-changing technical content is reviewed against current primary documentation before publication.

We care about your data and would love to use cookies to improve your experience.