google.com

Command Palette

Search for a command to run...

Gemini API libraries  |  Google AI for Developers

Last updated: 10/17/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

Gemini 4 Argon is now available. Try it out.

Send feedback

Gemini API libraries

When building with the Gemini API, we recommend using the Google GenAI SDK. These are the official, production-ready libraries that we develop and maintain for the most popular languages. They are in General Availability and used in all our official documentation and examples.

Note: If you're using one of our legacy libraries, we strongly recommend you migrate to the Google GenAI SDK. Review the legacy libraries section for more information. If you're using an AI coding assistant, install the Gemini API development skill to give your agent access to the latest documentation and best practices.

If you're new to the Gemini API, follow our Get started guide to get started.

Language support and installation

The Google GenAI SDK is available for the Python, JavaScript/TypeScript, Go and Java languages. You can install each language's library using package managers, or visit their GitHub repos for further engagement:

Python

JavaScript

Go

Java

  • Library: google-genai

  • GitHub Repository: googleapis/java-genai

  • Installation: If you're using Maven, add the following to your dependencies:

<dependencies> <dependency> <groupId>com.google.genai</groupId> <artifactId>google-genai</artifactId> <version>1.0.0</version> </dependency> </dependencies>

C#

General availability

As of May 2025, the Google GenAI SDK has reached General Availability (GA) across all supported platforms and are the recommended libraries to access the Gemini API. They are stable, fully supported for production use, and are actively maintained. They provide access to the latest features, and offer the best performance working with Gemini.

If you're using one of our legacy libraries, we strongly recommend you migrate so that you can access the latest features and get the best performance working with Gemini. Review the legacy libraries section for more information.

Legacy libraries and migration

If you are using one of our legacy libraries, we recommend that you migrate to the new libraries.

The legacy libraries don't provide access to recent features (such as Live API and Veo) and are deprecated as of November 30th, 2025.

Each legacy library's support status varies, detailed in the following table:

LanguageLegacy librarySupport statusRecommended library
Python[google-generativeai](https://github.com/google-gemini/deprecated-generative-ai-python)Not actively maintained[google-genai](https://github.com/googleapis/python-genai)
JavaScript/TypeScript[@google/generativeai](https://github.com/google-gemini/generative-ai-js)Not actively maintained[@google/genai](https://github.com/googleapis/js-genai)
Go[google.golang.org/generative-ai](https://github.com/google/generative-ai-go)Not actively maintained[google.golang.org/genai](https://github.com/googleapis/go-genai)
Dart and Flutter[google_generative_ai](https://pub.dev/packages/google_generative_ai/install)Not actively maintainedUse Genkit Dart or Firebase AI Logic
Swift[generative-ai-swift](https://github.com/google/generative-ai-swift)Not actively maintainedUse Firebase AI Logic
Android[generative-ai-android](https://github.com/google-gemini/generative-ai-android)Not actively maintainedUse Firebase AI Logic

Note for Java developers: There was no legacy Google-provided Java SDK for the Gemini API, so no migration from a previous Google library is required. You can start directly with the new library in the Language support and installation section.

Send feedback

Related Articles