npm / @google/genai
@google/genai
What changed in @google/genai 1 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
31 breaking2 security6 deprecations242 new APIs and options2 performance15 behavior and defaults40 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@google/genai 344 changes
Breaking changes 9
Makes gemini-omni-1.2-flash the default for gemini-api video.
Gemini Developer API clients now default to v1 instead of v1beta; Vertex AI clients remain on v1beta1.
Auth token fieldMask output no longer includes array indices.
The result type is now Array<Content> | string, allowing multimodal content; text-only runtime values remain plain strings.
GenerateVideos is disabled for the Gemini API.
Set this environment variable to choose an API version or restore the previous beta default when no version is set in code.
Live.connect() now rejects if the WebSocket errors or closes before setup completes.
The minimum supported Node.js version is now 22; users who must remain on Node.js 20 should pin to @google/genai@^2.
The minimum supported Node.js version is now 22; Node.js 20 users should pin to @google/genai@^2 or ignore engine checks if supported.
New APIs and options 28
Function result schemas were added to the public SDK.
Tool retrieval was added to the public SDK.
Live Interactions types and an auth-token client are generated in the public SDKs.
Experimental SDK support is added for Live Interactions over WebSocket and WebRTC.
Supports batch inputs for Gemini embedding models on the Gemini Enterprise API.
Exposes static file processing options in Interactions.
Adds tool search types to the Interactions SDKs.
Supports usage metadata for Gemini embedding models on the Gemini Enterprise API.
Adds gemini-4-hydrogen to the Model enum for interactions.
Adds XHIGH and xhigh to ThinkingLevel across the GenAI SDKs and CLI.
Adds the Decisions API to the GenAI SDKs.
Introduces custom_config in SDKs and CLI.
Introduces environment_key in SDKs and CLI.
Introduces self-hosted BYOS mode in SDKs and CLI.
Introduces system_instruction in SDKs and CLI.
Adds truncated to EmbedContentResponse for the Gemini Enterprise API.
Adds usage_metadata, including traffic_type, to EmbedContentResponse for the Gemini Enterprise API.
Adds gemini-4-carbon to the Interactions Model enum.
Adds gemini-omni-1.2-flash as a model.
Adds gemini-omni-1.2-flash to the Interactions Model enum.
Adds proactive_video to ProactivityConfig for the Live API.
Adds the xhigh thinking level to Interactions ThinkingLevel.
Pass apiVersion or httpOptions.apiVersion to GoogleGenAI to set the API version in code; this takes precedence over GOOGLE_GENAI_API_VERSION.
Adds the source_text field to AudioTranscriptionConfig.
Adds MALFORMED_RESPONSE as a finish reason.
Set this environment variable to configure the API version for clients when no version is set in code.
Adds the source_text field to SmartTranscriptionMode.
AudioTranscriptionConfig and SmartTranscriptionMode now include source_text.
Behavior and default changes 2
Interactions now support Office and OpenDocument MIME types.
The transcribe command now uses gemini-3.5-transcribe as its default model.
Fixes and other changes 5
The SDK enum was updated; the notes do not specify which enum or the changes.
Batch inlined responses are returned as GenerateContentResponse instances.
Adds missing enum values to FinishReason.
Adds missing enum values to ReinforcementTuningThinkingLevel.
File uploads now respect the configured and default API version.
@google/genai 2178 changes
Breaking changes 13
Mid-stream SSE errors and dropped connections are now raised consistently across SDKs.
Unsupported 2.5 and 1.6 models are removed from Interactions model options.
Removes an unused field from FunctionResultDelta.
Changes speech_config to a structured object.
HttpOptions.timeout is now a per-attempt deadline in the JS GenAI SDK.
Removes cached_content from interactions.
Removes frequency_penalty from interactions.
Removes presence_penalty from interactions.
Renames usage to total_usage in StreamMetadata.
Fixed the steps field so it is not optional.
The response_format field names were updated to snake_case, so developers should use the corrected names.
An SSE event is renamed to interaction.completed.
An SSE event is renamed to interaction.created.
Security 1
Adds prompt injection detection for the Gemini API Computer Use feature.
Deprecations 6
Marks REQUIRES_ACTION in the live connection status enum as deprecated.
Adds deprecation warnings when edit_images uses prompt, text, or image arguments; it will be removed in the next major version.
Adds deprecation warnings when generate_images uses prompt, text, or image arguments; it will be removed in the next major version.
Adds deprecation warnings when generate_videos uses prompt, text, or image arguments; it will be removed in the next major version.
Adds deprecation warnings for LiveConnectConfig.GenerationConfig, which will be removed in the next major version.
The legacy response_format is deprecated for interactions.
New APIs and options 131
Interaction now declares continuation_ids.
Support was added for continuation_token, enabling developers to use continuation tokens.
The TypeScript SDK adds automatic_continuation to interactions.create.
The requires_continuation status is now supported.
Video understanding is now supported in the Gemini Developer API.
A parameter for video upscale tasks was added.
FunctionResultSubContent now includes AudioContent, DocumentContent, and VideoContent.
Adds generation_output_config to GenerateContentConfig.
Adds the store option to GenerateContentConfig for the Gemini Developer API.
Adds labels to LiveConnectConfig.
Adds base_voice to PromptedVoice in the GAOS SDK.
Adds Live API in-session context updates through send_context_update, with types across GenAI SDKs.
Adds gemini-4-argon to the Model enum, making it available as a model choice.
Billable token count fields are now available.
Interactions can now report a CONTINUATION_REQUIRED status.
The Interactions interaction.status_update event now includes a continuation token.
Transcription now includes an endOffset field.
Streaming continuation usage metadata accumulates and exposes the initial prompt token count.
InteractionStatusUpdate events now include usage.
RealtimeInputConfig now supports interimTranscriptTimestampEnabled.
Transcription now includes a startOffset field.
Environment network config now supports setting allowlist to "disabled".
Interactions supports continuation_token.
The Interactions Model enum adds lyria-3.5, gemini-omni-1.1-flash, and gemini-omni-flash-preview.
GenerateContent supports continuation_token.
Adds from_environment support for the environments dedicated module.
Adds gcs_metrics_uri for exporting tuning job metrics.
Adds the Gemini 3.8 Flash Lite TTS model to the SDK.
Adds the Gemini 3.8 Flash TTS model to the SDK.
Adds support for labels in LiveClientSetup.
Adds support for labels in Gemini API GenerateContent.
Supports field.value_field syntax for map add_union_value annotations.
Adds sample_audio to Voice in the GAOS SDK.
Exposes SpeechAnnotation in the public GenAI SDKs.
Exposes SpeechMetadata in the public GenAI SDKs.
Adds the Voices API resource to the GAOS SDK.
The credential APIs resource is wired into the SDK, making the resource available to developers.
Adds environments files upload and download support to the TypeScript SDK.
Adds support for custom fetch in HttpOptions.
Adds RetrievalCallStep to the interactions schema and SDKs.
Adds RetrievalResultStep to the interactions schema and SDKs.
Adds from_environment support for copying environment values.
The SDK adds the Gemini 3.8 Flash model.
Support was added for the audio/webm MIME type.
ProcessingCallStep is now exposed in the Interactions SDK.
ProcessingResultStep is now exposed in the Interactions SDK.
SDK support for translation_config was added for GEAP.
Video Understanding support was added to the Interactions API.
Adds AudioTranscriptionConfigMode for configuring audio transcription.
Adds support for environment files.
Adds a helper for downloading scotty files.
Adds TYPE_JPEG2000 to the VideoContent.MimeType enum.
Adds a mode enum with VERBATIM and SMART values to AudioTranscriptionConfig.
Adds BidiGenerateContentSetup.
Adds extension task parameters.
Adds IDLE as a state in the live connection status enum.
Adds step_count to ReinforcementTuningHyperParameters.
Adds enable_data_retention to ToolParallelAiSearch.
Adds a mode enum with VERBATIM and SMART values to TranscriptionConfig.
Adds video resolution parameters.
Adds support for gemini-3.7-flash.
Adds interaction_status to LiveServerContent.
Adds TOO_MANY_TOOL_CALLS to the FinishReason enum.
Adds the Gemini Robotics ER 2 Preview model.
Adds a top-level errors array to the Interaction resource (iAPI).
Adds an environment resource and wires its service into the SDK.
GoogleMaps Tool supports the places and routing grounding types.
The JS GenAI SDK API Client supports per-request retry options.
Adds a flat language_codes field to AudioTranscriptionConfig.
Allows using an API key together with project and location for enterprise mode.
Adds audio_transcription_config to GenerationConfig for audio transcription.
Adds audio_transcription to Part for audio transcription.
A new custom_vocabulary field is available in the Live API.
A model selector is added.
The interaction proto adds a queued status.
Adds AntigravityAgentConfig to the OpenAPI schema overlays and regenerated SDKs.
Adds CodeMenderAgentConfig to interactions.
Adds support for preserving custom headers for gaos.
Adds history config.
Adds a Triggers resource to the GoogleGenAI client.
Adds environment_id to network config.
Supports function declarations during agent creation.
Exposes labels in interactions.
Adds response_format to GenerationConfig.
Adds a retrieval result step and new fields to maps and search results.
Exposes safety_settings in interactions.
Adds Tool.exa_ai_search for the Gemini Enterprise API.
Adds Translation_config to GenerationConfig.
Adds voice consent signature types across SDK languages.
Adds disabled_safety_policies to ComputerUse in Interactions and Models.
Adds response format parameters.
Adds usage fields for steps.
Adds video generation support.
Adds adaptationPhrases to AudioTranscriptionConfig.
Adds LanguageAuto to AudioTranscriptionConfig.
Adds LanguageHints to AudioTranscriptionConfig.
Exposes Computer Use API fields.
Introduces gaos SDK libraries.
Adds interimInputTranscription to LiveServerContent.
Adds cached_content to models.proto for the interaction API.
Adds frequency_penalty to models.proto for the interaction API.
Adds presence_penalty to models.proto for the interaction API.
Adds ServiceTier to UsageMetadata.
Adds audioOffset to VoiceActivity.
Adds a transcription language code.
Adds ReinforcementTuning support and the ValidateReward API method to the GenAI SDK.
Adds TranslationConfig for live translation.
Enables the BigQuery tool in Deep Research configuration.
Adds support for the computer_use field on Vertex.
Adds Skill Registry DeleteSkill support to the SDK.
Adds Skill Registry ListSkills support to the SDK.
Adds support for Reinforcement Tuning in the GenAI SDK.
Allows text/csv as a supported document MIME type for the Interaction API.
Adds a budget_exceeded status.
Adds the gemini-3.5-flash model.
Support for the Agent API is added.
Support for the Environment API is added.
Adds interaction.output_audio.
Adds interaction.output_image.
Adds interaction.output_text.
Adds interaction.output_video.
Adds an arguments field to the ArgumentDelta type.
Adds the missing FunctionCallResultDelta type.
Added support for blocking FunctionCall in the Live API on AgentPlatform (Vertex).
Added gemini-3.1-flash-lite to the available model options.
Added support for the Vertex-lyria lyria-3-clip-preview model.
Added support for the Vertex-lyria lyria-3-pro-preview model.
Added parameters to video response_format.
Introduced support for server-side tools deltas.
A new polymorphic field is published for interactions.
Interactions support steps.
Performance 1
Keeps the Buffer in the Node tokenizer platform for approximately 2x faster model parsing.
Behavior and default changes 7
The client automatically consumes the continuation token.
Default HTTP timeouts are raised so long-running requests are not killed client-side.
Exposes VoiceConfig.voice in the public GenAI SDKs.
Makes the deferred service tier publicly available on Vertex.
ASR fields are made public in v1main and Interactions.
Embedding responses for gemini-embedding-2 now populate prompt token counts per modality.
Async generate_content supports Agent Platform MCP.
Fixes and other changes 19
Synchronizes the InteractionSseEventInteractionStatus enum with InteractionStatus.
When a continuation hop returns no candidates, continuation state is cleared and prompt feedback is preserved.
Continuation streams retry dropped hops, stop on prompt_feedback, and preserve real errors in generate_content.
Types GeminiNextGen signatures with public, importable names.
Fixes grounding metadata merging during automatic continuation in generate content and generate content stream.
Concatenates output_text across multi-step model responses in a turn.
Incomplete continuation stream turns are no longer recorded in curated chat history.
The env schema now maps keys to EnvVar or string.
Streaming continuation handling fixes stale-token, AbortError, initial prompt token count, and intermediate finishReason edge cases.
Streaming generation resumes from the latest checkpoint continuation token after mid-stream errors or cutoffs.
Uses CreateAgentInteraction for Trigger.interaction and TriggerCreateParams.interaction.
Uses CreateAgentInteraction for TriggerCreateParams.interaction and Trigger.interaction.
Adds @ts-ignore before optional MCP imports in declaration files.
Repairs the node fallback manifest and completes web entries.
Redundant Content-Length is no longer set on file upload requests.
The setupComplete key in LiveClientMessage is now quoted.
Accepts both a dict and a list of dicts for transform.
Fixes output_text for turns that don't end with text.
Fixes a timeout that was not functioning.
@google/genai 1116 changes
Breaking changes 9
Replaces the more ambiguous rate field with sample_rate.
The webhooks.retrieve API was renamed to webhooks.get.
The Interactions ContentDelta unions were renamed, requiring updates to code that uses them.
Interactions renamed rendered_content to search_suggestions.
TextContent annotations now use specific citation types, changing the Interactions API.
Changed the Interactions media MIME type to an enum, a breaking change for the experimental feature.
tunings.cancel() now returns an empty response.
AFC is disabled when an incompatible tool is presented.
The Lyria method name and parameters type changed, so JavaScript callers may need to update their code.
Security 1
Adds ModelArmorConfig support for prompt and response sanitization via the Model Armor service.
New APIs and options 83
Adds multimodal file search.
Adds output_info to BatchJob.
Introduces an enterprise flag.
Adds custom_metadata to FileCitation.
Adds media_id to FileCitation.
Adds page_number to FileCitation.
Adds the gemini-3.1-flash-tts-preview model to options.
Adds new Gemini Deep Research agent models.
Introduces the GOOGLE_GENAI_USE_ENTERPRISE environment variable.
Adds ImageResizeMode for GenerateVideos.
Adds a grounding tool usage breakdown to Interaction Usage.
Adds Vertex Dataset input and output options for batch jobs.
Audio support now includes the opus, alaw, and mulaw MIME types.
New fields are available on DeepResearchAgentConfig.
New fields are available for Live Avatar.
The EU service location is now supported for the Vertex AI platform.
Webhook support and webhook configuration were added to the SDK, including for batch creation and video generation.
Introduces TYPE_L16 audio content and optional fields.
Adds dedicated TextAnnotationDelta support for streaming tool responses.
Adds custom metadata to FileSearchResult.
Distillation tuning now supports hyperparameters.
Adds a labels field to Veo configs.
Adds a MIME type for Audio content.
Adds model status to GenerateContentResponse for the Gemini API.
Adds part metadata to Part for the Gemini API.
Adds rendered parts to GroundingSupport.
Adds service tier configuration for interactions.
Adds service tier configuration to GenerateContent.
Adds supported models to ModelOptions.
Adds TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO to TurnCoverage.
Interactions now supports Google Maps.
The genai API now supports include_server_side_tool_invocations.
Signature fields were added and updated for tool call and result content types.
Adds inference_generation_config to EvaluationConfig for Tuning.
Enables language code in the audio transcription config for the Live API on Vertex AI.
Adds the gemini-3.1-flash-image-preview model.
Supports signature for all Interaction tool types.
Added gemini-3.1-pro-preview to the list of models in Interactions.
Added Image Grounding support to the GoogleSearch tool.
Supports multimodal embedding for Gemini Embedding 2.0 and MaaS models in the Vertex AI API.
Tuning job creation configuration supports encryption_spec.
Interaction status now includes INCOMPLETE.
Retry options are passed to the underlying Interactions client.
Adds support for distillation tuning.
Adds the include_input query parameter to the Get Interaction endpoint.
Adds support for OSS Tuning in the GenAI SDK.
Adds registerFiles to use GCS files with mldev.
Allows custom endpoints for authentication with Vertex AI in TypeScript.
Interactions now supports 4:5 and 5:4 aspect ratios.
Adds FileSearchCallContent to Interactions.
Adds ImageConfig to GenerationConfig for image generation in Interactions.
Adds support for a JavaScript local tokenizer.
Adds voice activity support.
Adds PersonGeneration to ImageConfig for Vertex Gempix.
Defines and uses DocumentMimeType for DocumentContent.
Adds ultra high resolution as a media resolution option in Parts.
Adds multi-speaker support for Vertex AI.
Adds support for Struct in ToolResult Content.
Adds minimal and medium thinking levels.
Adds IMAGE_OTHER as a FinishReason enum value.
Adds IMAGE_RECITATION as a FinishReason enum value.
Makes the Interactions API public.
Adds a voice activity detection signal.
Adds enableEnhancedCivicAnswers to GenerateContentConfig.
Adds support for ReplicatedVoiceConfig.
Function call argument streaming is supported for all languages.
FunctionResponseBlob now supports a display name.
FunctionResponseFileData now supports a display name.
Adds the thinking_level option to generate_content_config.
ImageConfig gains image output options for Vertex.
Adds media_resolution to part.
BatchJob now includes complete stats.
A FileSearch tool is now available.
FileSearchStore management APIs are now available.
ImageConfig gains image_size in the Early Access Program.
A phish filtering feature was added.
Adds person_generation support for Imagen upscaling.
The SDK adds support for preference optimization tuning.
Adds safety_filter_level support for Imagen upscaling.
Adds jailbreak support in BlockedReason.
Adds enable_enhanced_civic_answers to GenerationConfig.
Adds jailbreak support in HarmCategory.
Adds support for video extension for Veo on the Gemini Developer API.
Performance 1
Improves stream parsing performance.
Behavior and default changes 6
Interactions content supports more image and audio MIME types.
Enables server side MCP when configured and disables all other AFC in that case.
The SDK supports HTTP retries.
A default global location is supported with the Vertex AI backend when not using an API key.
Uploading with a file path now passes the file name to the backend.
The technology is no longer described as a preview.
Fixes and other changes 16
Webhook types were refactored for easier use.
This release has known webhook SDK issues; developers implementing or relying on webhooks should use v1.51.0 or later.
Fixes the service_tier enums.
Fixes support for US region routing.
The functionResponses key in LiveClientMessage is now quoted.
Supports more image sizes and resolutions.
Adds metadata to the batch inlined response.
Updates data types from the discovery document.
Missing fields were added to the model types.
The base_steps parameter for recontext_image was fixed.
The response.text property no longer generates warnings because of thought_signature.
After awaiting the download, the file write is complete and the data is fully readable.
Fixes an error involving Google auth ADC.
Prevents appending the MCP label multiple times when it already exists.
McpClient can now be passed in when AFC is disabled.
Blob handling in realtime music was fixed.