# @google/generative-ai

> Google AI JavaScript SDK

Latest version **0.24.1** (published 2025-04-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @google/generative-ai
pnpm add @google/generative-ai
yarn add @google/generative-ai
bun add @google/generative-ai
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.24.1 |
| Published | 2025-04-29 |
| First published | 2023-12-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 0 |
| Unpacked size | 410.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1238 |
| Maintainers | google-wombot, ofrobots, mrdoob, bcoe |

## Links

- npm: https://www.npmjs.com/package/@google/generative-ai
- Repository: https://github.com/google/generative-ai-js
- Homepage: https://github.com/google/generative-ai-js#readme
- Issues: https://github.com/google/generative-ai-js/issues
- npm.io page: https://npm.io/package/@google/generative-ai

## Recent versions

- 0.24.1 (latest) — 2025-04-29
- 0.16.1 (0.16-patch) — 2024-09-05
- 0.24.0 — 2025-03-07
- 0.23.0 — 2025-03-03
- 0.22.0 — 2025-02-20
- 0.21.0 — 2024-10-02
- 0.20.0 — 2024-09-26
- 0.19.0 — 2024-09-12
- 0.18.0 — 2024-09-11
- 0.17.2 — 2024-09-10
- 0.17.1 — 2024-08-22
- 0.17.0 — 2024-08-13
- 0.16.0 — 2024-07-24
- 0.15.0 — 2024-07-15
- 0.14.1 — 2024-07-01
- … 25 more at https://npm.io/package/@google/generative-ai/versions

## README

# [Deprecated] Google AI JavaScript SDK for the Gemini API

With Gemini 2.0, we took the chance to create a single unified SDK for all developers who want to use Google's GenAI models (Gemini, Veo, Imagen, etc). As part of that process, we took all of the feedback from this SDK and what developers like about other SDKs in the ecosystem to create the [Google Gen AI SDK](https://github.com/googleapis/js-genai). 

The full migration guide from the old SDK to new SDK is available in the [Gemini API docs](https://ai.google.dev/gemini-api/docs/migrate).

The Gemini API docs are fully updated to show examples of the new Google Gen AI SDK. We know how disruptive an SDK change can be and don't take this change lightly, but our goal is to create an extremely simple and clear path for developers to build with our models so it felt necessary to make this change.

Thank you for building with Gemini and [let us know](https://discuss.ai.google.dev/c/gemini-api/4) if you need any help!

**Please be advised that this repository is now considered legacy.** For the latest features, performance improvements, and active development, we strongly recommend migrating to the official **[Google Generative AI SDK for JavaScript](https://github.com/googleapis/js-genai)**.

**Support Plan for this Repository:**

*   **Limited Maintenance:** Development is now restricted to **critical bug fixes only**. No new features will be added.
*   **Purpose:** This limited support aims to provide stability for users while they transition to the new SDK.
*   **End-of-Life Date:** All support for this repository (including bug fixes) will permanently end on **August 31st, 2025**.

We encourage all users to begin planning their migration to the [Google Generative AI SDK](https://github.com/googleapis/js-genai) to ensure continued access to the latest capabilities and support.

---
_Source: https://npm.io/package/@google/generative-ai · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
