@google/genai
3.6.1 · 18 Nov 2026Apache-2.032.9M / weekRepositoryHomepagenpmAtom feed
3.6.1 is the newest release of 3.x.
Summary· from the note as AI read it
Security fixUpgrade: this release fixes a security issue.
Before you upgrade
- Gemini Developer API now defaults to v1; set apiVersion 'v1beta' if needed
- Gemini Developer API now defaults to v1; set apiVersion 'v1beta' if needed
- Replace *-latest model aliases with specific versions or switch back to v1beta
- Narrow CodeExecutionResultStep.result union before using it as a string
- CLI transcribe default model changed; pass a model explicitly to keep the old one
- Gemini Developer API now defaults to v1; set apiVersion 'v1beta' if needed
- GenerateVideos no longer available for Gemini API; use Vertex AI instead
- Narrow CodeExecutionResultStep.result union before using it as a string
New minimums
- Upgrade to Node.js 22 or pin @google/genai@^2
- Upgrade to Node.js 22 or pin @google/genai@^2
- Upgrade to Node.js 22 or pin @google/genai@^2
Security
- protobufjs and ws raised to patched versions; ensure lockfile picks them up
New
- Add
source_texttoAudioTranscriptionConfigandSmartTranscriptionMode. - Add MALFORMED_RESPONSE to FinishReason
- interactions: add Office and OpenDocument MIME types
- support GOOGLE_GENAI_API_VERSION environment variable across SDKs
In short
10 breaking1 removed1 security4 new3 fixed1 internal
- Breaking
Default Gemini Developer API version is now
v1(wasv1beta) - Breaking
Clients targeting the Gemini Developer API now default to API version
v1instead ofv1beta. - Breaking
Some model aliases are not available on
v1, notably:gemini-flash-latest,gemini-flash-lite-latestandgemini-pro-latest. They exist only onv1beta. To keep using them, use a specific model version, or switch back tov1betaas shown below. - Breaking
Minimum supported Node.js version is now 22 (was 20)
- Breaking
Following Node.js 20 reaching end-of-life (2026-04-30),
package.jsonengines.nodenow requires>=22.0.0. - Breaking
interactions:
CodeExecutionResultStep.resultis now typed asArray<Content> | string(CodeExecutionResultStepResult) instead ofstring. The JSON and runtime value for text-only results are still a plainstring, but TypeScript code readingstep.resultas astringmay need to narrow the union (typeof step.result === 'string'). - Breaking
cli: use gemini-3.5-transcribe as default model for transcribe command
- Breaking
default Gemini API version to v1 instead of v1beta across SDKs
Release note
Breaking changes
- Breaking
Default Gemini Developer API version is now
v1(wasv1beta)Clients targeting the Gemini Developer API now default to API version
v1instead ofv1beta.No effect on Gemini Enterprise (Vertex AI) defaults: Clients with
vertexai: trueare unaffected by this default change and continue to default tov1beta1.Some model aliases are not available on
v1, notably:gemini-flash-latest,gemini-flash-lite-latestandgemini-pro-latest. They exist only onv1beta. To keep using them, use a specific model version, or switch back tov1betaas shown below.How to configure or restore the previous default via environment variable (Node.js): Set
GOOGLE_GENAI_API_VERSION(works for both Gemini Developer API and Enterprise / Vertex AI clients when no version is set in code):# Restores the beta default ('v1beta' on Gemini Developer API, 'v1beta1' on Enterprise / Vertex AI) export GOOGLE_GENAI_API_VERSION=beta # Or set an explicit API version string on either platform (e.g. 'v1', 'v1beta', 'v1beta1') export GOOGLE_GENAI_API_VERSION=v1betaHow to set the API version in code: Pass
apiVersion(orhttpOptions.apiVersion) toGoogleGenAI(takes precedence overGOOGLE_GENAI_API_VERSION):import { GoogleGenAI } from '@google/genai'; const ai = new GoogleGenAI({ apiVersion: 'v1beta', });
- Breaking
Minimum supported Node.js version is now 22 (was 20)
Following Node.js 20 reaching end-of-life (2026-04-30),
package.jsonengines.nodenow requires>=22.0.0.There are no runtime API or bundle changes resulting from this bump, and both CommonJS and ESM bundles continue to be published.
Users who must remain on Node.js 20 should pin to
@google/genai@^2(or ignore engine checks if supported by their environment).
- Breaking
interactions:
CodeExecutionResultStep.resultis now typed asArray<Content> | string(CodeExecutionResultStepResult) instead ofstring(b36ce99). The JSON and runtime value for text-only results are still a plainstring, but TypeScript code readingstep.resultas astringmay need to narrow the union (typeof step.result === 'string').
Features
Add
source_texttoAudioTranscriptionConfigandSmartTranscriptionMode.Add MALFORMED_RESPONSE to FinishReason (032d50c), refs #2937
cli: use gemini-3.5-transcribe as default model for transcribe command
Default Gemini API version to v1 instead of v1beta across SDKs
Disable GenerateVideos for Gemini API, update tests/READMEs
- Removed
Drop support for Node 20; Node.js >=22 is now required
interactions: add Office and OpenDocument MIME types
interactions: support multimodal content in CodeExecutionResultStep.result
Support GOOGLE_GENAI_API_VERSION environment variable across SDKs
Update discovery doc
Bug Fixes
Raise protobufjs and ws minimums to patched versions (71827d0), refs #1611
Reject Live.connect() when the WebSocket errors or closes before setup completes (04eaa81), refs #1257
Respect configured and default API version for Gemini API file uploads across SDKs
Stop emitting array indices in auth token fieldMask (80e7b3d), refs #1492
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.