Short answer
If you’re starting a new project, don’t plan on Gemini 2.5 Pro. Google says access to the Gemini Developer API’s 2.5 models is limited to users who actively used them before, and recommends newer models for new projects. On Google Cloud’s Gemini Enterprise Agent Platform, the listed retirement date for gemini-2.5-pro was October 20, 2026—already past as of November 9, 2026. These are separate products with separate availability and lifecycle rules. (Gemini API deprecations; Google Cloud model page)
For existing Gemini Developer API users, Google’s documentation is not consistent: the Gemini API deprecations page says the 2.5 models will continue to be served until further notice, while Google AI Studio’s Gemini 2.5 Pro page says requests will be routed to Gemini 3.8 Flash starting December 1, 2026. The AI Studio page also limits current API access to existing users. Treat the December 1 change as the applicable transition notice for that route, and check both pages for updates. (Gemini API deprecations; AI Studio Gemini 2.5 Pro notice)
Practical choice: new users should start with a currently recommended model such as gemini-3.8-flash. Existing Gemini 2.5 API users should test their application against the replacement and review the migration changes before December 1. Don’t assume a Gemini Developer API key, model ID, or billing setup applies to Google Cloud’s separate route.
Which Gemini 2.5 API route do you mean?
| Route | Google’s route-specific guidance | What to do |
|---|---|---|
Gemini Developer API (Google AI Studio / ai.google.dev) |
Access to Gemini 2.5 models is limited to users who actively used them previously. Google AI Studio says requests to gemini-2.5-pro will automatically route to gemini-3.8-flash starting December 1, 2026, and be billed at Gemini 3.8 Flash rates. |
New users should choose a currently recommended model. Existing users should test the replacement and review the migration changes; don’t rely on the model name alone to describe what will serve a request after the transition. (AI Studio Gemini 2.5 Pro notice) |
| Gemini Enterprise Agent Platform (Google Cloud) | The Cloud model page lists gemini-2.5-pro with a retirement date of October 20, 2026 for support on that platform. Its footnote distinguishes the separate Gemini API. |
That listed date has passed. Confirm what your Cloud project can call and follow the Cloud migration guidance; don’t transfer Gemini Developer API lifecycle statements to this route. (Google Cloud model page) |
The Cloud model page’s listed limits and API support describe its Cloud model listing; they do not prove the retired Cloud model is still callable or automatically describe the separate Gemini Developer API. (Google Cloud model page)
Make a first request with a current alternative
This example follows Google’s Python quickstart pattern for Gemini 3.8 Flash through the Gemini Developer API. It is an alternative—not a Gemini 2.5 request. Google’s current getting-started guidance uses the Google Gen AI SDK and the Interactions API for the example request. (Gemini API getting started; Gemini API libraries)
Prerequisites
- Python and the Google Gen AI SDK.
- A Gemini API key associated with a Google Cloud project. A new user can create or view a key in Google AI Studio; Google says it creates a default project and API key after the user accepts the Terms of Service. (Gemini API key guidance)
- Use the key type and restrictions that apply to your account and request. Google documents both standard and authorization keys for the Gemini API. Since May 28, 2026, new keys created in AI Studio are authorization keys by default. Google rejects unrestricted standard keys; explicitly restricted standard keys continue to work. The key guidance describes Gemini API authentication generally, not a separate Interactions-only key rule. (Gemini API key guidance)
- Set the key as
GEMINI_API_KEYin your environment rather than hard-coding it. Google’s key guidance recommends environment variables. This Developer API example does not establish that billing must be enabled for every first call; Google Cloud setup requirements are separate. (Gemini API key guidance)
Steps
-
Install the SDK:
pip install -U google-genai -
Set the key in your shell, replacing the placeholder:
export GEMINI_API_KEY="YOUR_API_KEY" -
Save the following as
first_request.py:from google import genai client = genai.Client() interaction = client.interactions.create( model="gemini-3.8-flash", input="Explain API authentication in one sentence.", ) print(interaction.output_text) -
Run it from that directory:
python first_request.py
A text response printed to the terminal is the expected output. If authentication fails, check that the environment variable is set in the same shell, that the key is valid for the Gemini API, and that a standard key—if you use one—is explicitly restricted. Don’t apply the separate Cloud Agent Platform prerequisites to this Developer API example.
If you already call gemini-2.5-pro
- Identify the route first. Check whether requests go to the Gemini Developer API or Gemini Enterprise Agent Platform. Their setup and lifecycle notices differ.
- Test the replacement explicitly. For the Gemini Developer API, use
gemini-3.8-flashas the migration candidate named in Google AI Studio’s notice. For Google Cloud, consult that platform’s current migration guidance and confirm which model your project can call. Compare outputs and application behavior on representative prompts before changing production traffic. (AI Studio Gemini 2.5 Pro notice; Cloud model versions and lifecycle) - Review API changes, not just the model string. Google lists changes involving function calling and
thought_signaturevalidation, andthinking_levelreplacingthinking_budget. Review the Gemini 3.8 Flash migration guide for details that apply to your implementation, then test affected requests. (AI Studio Gemini 2.5 Pro notice) - Check billing for your route. For Gemini Developer API requests routed from
gemini-2.5-protogemini-3.8-flashstarting December 1, Google says Gemini 3.8 Flash rates apply. The notice does not give the rates; consult the current pricing page rather than inferring a cost. (AI Studio Gemini 2.5 Pro notice; Gemini API pricing) - Keep credentials private. Google’s key guidance distinguishes standard and authorization keys and explains its restriction on unrestricted standard keys. Follow the current instructions for the key type and API route your application uses. (Gemini API key guidance)
Bottom line
For a new integration, use a currently recommended model and the current Google Gen AI SDK rather than building around Gemini 2.5 Pro. For an existing Gemini Developer API integration, access is limited to prior active users, and Google AI Studio says requests will route to Gemini 3.8 Flash on December 1, 2026, at that model’s rates. Google’s broader deprecations page gives a different lifecycle description, so monitor both official notices. For Google Cloud, the published Gemini 2.5 Pro retirement date—October 20, 2026—has passed; follow the Cloud migration path and verify what your project can call.
Official documentation
- Gemini 2.5 Pro model page — Gemini API
- Gemini API deprecations
- Gemini 2.5 Pro notice — Google AI Studio
- Gemini API getting started
- Gemini API key guidance
- Gemini API pricing
- Gemini 2.5 Pro — Gemini Enterprise Agent Platform
- Cloud model versions and lifecycle
Sources
Gemini 2.5 Pro | Gemini API | Google AI for Developers
Gemini API deprecations | Google AI for Developers
Gemini 2.5 Pro | Gemini API | Google AI Studio
Getting started | Gemini API | Google AI Studio
Gemini API libraries | Google AI for Developers
Using Gemini API keys | Google AI for Developers
Gemini API pricing | Google AI for Developers
Gemini 2.5 Pro | Gemini Enterprise Agent Platform
Model versions and lifecycle | Gemini Enterprise Agent Platform
