npm install @google/genai@2.31.0Google Gen AI SDK (JS/TS) (@google/genai) is currently at v2.31.0 on NPM (published 2026-10-23), with a 90-day stability score of 82/100 (B+) and MEDIUM schema drift risk across 20 releases in the past 90 days. Replaces deprecated @google/generative-ai package; v2.x standardizes ai.models.generateContent and functionDeclarations schema typing. Production teams should pin npm install @google/genai@2.31.0 rather than using unpinned @latest tags.
Breaking Changes & Tool Schema Drift Analysis
Replaces deprecated @google/generative-ai package; v2.x standardizes ai.models.generateContent and functionDeclarations schema typing.
GoogleGenAIai.models.generateContentFunctionDeclarationimport { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI(API_KEY);
const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro" });import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({ apiKey: API_KEY });
const response = await ai.models.generateContent({ model: "gemini-2.5-pro", contents: "Hello" });Frequently Asked Questions: @google/genai
What is the latest version of @google/genai on NPM?
As of 2026-10-24, the latest stable version of @google/genai (Google Gen AI SDK (JS/TS) by Google) on NPM is v2.31.0, published on 2026-10-23. It has shipped 20 releases in the last 90 days.
Does @google/genai v2.31.0 have breaking changes or MCP schema drift risk?
@google/genai currently carries a MEDIUM schema drift risk rating with a Stability Score of 82/100 (Grade B+). Replaces deprecated @google/generative-ai package; v2.x standardizes ai.models.generateContent and functionDeclarations schema typing.
How do I safely pin @google/genai in production?
Avoid unpinned @latest tags in production agent configs. Pin the exact verified version using `npm install @google/genai@2.31.0` and monitor GoogleGenAI, ai.models.generateContent, FunctionDeclaration for parameter or schema changes.
Get Instant Breaking-Change Alerts for @google/genai
We poll NPM and googleapis/js-genai every 30 minutes. Get an email with the exact diff when @google/genai ships a breaking release beyond v2.31.0.
Recent NPM Releases
Verified release timestamps from live registry metadata.
Related in Agent SDKs
View Hub ->OpenAI Node SDK • Stability B (78)
Anthropic TypeScript SDK • Stability C+ (70)
Model Context Protocol TypeScript SDK • Stability B (78)
Vercel AI SDK Core • Stability C+ (70)
Vercel AI SDK OpenAI Provider • Stability B (78)
Vercel AI SDK Anthropic Provider • Stability B (78)