npm / @google/genai
@google/genai
What changed in @google/genai 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
18 breaking2 security6 deprecations178 new APIs and options1 performance10 behavior and defaults26 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@google/genai 2164 changes
Breaking changes 12
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 119
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 18
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 177 changes
Breaking changes 6
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.
Security 1
Adds ModelArmorConfig support for prompt and response sanitization via the Model Armor service.
New APIs and options 59
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.
Behavior and default changes 3
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.
Fixes and other changes 8
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.