@ai-sdk/google
4.0.122 · 17 Nov 2026Apache-2.014.6M / weekRepositoryHomepagenpmAtom feed
497 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 4.x · latest line
4.0.19
20 Jul 2026provider/google: Associate multiple code execution results with their tool call
provider/google: Surface Gemini
responseIdasresponse-metadata(stream) andresponse.id(generate)
4.0.18
17 Jul 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.11
4.0.17
15 Jul 2026provider/google: Forward Vertex-only imageConfig options (personGeneration, prominentPeople, imageOutputOptions)
4.0.16
14 Jul 2026Allow google.interactions agent requests to include supported tools, including file_search.
4.0.15
14 Jul 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.10
4.0.14
13 Jul 2026provider-utils: Validate provider-response URLs in
getFromApigetFromApinow has avalidateUrlflag. It is optional so existing callers keep compiling (omitting it behaves likefalse, i.e. no validation), but all AI SDK provider packages set it explicitly at every call site so each one makes a visible trust decision. Whentrue, the URL is routed throughfetchWithValidatedRedirects— the same guard used bydownloadBlob— which rejects private/loopback/link-local targets, re-validates every redirect hop, strips proxy/metadata/cookie request headers, and drops all caller headers except the user-agent on cross-origin redirects (custom API-key headers must not follow a redirect off-origin any more thanAuthorizationmay); blocked URLs throwDownloadError. It is enabled at the image/video/audio download and polling call sites where the URL comes from a provider response body; URLs built from developer-configured endpoints passvalidateUrl: falseand are unaffected.A new optional
credentialedOriginwithholds caller headers unless the URL is same-origin with it, so the API key is not sent to a response-supplied host on a different origin.A new optional
trustedOriginexempts URLs (and redirect hops) that are same-origin with the developer-configured provider endpoint from target validation, so self-hosted and localhost deployments whose response URLs point back at the configured host keep working; all other hops are still validated.Also closes range gaps in
validateDownloadUrl(IPv4224.0.0.0/4multicast and the TEST-NET documentation ranges192.0.2.0/24,198.51.100.0/24,203.0.113.0/24; IPv6 documentation ranges2001:db8::/32and3fff::/20), and follows only the fetch-spec redirect status codes (301/302/303/307/308) — aLocationheader on any other status is not followed. This guard performs string/literal checks only and does not resolve DNS; hostnames that resolve to private addresses and DNS rebinding remain out of scope and must be constrained at the network layer (or by injecting a Nodefetchthat pins the resolved IP at connect time) for server deployments handling untrusted URLs. Seecontributing/secure-url-handling.md.
Patch Changes
provider-utils: Validate provider-response URLs in
getFromApigetFromApinow has avalidateUrlflag. It is optional so existing callers keep compiling (omitting it behaves likefalse, i.e. no validation), but all AI SDK provider packages set it explicitly at every call site so each one makes a visible trust decision. Whentrue, the URL is routed throughfetchWithValidatedRedirects— the same guard used bydownloadBlob— which rejects private/loopback/link-local targets, re-validates every redirect hop, strips proxy/metadata/cookie request headers, and drops all caller headers except the user-agent on cross-origin redirects (custom API-key headers must not follow a redirect off-origin any more thanAuthorizationmay); blocked URLs throwDownloadError. It is enabled at the image/video/audio download and polling call sites where the URL comes from a provider response body; URLs built from developer-configured endpoints passvalidateUrl: falseand are unaffected.A new optional
credentialedOriginwithholds caller headers unless the URL is same-origin with it, so the API key is not sent to a response-supplied host on a different origin.A new optional
trustedOriginexempts URLs (and redirect hops) that are same-origin with the developer-configured provider endpoint from target validation, so self-hosted and localhost deployments whose response URLs point back at the configured host keep working; all other hops are still validated.Also closes range gaps in
validateDownloadUrl(IPv4224.0.0.0/4multicast and the TEST-NET documentation ranges192.0.2.0/24,198.51.100.0/24,203.0.113.0/24; IPv6 documentation ranges2001:db8::/32and3fff::/20), and follows only the fetch-spec redirect status codes (301/302/303/307/308) — aLocationheader on any other status is not followed. This guard performs string/literal checks only and does not resolve DNS; hostnames that resolve to private addresses and DNS rebinding remain out of scope and must be constrained at the network layer (or by injecting a Nodefetchthat pins the resolved IP at connect time) for server deployments handling untrusted URLs. Seecontributing/secure-url-handling.md.
4.0.12
10 Jul 2026Forward text file references as documents when using the Google Interactions API.
4.0.11
9 Jul 2026Fix Google tool result conversion to send file data as inline data instead of JSON text on the legacy tool-result path.
Expand standalone Google
thresholdprovider options into safety settings.Feat (video): support video (not just image) reference inputs in
inputReferencesfor reference-to-video generation
Patch Changes
Fix Google tool result conversion to send file data as inline data instead of JSON text on the legacy tool-result path.
Expand standalone Google
thresholdprovider options into safety settings.Feat (video): support video (not just image) reference inputs in
inputReferencesfor reference-to-video generation
4.0.10
8 Jul 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.6
4.0.9
7 Jul 2026Pass documented Gemini external HTTPS file URLs through without downloading them.
4.0.8
2 Jul 2026Add experimental streaming transcription support for transcription models, including OpenAI
gpt-realtime-whisperand xAI WebSocket STT.
Patch Changes
Add experimental streaming transcription support for transcription models, including OpenAI
gpt-realtime-whisperand xAI WebSocket STT.
4.0.7
2 Jul 2026- Security
Prevent prototype pollution when synchronously parsing provider JSON inputs and expose
secureJsonParsefrom provider-utils. Fix Google embedding batch size to respect the Gemini API limit of 100 requests per batch.
Patch Changes
- Security
Prevent prototype pollution when synchronously parsing provider JSON inputs and expose
secureJsonParsefrom provider-utils. Fix Google embedding batch size to respect the Gemini API limit of 100 requests per batch.
4.0.6
2 Jul 2026Add
vertex.interactions()for the Gemini Interactions API on Vertex AI. Targets the location-scoped.../locations/{region}/interactionsresource using the existing Vertex OAuth credentials, enabling multimodal-output models such asgemini-omni-flash-preview(video output) through Vertex. TheGoogleInteractionsLanguageModelis now exported from@ai-sdk/google/internalfor provider reuse.
4.0.5
1 Jul 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.3
4.0.4
1 Jul 2026Support Gemini Interactions video output. Parse video output blocks from the Google Interactions API into file parts (buffered and streaming), and surface the per-modality output token breakdown via
providerMetadata.google.outputTokensByModality.
4.0.3
30 Jun 2026Feat (video): add first-class
frameImagesandinputReferencescall options for video generation
Patch Changes
Feat (video): add first-class
frameImagesandinputReferencescall options for video generation
4.0.1 – 4.0.22 releases with no change for you1 dependency update, 1 maintenance@ai-sdk/provider-utils 5.0.1Show each
- 4.0.227 Jun 2026@ai-sdk/provider-utils 5.0.1
- 4.0.127 Jun 2026docs, tests or tooling
4.0.0
25 Jun 2026- Breaking
provider/google: Remove useless GenerativeAI affix from types and classes for consistency
- Breaking
provider: Add support for
reasoning-filetype for files that are part of reasoning - Breaking
Remove CommonJS exports from all packages. All packages are now ESM-only (
"type": "module"). Consumers usingrequire()must switch to ESMimportsyntax.
Major Changes
- Breaking
provider/google: Remove useless GenerativeAI affix from types and classes for consistency
- Breaking
provider: Add support for
reasoning-filetype for files that are part of reasoning - Breaking
Remove CommonJS exports from all packages. All packages are now ESM-only (
"type": "module"). Consumers usingrequire()must switch to ESMimportsyntax. - Breaking
provider: Add support for provider references and uploading files as supported per provider
- Breaking
provider: Add new top-level reasoning parameter to spec and support it in
generateTextandstreamText - Breaking
Start v7 pre-release
- Breaking
Make provider implementations code patterns more consistent, including renaming certain exported symbols
For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
Patch Changes
provider/google: Add support for managed agents in the Interactions API
Add AI Gateway hint to provider READMEs
provider/google: Support Google search grounding when using
generateImagewith Geminiprovider/google: Fix Gemini service tier enum after upstream update
google: Fix
serviceTierto be correctly formatted for Vertex APIgoogle, google-vertex: Added
gemini-embedding-2,deep-research-max-preview-04-2026anddeep-research-preview-04-2026provider/google: Add support for service tier parameter
provider/google: Support
functionCall.idwhen returned by Gemini API and provide matchingfunctionResponse.idprovider/google: Correct JSDoc for multimodal embedding content option
google: auto-inject
skip_thought_signature_validatorfor Gemini 3 tool-call replays without a signatureAdd Google realtime Live Translation provider options for
gemini-3.5-live-translate-preview.google: Update Interactions API implementation to cater for upstream breaking changes coming May 26
provider/google: Add Gemini text-to-speech (speech) model support
provider/google: Preserve per-modality token details in usage data
google: Emit Vertex no-args streaming tool calls and preserve thoughtSignature
Vertex emits a no-args function call as a single chunk shaped
{ functionCall: { name: 'X' } }with noargs, nopartialArgs, and nowillContinue. The streaming parser had no branch for this shape, so the call was dropped along with anythoughtSignatureit carried. For Gemini 3 thinking models this caused the next multi-turn step to 400 withmissing thought_signature. The unary (doGenerate) path had the same drop.Both paths now emit the call as a complete tool call with
'{}'input and propagatethoughtSignatureprovider metadata.Fixes #14847.
provider/google: Preserve groundingMetadata and urlContextMetadata when they arrive in a stream chunk before the finishReason chunk
google: Read
serviceTierfromusageMetadata.serviceTierin both generate and stream pathsThe previous implementation read
serviceTierfrom thex-gemini-service-tier
response header, which is only populated on non-streaming responses. Gemini
streaming includes the value inusageMetadata.serviceTieron every chunk, soproviderMetadata.google.serviceTierwas alwaysnullfor streams. Read fromusageMetadatafor both paths instead.google: Use VALIDATED function calling mode when any tool has strict:true
provider/google-vertex: Add Gemini text-to-speech (speech) model support
- Security
google: Prevent prototype pollution when streaming tool args
google: Add
fileDatasupport to embedding modelprovider/google: Support combining built-in tools with function calling on Gemini 3
google-vertex: Add support for streaming tool arguments input
Trigger release for all packages after provenance setup
google: Fix streaming tool call args
provider/google: Support multimodal content parts in embedding provider options
provider/google: Add
gemini-embedding-2-previewand fix multimodal embedding support withembedManyprovider/google: Add support for the Gemini Interactions API
More precise default message for tool execution denial
provider/google: Fix lack of image consistency when using Interactions API in stateless mode
Only send provider credentials to same-origin response-supplied URLs
Several provider clients followed a URL taken from the provider's API response (a polling/status URL or a final media URL such as
polling_url,urls.get,result_url,result.sample, orvideo.uri) and reused the authenticated headers — or appended?key=<API_KEY>— on that request. Because the host of the response-supplied URL was never validated, the long-lived API key was sent to whatever host the response named (a CDN in the benign case, or an attacker-chosen host if the provider response was tampered with), allowing credential exfiltration.A new
isSameOriginhelper is added to@ai-sdk/provider-utils, and the affected fetches in@ai-sdk/black-forest-labs,@ai-sdk/fireworks,@ai-sdk/replicate,@ai-sdk/gladia,@ai-sdk/fal, and@ai-sdk/googlenow attach credentials only when the followed URL is same-origin with the provider's configured API origin. Requests to a foreign origin are made without the credential.- Breaking
Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
Trigger initial canary release
provider/google: Support cancelling long-running Interactions API agents via AbortSignal, and process their intermittent stream
provider: Add experimental Realtime API support for voice conversations
Adds first-class support for realtime (speech-to-speech) APIs:
Experimental_RealtimeModelV4spec in@ai-sdk/providerwith normalized event types and factoryOpenAI, Google, and xAI realtime provider implementations
openai.experimental_realtime()/google.experimental_realtime()/xai.experimental_realtime()work in both server and browser.getToken()static method on each provider for server-side ephemeral token creationexperimental_getRealtimeToolDefinitionshelper for provider session tool definitionsexperimental_useRealtimehook in@ai-sdk/reactreturningUIMessage(aligned withuseChat), withonToolCallandaddToolOutputfor client-driven tool executioninputAudioTranscriptionsession config for showing transcribed user audio messages when supported by the provider
google-vertex: Don't send streamFunctionCallArguments for unary API calls and change default to false
provider/google: Correctly mark reasoning files as such and fix related multi-turn errors
provider: Change file part data property to be tagged with a type and remove the image part type
provider/google: Add
gemini-3.5-flashprovider: Align tool result output content file part types with top-level message file part types
Trigger initial beta release
google: Omit passing includeServerSideToolInvocations for Vertex tool_config
google: Add new finishMessage field in providerMetadata
google: Read
serviceTierfromx-gemini-service-tierresponse header in Gemini API and use PayGo for Vertexprovider/google: Add multimodal tool-result support for Google function responses.
Tool results with
output.type = 'content'now map media parts intofunctionResponse.partsfor Google models, includingimage-data,file-data, and base64data:URLs in URL-style content parts.
Remote HTTP(S) URLs in URL-style tool-result parts are not supported.Add workflow serialization support to all provider models.
@ai-sdk/provider-utils: NewserializeModel()helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.All providers:
headersis now optional in provider config types. This is non-breaking — existing code that passesheaderscontinues to work. Custom provider implementations that construct model configs manually can now omitheaders, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.All provider model classes now include
WORKFLOW_SERIALIZEandWORKFLOW_DESERIALIZEstatic methods, enabling them to cross workflow step boundaries without serialization errors.Roll
image-*tool output types into their equivalentfile-*types
- 3.x
3.0.147
17 Nov 2026Limit the size of Google Vertex tool result file downloads with
toolResultDownloads.maxBytes, which defaults to 7 MiB. This is lower than the previous 2 GiB default for these downloads; raisetoolResultDownloads.maxBytesfor larger files.
Patch Changes
Limit the size of Google Vertex tool result file downloads with
toolResultDownloads.maxBytes, which defaults to 7 MiB. This is lower than the previous 2 GiB default for these downloads; raisetoolResultDownloads.maxBytesfor larger files.
3.0.146
12 Nov 2026Add the
gemini-4-hydrogenmodel ID and support Hydrogen'sxhighthinking level in Google Generate Content and Interactions provider options.
3.0.145
10 Nov 2026Add support for the
gemini-4-carbonmodel with the same capabilities asgemini-4-argon.
3.0.144
10 Nov 2026Preserve the served service tier from the
x-gemini-service-tierresponse header when usage metadata omits it, for generated and streamed responses.Apply contiguous array-index validation to dotted numeric paths in streamed tool arguments, while preserving numeric object keys and valid contiguous array updates.
Patch Changes
Preserve the served service tier from the
x-gemini-service-tierresponse header when usage metadata omits it, for generated and streamed responses.Apply contiguous array-index validation to dotted numeric paths in streamed tool arguments, while preserving numeric object keys and valid contiguous array updates.
3.0.143
7 Nov 2026Bound Google JSON Schema conversion work, output size, and depth to prevent excessive resource use when inlining repeated local references. Input inspection and conversion each have a separate budget of 10,000 visited JSON values and a conservative 1,000,000-character serialized-size allowance, with a depth limit of 100. Schemas exceeding these limits now fail with a controlled error, including large schemas that were previously accepted. String-size accounting reserves six characters per UTF-16 code unit for JSON escaping.
Pass
providerOptions.google.labelsthrough to Google and Vertex AI Interactions requests, including streaming, so callers can attach request metadata such assafety_identifier.Skip streamed tool-call array indexes that leave a gap so a small response can't build a huge sparse array
Patch Changes
Bound Google JSON Schema conversion work, output size, and depth to prevent excessive resource use when inlining repeated local references. Input inspection and conversion each have a separate budget of 10,000 visited JSON values and a conservative 1,000,000-character serialized-size allowance, with a depth limit of 100. Schemas exceeding these limits now fail with a controlled error, including large schemas that were previously accepted. String-size accounting reserves six characters per UTF-16 code unit for JSON escaping.
Pass
providerOptions.google.labelsthrough to Google and Vertex AI Interactions requests, including streaming, so callers can attach request metadata such assafety_identifier.Skip streamed tool-call array indexes that leave a gap so a small response can't build a huge sparse array
3.0.142
6 Nov 2026Omit Google provider-defined tools, including File Search and Vertex RAG Store, when
toolChoiceisnoneso disabled tools cannot retrieve data or execute server-side. Preserve function declarations needed by conversation history while disabling function calling.
3.0.141
3 Nov 2026google: Handle cycles and BigInt in functionResponse and parse string functionCall arguments
Omit all Google Interactions tools when
toolChoiceisnone, including provider-defined tools.Map Google RPC status names to HTTP status codes when streamed errors omit a numeric code, so transient failures such as
UNAVAILABLEandRESOURCE_EXHAUSTEDare marked retryable.
Patch Changes
google: Handle cycles and BigInt in functionResponse and parse string functionCall arguments
Omit all Google Interactions tools when
toolChoiceisnone, including provider-defined tools.Map Google RPC status names to HTTP status codes when streamed errors omit a numeric code, so transient failures such as
UNAVAILABLEandRESOURCE_EXHAUSTEDare marked retryable.
3.0.140
29 Oct 2026Add videoMetadata support for file parts. Pass startOffset, endOffset, and fps through per-file providerOptions to control video clipping and frame rate with the Google and Google Vertex providers.
Patch Changes
Add videoMetadata support for file parts. Pass startOffset, endOffset, and fps through per-file providerOptions to control video clipping and frame rate with the Google and Google Vertex providers.
3.0.139
26 Oct 2026google: Keep empty arrays and objects in tool-call input streamed with
streamFunctionCallArgumentsVertex sends a value-less
partialArgsentry for an empty container (e.g.$.tags), which was dropped, so `` and{}arguments went missing from the streamed tool-call input.
3.0.138
23 Oct 2026google: Convert
type: [X, "null"]to a plain nullable node soitemsandformatbeside it stay valid for Gemini
3.0.137
21 Oct 2026Defer validation schema construction until first use to reduce provider import time.
Patch Changes
Defer validation schema construction until first use to reduce provider import time.
3.0.136
19 Oct 2026Preserve grounding metadata from each automatically continued Google response in
groundingMetadataPerRequest. Previously, a later response without grounding could leave earlier Search queries absent from the final provider metadata even though their sources were returned. The new array preserves request order and includesnullfor requests without grounding.
3.0.133 – 3.0.1353 releases that only update dependencies@ai-sdk/provider-utils 4.0.61@ai-sdk/provider 3.0.19Show each
- 3.0.13516 Oct 2026@ai-sdk/provider-utils 4.0.61
- 3.0.13415 Oct 2026@ai-sdk/provider 3.0.19@ai-sdk/provider-utils 4.0.60
- 3.0.13315 Oct 2026@ai-sdk/provider-utils 4.0.59
3.0.132
13 Oct 2026google: Add
gemini-4-argonmodel id and long decode support forgenerateContent: requests that reach the per-request cap (CONTINUATION) are continued automatically with usage summed across requests and the first request's prompt token count exposed asproviderMetadata.google.initialPromptTokenCount, and thecontinuationTokenprovider option / provider metadata resume responses that used up theirmaxOutputTokensbudget.generateTextwith the Interactions API now pollsbackground: truemodel calls until they finish.
Patch Changes
google: Add
gemini-4-argonmodel id and long decode support forgenerateContent: requests that reach the per-request cap (CONTINUATION) are continued automatically with usage summed across requests and the first request's prompt token count exposed asproviderMetadata.google.initialPromptTokenCount, and thecontinuationTokenprovider option / provider metadata resume responses that used up theirmaxOutputTokensbudget.generateTextwith the Interactions API now pollsbackground: truemodel calls until they finish.
3.0.131
7 Oct 2026google: Preserve file search custom metadata in retrieved context grounding chunks
google: Add the 'gemini-nano-banana-2.1' model ID
3.0.130
30 Sep 2026Keep default Node.js downloads protected by DNS validation and connection pinning when frameworks or instrumentation wrap global fetch before or after the SDK loads.
Patch Changes
Keep default Node.js downloads protected by DNS validation and connection pinning when frameworks or instrumentation wrap global fetch before or after the SDK loads.
3.0.129
28 Sep 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.56
3.0.128
27 Sep 2026google: Forward supported GCS tool result URLs as function response file data on Vertex Gemini 3 and later. Restrict forwarding to supported image, PDF, and text MIME types while preserving HTTP(S) downloads for tool results on all Gemini generations.
Patch Changes
google: Forward supported GCS tool result URLs as function response file data on Vertex Gemini 3 and later. Restrict forwarding to supported image, PDF, and text MIME types while preserving HTTP(S) downloads for tool results on all Gemini generations.
3.0.127
23 Sep 2026Fix Google
embedManycalls with more than 100 values by keeping per-value multimodal content aligned across automatic batches, including text-only entries. Validate content length before sending requests and validate each batch's provider options after middleware transforms them.
Patch Changes
Fix Google
embedManycalls with more than 100 values by keeping per-value multimodal content aligned across automatic batches, including text-only entries. Validate content length before sending requests and validate each batch's provider options after middleware transforms them.
3.0.126
23 Sep 2026provider: Preserve opaque file URI strings for provider serialization
Patch Changes
provider: Preserve opaque file URI strings for provider serialization
3.0.125
21 Sep 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.52
3.0.124
18 Sep 2026google: Ignore default prompt block reasons in non-streaming responses
3.0.123
16 Sep 2026google: Preserve prompt feedback and metadata across streaming chunks
3.0.122
9 Sep 2026Retry unclassified empty image results, preserve retry-attempt accounting, add provider-independent result retryability classification, preserve it through the AI Gateway, and mark Google and Google Vertex content-filtered results as terminal.
Patch Changes
Retry unclassified empty image results, preserve retry-attempt accounting, add provider-independent result retryability classification, preserve it through the AI Gateway, and mark Google and Google Vertex content-filtered results as terminal.
3.0.121
3 Sep 2026google: Add gemini-3.8-flash model
3.0.120
31 Aug 2026google: Support video response formats in Gemini Interactions
3.0.119
30 Aug 2026Preserve complete Google Generative Language usage metadata in raw usage results.
Patch Changes
Preserve complete Google Generative Language usage metadata in raw usage results.
3.0.118
27 Aug 2026Omit unsupported frequency and presence penalties from Gemini 2.5 requests and return warnings instead.
3.0.116
26 Aug 2026google: Convert enum values to the Gemini schema format
Feat (provider/google, provider/google-vertex): Gemini 3.5 Transcribe support — unary transcription (
gemini-3.5-transcribe) via generateContent with language detection, speaker diarization, word timestamps, custom vocabulary, andmode: 'VERBATIM' | 'SMART'transcription formatting
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.