All insights

Model APIs

Gemini 2.5 Flash API: availability, access, and migration

Gemini 2.5 Flash is access-limited, so it is not the recommended starting point for a new integration. Check Google’s lifecycle notices and follow a current Gemini API quickstart for a supported model.

Illustration for Gemini 2.5 flash api

Short answer: If you’re starting a new integration, don’t build it around Gemini 2.5 Flash. Google’s Gemini API lifecycle documentation limits access to people who have actively used 2.5 models before and recommends newer models for new projects. Google identifies Gemini 3.8 Flash as a stable model, and its Interactions API documentation says that API is generally available and recommended for new projects. (ai.google.dev)

There is a lifecycle discrepancy to be aware of: Google’s general Gemini API deprecation page says 2.5 models are not deprecated and will continue through the API until further notice. A model-specific AI Studio notice in the supplied research gives a December 1, 2026 routing date for Gemini 2.5 Flash. Those statements do not establish one clear transition schedule, so verify the current notice for your account before relying on a particular shutdown, routing, or billing outcome. (ai.google.dev)

Is Gemini 2.5 Flash available for a new production integration?

It is not a suitable default for a new project. Google’s current Gemini API lifecycle page restricts 2.5 access to previous active users and recommends Gemini 3.5 Flash-Lite or Gemini 3.8 Flash for new projects. The model ID for Gemini 2.5 Flash is gemini-2.5-flash; the older gemini-2.5-flash-preview-05-20 identifier belongs to a historical preview example, not the current recommended path. (ai.google.dev)

For a new Gemini API integration, Google lists Gemini 3.8 Flash as stable/GA, with no shutdown date announced on its lifecycle page. The Interactions API is generally available and recommended for new projects. These are the documented production signals for the replacement example below; normal project, key, quota, and service terms still apply. (ai.google.dev)

Vertex AI is a different case: Google Cloud marks Gemini 2.5 Flash retired on October 20, 2026. That date has passed, so don’t start a Vertex AI integration using that model. Choose a currently supported model and follow Vertex AI’s own setup and authentication documentation; the Gemini API quickstart below is not a Vertex AI setup guide. (docs.cloud.google.com)

Quickstart for a new Gemini API integration

This example uses Gemini 3.8 Flash, not Gemini 2.5 Flash. Google’s model documentation identifies it as stable/GA, and Google’s quickstart demonstrates the Interactions API call and output_text response field. (ai.google.dev)

Prerequisites: Python, pip, and a Gemini API key from Google AI Studio. Google says new users can create a project and API key in AI Studio. (aistudio.google.com)

  1. Install Google’s Python SDK:

    pip install -U google-genai
    
  2. Set the key in your environment. On macOS or Linux:

    export GEMINI_API_KEY="YOUR_API_KEY"
    

    In PowerShell:

    $env:GEMINI_API_KEY="YOUR_API_KEY"
    

    The Google Gen AI Python SDK automatically picks up GEMINI_API_KEY when creating a Gemini Developer API client. New AI Studio keys are authorization keys by default. Google rejects unrestricted standard keys; standard keys with explicit restrictions continue to work. Keep credentials out of source control and client-side code. (googleapis.github.io)

  3. Save and run this as quickstart.py:

    from google import genai
    
    client = genai.Client()
    interaction = client.interactions.create(
        model="gemini-3.8-flash",
        input="Reply with the words: API call succeeded",
    )
    
    text = interaction.output_text
    print(text)
    
    if not text:
        raise RuntimeError("The API returned no output text")
    

    Expected outcome: the program prints the model’s text response. That verifies the SDK, environment key, model ID, and request path work together; it is not a load, latency, or production-readiness test. Google’s current quickstart uses this model and Interactions API pattern. (aistudio.google.com)

If you’re migrating existing 2.5 Flash code

Don’t assume that changing only the model string will preserve your application’s behavior. Google’s general lifecycle page and the model-specific notice in the supplied research give conflicting timing information for 2.5 Flash. The available evidence here does not establish a definitive replacement billing rule or a complete set of destination-specific breaking changes. Check the current model-specific migration guidance, then test your prompts and features against the model and API you plan to use before release. (ai.google.dev)

The historical 2025 example uses gemini-2.5-flash-preview-05-20 with generate_content; it is not a verified current production quickstart. Avoid copying that preview ID or its feature configuration into a new integration without checking current documentation. (ai.google.dev)

Production checks before shipping

  • Confirm access and lifecycle. Check the exact model ID and channel you intend to use. The Gemini API and Vertex AI have separate lifecycle and setup information; don’t assume that availability on one means availability on the other. (ai.google.dev)
  • Protect credentials. Use an appropriately restricted or authorization key, and keep it server-side. Google documents that unrestricted standard keys are rejected while explicitly restricted standard keys continue to work. (aistudio.google.com)
  • Check project-specific quotas. Gemini API limits vary by model and project. Review the active limits for your project rather than assuming a generic quota applies. (aistudio.google.com)
  • Account for transient errors. Google says its official Gemini API SDKs retry transient errors with exponential backoff; its Python SDK retries up to four times, with an initial delay of about one second and a maximum delay of 60 seconds. Decide how your application handles errors that persist after those retries. (ai.google.dev)
  • Test the destination, not just connectivity. Compare outputs and the features your application depends on using representative requests. A successful minimal call does not show that a different model will preserve your application’s behavior.

Direct Google API versus a third-party router

A direct Gemini API integration uses Google’s SDK, API key, and model ID. A third-party router may instead use its own endpoint, credentials, aliases, fees, and routing behavior. For example, Requesty’s supplied Python example uses its router URL and a Requesty API key; those are Requesty integration details, not Google API instructions. (aicoder.com)

Sources

Gemini 2.5 Flash — Gemini API

Gemini deprecations — Gemini API

Gemini 2.5 Flash — Google AI Studio Documentation

Gemini 2.5 Flash — Google Cloud Documentation

Gemini 3.8 Flash — Gemini API

Developer’s guide to Gemini 3.8 Flash — Google Cloud Documentation

Interactions API — Google AI Studio Documentation

What’s new in Gemini 3.8 Flash — Google AI Studio Documentation

Getting started — Gemini API

Google Gen AI Python SDK documentation

Using Gemini API keys — Google AI Studio Documentation

Troubleshooting guide — Gemini API

Rate limits — Gemini API

Requesty: Gemini 2.5 Flash model and API page

Gemini API I/O updates

Contact us