Google Gen AI Python SDK 3.1.0, released on November 10, 2026, adds support for gemini-omni-1.2-flash, a new proactive_video setting for the Gemini Live API, an xhigh thinking level for the Interactions API, and more embedding response metadata for Gemini Enterprise Agent Platform. If you are new to the SDK, the practical first step is simple: install version 3.1.0, create a client with your Gemini API key, and use the Interactions API for a small request before moving to video, live streaming, or enterprise embeddings.
The official Google Gen AI Python SDK 3.1.0 release notes list the changes. This is a feature update released four days after version 3.0.0, which changed the default Gemini Developer API version from v1beta to v1. That recent major-version change matters when you upgrade from an older application.
Key takeaways
- Version 3.1.0 was published on November 10, 2026, and requires Python 3.11 or later.
gemini-omni-1.2-flashis now available in the Python SDK Interactions model list and is the default model for thegemini-api videocommand.- The Live API now exposes
proactive_video, which requiresproactive_audioand can increase cost as incoming images increase. - Gemini Enterprise embedding responses can now include
usage_metadata, includingtraffic_type, plus atruncatedindicator. - Beginners should start with an explicit model ID and check the model list rather than relying on aliases that may differ between API versions.
What changed in Google Gen AI Python SDK 3.1.0?
The google-genai package is Google's Python SDK for integrating generative models into Python applications. It supports the Gemini Developer API and Gemini Enterprise Agent Platform. Version 3.1.0 is a focused release. It adds model names and configuration fields rather than changing the basic client pattern.
| Change | Where it applies | Why it matters |
|---|---|---|
gemini-omni-1.2-flash | Interactions API and gemini-api video | You can select the newer Gemini Omni video model explicitly in Python. |
proactive_video | Gemini Live API | A live app can allow generation to be triggered by received images, subject to the required audio setting. |
xhigh | Interactions thinking level | The Interactions type accepts a higher thinking-level value. |
usage_metadata and truncated | Gemini Enterprise embeddings | You can inspect whether embedding input was truncated and read returned usage information. |
gemini-4-carbon | Interactions model enum | The SDK recognizes another model identifier in the Interactions API. |
The release also updates documentation links from ai.google.dev to aistudio.google.com. That is documentation maintenance, but it is useful when you are following older tutorials. If a link in an old example redirects, look for the corresponding Google AI Studio documentation page.
Why the Gemini Omni 1.2 Flash addition matters
The headline change is gemini-omni-1.2-flash. Google describes it in the SDK change as a multimodal model for fast, conversational video generation, editing, and cinematic control. The SDK adds it to the Interactions Model type, so a Python application can use the model name without treating it as an unknown value.
The same release changes the default model behind the gemini-api video command from gemini-omni-1.1-flash to gemini-omni-1.2-flash. The earlier gemini-omni-1.1-flash and gemini-omni-flash-preview model choices remain available when you specify them with the command's model option.
For a beginner, the important idea is model selection. A model ID is a string that tells the service what capability you want. Do not assume that a name ending in latest is available in every API version. Use a named model where possible, especially while learning and debugging.
Use the Interactions API for your first call
The Interactions API is the simplest place to see the new model ID in code. Google documents Interactions as a unified API for working with Gemini models and agents, including server-side state, tool orchestration, and long-running work. A basic interaction returns an object with output_text.
import os
from google import genai
# Set GEMINI_API_KEY in your terminal before running this file.
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
interaction = client.interactions.create(
model="gemini-omni-1.2-flash",
input="Describe a short product video concept for a reusable water bottle."
)
print(interaction.output_text)Save the file as first_interaction.py. This example demonstrates that your application can select the new model through the SDK. It does not save a generated video file. Video output has its own request and output handling, and beginners should first confirm authentication, package installation, and model access with a small interaction.
Install version 3.1.0 and create a client
The package name is google-genai, while the import is from google import genai. Version 3.1.0 declares Python 3.11 as its minimum version. Check your local version before installing.
python --version
python -m pip install --upgrade google-genai==3.1.0On macOS and Linux, set your API key for the current terminal session like this:
export GEMINI_API_KEY="your-api-key"On PowerShell, use:
$env:GEMINI_API_KEY="your-api-key"Then create the client without placing the secret directly in source code:
from google import genai
client = genai.Client()
response = client.models.generate_content(
model="gemini-3.8-flash",
contents="Explain a Python list in two short sentences."
)
print(response.text)The SDK reads GEMINI_API_KEY or GOOGLE_API_KEY from the environment. Google's SDK README recommends setting only one. If both are present, GOOGLE_API_KEY takes precedence. Keep keys out of Git repositories, sample projects, browser code, and screenshots.
How proactive video works in the Live API
Version 3.1.0 adds proactive_video to ProactivityConfig. The generated SDK type says that, when enabled, the system might trigger generation for each received image. It also says that proactive_audio must be enabled and warns that the generation rate depends on the rate of incoming images, which can significantly increase cost.
That wording matters. Proactive video is not a normal setting for a first chatbot. It fits a real-time application that continuously sends visual input, such as a camera-assisted experience. Each incoming image can become meaningful to the service, so you should test with a controlled frame rate and an explicit budget.
from google.genai import types
proactivity = types.ProactivityConfig(
proactive_audio=True,
proactive_video=True,
)This code creates the configuration object only. It does not open a live session by itself. The exact Live API connection, media streaming, session lifecycle, and output processing should be built from the current Live API documentation for the model and service you are using. Start with proactive_video=False unless image-triggered generation is a clear product requirement.
What to watch for with proactive video
- Enable
proactive_audiowhen enablingproactive_video, because the SDK type requires it. - Do not send every camera frame by default. Reduce image frequency before testing the feature.
- Track API usage and set project-level controls before exposing the feature to users.
- Make the app behavior clear to users when it processes camera or other visual input.
What xhigh thinking level means for Interactions
The release adds the string value xhigh to the Interactions API's thinking-level type. This is separate from the general SDK ThinkingLevel enum used in other model configuration paths, which exposes values such as MINIMAL, LOW, MEDIUM, and HIGH.
Do not read the new value as a promise of better results for every prompt. The release notes only confirm that the SDK accepts the additional Interactions setting. The model and service documentation determine which thinking levels a particular model supports, as well as any latency or usage effects.
If you are new to generative AI APIs, leave thinking settings at their default while you build a correct request flow. Add tuning after you have clear evaluation prompts and can compare response quality, elapsed time, and usage for your own scenario.
Embedding response metadata for Gemini Enterprise apps
An embedding converts content into numeric vectors that an application can compare, store, and search. Common uses include semantic search, document matching, clustering, and retrieval-augmented generation. Version 3.1.0 adds usage_metadata and truncated to EmbedContentResponse for Gemini Enterprise Agent Platform.
The truncated field tells you whether input content was shortened before an embedding was created. That is useful because a successful request does not automatically mean all supplied input was represented. The new usage_metadata field can include traffic_type.
from google import genai
client = genai.Client(
enterprise=True,
project="your-project-id",
location="global",
)
response = client.models.embed_content(
model="gemini-embedding-001",
contents="A beginner-friendly introduction to vector embeddings."
)
print("Was input truncated?", response.truncated)
if response.usage_metadata:
print("Traffic type:", response.usage_metadata.traffic_type)
embedding = response.embeddings[0].values
print("Embedding dimensions returned:", len(embedding))This is an Enterprise example. It uses enterprise=True, a Google Cloud project ID, and the global location shown in the SDK documentation. Do not use this metadata as a substitute for application logging. Record request IDs, input size, errors, and the model version your application selected, while keeping user data and secrets out of logs.
Upgrade safely from version 3.0.0 or older
Upgrading to 3.1.0 is a small package change, but version 3.0.0 introduced a behavior change that can affect existing Gemini Developer API apps. In 3.0.0, the default Gemini Developer API version changed from v1beta to v1. Enterprise clients created with vertexai=True or enterprise=True were not affected by that default change.
Google's 3.0.0 release notes also state that some aliases, including gemini-flash-latest, gemini-flash-lite-latest, and gemini-pro-latest, are available only on v1beta. If your application used one of those aliases, test it before and after upgrading.
You can set GOOGLE_GENAI_API_VERSION=beta to restore the beta default where that is appropriate for your application. But a better long-term move is usually to select a specific supported model version and update your code based on current service documentation.
# Example only. Use this only if your application needs the beta API behavior.
export GOOGLE_GENAI_API_VERSION=betaA beginner checklist for version 3.1.0
- Use Python 3.11 or later.
- Create a virtual environment for the project.
- Install the exact package version with
python -m pip install --upgrade google-genai==3.1.0. - Set one API-key environment variable, preferably
GEMINI_API_KEY. - Run a small
generate_contentor Interactions request first. - Use an explicit model ID such as
gemini-omni-1.2-flashwhen testing the new release feature. - Add Live API video settings only after you understand how often your app sends images and how you will monitor usage.
- For Enterprise embeddings, check
response.truncatedandresponse.usage_metadatain your test logs.
Frequently asked questions
What is new in Google Gen AI Python SDK 3.1.0?
Google Gen AI Python SDK 3.1.0 adds gemini-omni-1.2-flash, makes it the default for the gemini-api video command, adds Live API proactive_video, adds Interactions xhigh thinking level support, and adds new embedding response metadata for Gemini Enterprise Agent Platform.
How do I install Google Gen AI Python SDK 3.1.0?
Use python -m pip install --upgrade google-genai==3.1.0. The published package requires Python 3.11 or later.
Do I need to change my code for gemini-omni-1.2-flash?
You only need to change code if you want to select the new model. In an Interactions request, set model="gemini-omni-1.2-flash". Test model availability and output handling in your own project before making it a production default.
Should beginners enable proactive_video?
Usually no. proactive_video is for Live API applications that receive images continuously. It requires proactive_audio and may increase cost based on the number of incoming images.
What does truncated mean in an embedding response?
For Gemini Enterprise embedding requests, response.truncated indicates whether the service shortened input content before creating the embedding. Check it when input completeness matters to your search or retrieval feature.
Based on reporting by GitHub, Google APIs GitHub repository, PyPI and Google Cloud Documentation.

Join the conversation! Your thoughts help the community grow.