Repository Public
1# Gemini API libraries23<br />45When building with the Gemini API, we recommend using the **Google GenAI SDK** .6These are the official, production-ready libraries that we develop and maintain7for the most popular languages. They are in [General Availability](https://ai.google.dev/gemini-api/docs/libraries#new-libraries) and used in all our official8documentation and examples.910> [!NOTE]11> **Note:** If you're using one of our legacy libraries, we strongly recommend you [migrate](https://ai.google.dev/gemini-api/docs/migrate) to the Google GenAI SDK. Review the [legacy libraries](https://ai.google.dev/gemini-api/docs/libraries#previous-sdks) section for more information. If you're using an AI coding assistant, install the [Gemini API development skill](https://ai.google.dev/gemini-api/docs/coding-agents) to give your agent access to the latest documentation and best practices.1213If you're new to the Gemini API, follow our [Get started guide](https://ai.google.dev/gemini-api/docs/get-started) to get started.1415## Language support and installation1617The Google GenAI SDK is available for the Python, JavaScript/TypeScript, Go and18Java languages. You can install each language's library using package managers,19or visit their GitHub repos for further engagement:2021### Python2223- Library: [`google-genai`](https://pypi.org/project/google-genai)2425- GitHub Repository: [googleapis/python-genai](https://github.com/googleapis/python-genai)2627- Installation: `pip install google-genai`2829### JavaScript3031- Library: [`@google/genai`](https://www.npmjs.com/package/@google/genai)3233- GitHub Repository: [googleapis/js-genai](https://github.com/googleapis/js-genai)3435- Installation: `npm install @google/genai`3637### Go3839- Library: [`google.golang.org/genai`](https://pkg.go.dev/google.golang.org/genai)4041- GitHub Repository: [googleapis/go-genai](https://github.com/googleapis/go-genai)4243- Installation: `go get google.golang.org/genai`4445### Java4647- Library: `google-genai`4849- GitHub Repository: [googleapis/java-genai](https://github.com/googleapis/java-genai)5051- Installation: If you're using Maven, add the following to your dependencies:5253 <dependencies>54 <dependency>55 <groupId>com.google.genai</groupId>56 <artifactId>google-genai</artifactId>57 <version>1.0.0</version>58 </dependency>59 </dependencies>6061### C#6263- Library: `Google.GenAI`6465- GitHub Repository: [googleapis/dotnet-genai](https://googleapis.github.io/dotnet-genai/)6667- Installation: `dotnet add package Google.GenAI`6869## General availability7071As of May 2025, the Google GenAI SDK has reached General Availability (GA) across72all supported platforms and are the recommended libraries to access the Gemini API.73They are stable, fully supported for production use, and are actively maintained.74They provide access to the latest features, and offer the best performance working75with Gemini.7677If you're using one of our legacy libraries,78we strongly recommend you migrate so that you can access the latest features and79get the best performance working with Gemini. Review the [legacy libraries](https://ai.google.dev/gemini-api/docs/libraries#previous-sdks) section for more information.8081## Legacy libraries and migration8283If you are using one of our legacy libraries, we recommend that you84[migrate to the new libraries](https://ai.google.dev/gemini-api/docs/migrate).8586The legacy libraries don't provide access to recent features (such as87[Live API](https://ai.google.dev/gemini-api/docs/live) and [Veo](https://ai.google.dev/gemini-api/docs/video)) and are88deprecated as of November 30th, 2025.8990Each legacy library's support status varies, detailed in the following table:9192| Language | Legacy library | Support status | Recommended library |93|---|---|---|---|94| **Python** | `https://github.com/google-gemini/deprecated-generative-ai-python` | Not actively maintained | `https://github.com/googleapis/python-genai` |95| **JavaScript/TypeScript** | `https://github.com/google-gemini/generative-ai-js` | Not actively maintained | `https://github.com/googleapis/js-genai` |96| **Go** | `https://github.com/google/generative-ai-go` | Not actively maintained | `https://github.com/googleapis/go-genai` |97| **Dart and Flutter** | `https://pub.dev/packages/google_generative_ai/install` | Not actively maintained | Use [Genkit Dart](https://genkit.dev/docs/dart/get-started/) or [Firebase AI Logic](https://pub.dev/packages/firebase_ai) |98| **Swift** | `https://github.com/google/generative-ai-swift` | Not actively maintained | Use [Firebase AI Logic](https://firebase.google.com/products/firebase-ai-logic) |99| **Android** | `https://github.com/google-gemini/generative-ai-android` | Not actively maintained | Use [Firebase AI Logic](https://firebase.google.com/products/firebase-ai-logic) |100101**Note for Java developers:** There was no legacy Google-provided Java SDK for102the Gemini API, so no migration from a previous Google library is required. You103can start directly with the new library in the104[Language support and installation](https://ai.google.dev/gemini-api/docs/libraries#install) section.