The Google Gen AI SDK provides a unified interface to Gemini 2.5 Pro and Gemini 2.0 models through both the Gemini Developer API and the Gemini API on Gemini Enterprise Agent Platform. With a few exceptions, code that runs on one platform will run on both. This means that you can prototype an application using the Gemini Developer API and then migrate the application to Gemini Enterprise Agent Platform without rewriting your code.
To learn more about the differences between the Gemini Developer API and Gemini on Gemini Enterprise Agent Platform, see Migrate from the Gemini Developer API to the Gemini API in Gemini Enterprise Agent Platform .
Python
The Google Gen AI SDK for Python is available on PyPI and GitHub:
To learn more, see the Python SDK reference .
Install
pip install --upgrade google-genai
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Quickstart
Choose one of the following options, depending on whether you're using Agent Platform in express mode or not.
- Use Agent Platform (with all Google Cloud capabilities and services)
- Use Agent Platform in express mode
Go
The Google Gen AI SDK for Go is available on go.dev and GitHub:
Install
go get google.golang.org/genai
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Quickstart
Node.js
The Google Gen AI SDK for TypeScript and JavaScript is available on npm and GitHub:
Install
npm install @google/genai
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Quickstart
Java
The Google Gen AI SDK for Java is available on Maven Central and GitHub:
Maven Install
<dependencies>
<dependency>
<groupId>com.google.genai</groupId>
<artifactId>google-genai</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Quickstart
C#
The Google Gen AI SDK for .NET is available on NuGet and GitHub:
Install
dotnet add package Google.GenAI
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True

