npm / @ai-sdk/gateway
@ai-sdk/gateway
What changed in @ai-sdk/gateway 2 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
4 breaking26 new APIs and options13 behavior and defaults1 tooling10 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/gateway 433 changes
Breaking changes 4
Arrays passed directly as state now contain decision state parts; wrap JSON arrays in an object or a json part.
The API name evaluate was renamed to decide.
Unsupported batch request types are now rejected.
Support for Imagen models and their integration was dropped following the API shutdown.
New APIs and options 17
Adds support for the GPT-6.1 Sol model.
GatewayProviderOptions now accepts conditional evaluation fallbacks.
Gemini 3.8 speech model IDs were added to Gateway types.
Adds model IDs for GPT-6 Sol and Luna.
Adds support for cancelling batches with experimental_cancelBatch.
Adds the Grok 4.7 model ID.
The has model filter now supports reasoning.
The has model filter now supports tool-use.
Image generation requests are now supported in batches.
Batch requests can now use per-request models.
Adds support for the gpt-6-astra model in the gateway.
Adds support for Fable 5.1, allowing developers to use it through the Gateway.
Accepts a webhookUrl for batch completion webhooks; the gateway provider registers it through the batch callbackUrl contract.
Adds Tako Search tool support to the gateway provider.
DeepSeek V4 Flash Vision Exp now supports image input.
DeepSeek V4 Flash Vision Exp now supports the Files API.
Adds experimental batch API support through the AI Gateway batch routes, with methods to start text batches and check their status and results.
Behavior and default changes 5
The gateway sends image files in decision state.
Decision refusals are reported as refusal answers.
Conditional evaluation fallback models with any non-empty value are now accepted.
The has provider option now supports quantization conditions.
The video model now implements handleWebhookOption, so generateVideo({ webhook }) registers the factory URL as callbackUrl and awaits delivery instead of falling back to polling.
Tooling 1
Conditional evaluation fallbacks are now typed in the Gateway provider.
Fixes and other changes 6
Batch result downloads limit JSONL rows to 64 MB.
getCredits() now forwards the configured team as a query parameter, preventing authentication errors for credentials that can access multiple teams.
getAvailableModels() now includes evaluation models instead of filtering them out as unknown model types.
The gateway provider now forwards server-returned warnings in doGenerate instead of overwriting them with an empty array.
Preserves retryability returned by the AI Gateway for image results.
Transient network errors while reading successful response bodies are now marked retryable, including for AI Gateway responses.
@ai-sdk/gateway 313 changes
New APIs and options 8
Adds a provider option for resuming responses that used up their maxOutputTokens budget.
Adds the gemini-4-argon model id.
Exposes the first request's prompt token count in Google provider metadata.
Adds Browserbase Search and Fetch tool support.
The has provider option now supports quantization conditions.
Model filtering with has now supports reasoning and tool-use.
Added the gemini-3.8-flash model for use with the Google provider.
Adds support for the GLM-5.3-Flash model through the Z.AI provider and AI Gateway.
Behavior and default changes 4
generateText with the Interactions API now polls background model calls until they finish.
Requests that reach the per-request CONTINUATION cap continue automatically, with usage summed across requests.
The has provider option now accepts structured-output.
Retryability classification is provider-independent and preserved through the AI Gateway; Google and Google Vertex content-filtered results are terminal.
Fixes and other changes 1
Unclassified empty image results are retried, and retry-attempt accounting is preserved.
@ai-sdk/gateway 28 changes
New APIs and options 1
Adds a provider option and provider metadata for resuming responses that used up their maxOutputTokens budget.
Behavior and default changes 4
Requests that reach the per-request CONTINUATION cap are continued automatically, with usage summed across requests and the first request's prompt token count exposed.
Thinking can be disabled up to high effort; when disabled, xhigh and max effort are lowered to high with a warning.
Thinking token budgets are unsupported; enabled thinking with budgetTokens is converted to adaptive thinking with a warning.
Adds provider-independent retryability classification and preserves it through the AI Gateway.
Fixes and other changes 3
Diagnostics from completed attempts are preserved, making them available after retries.
Unclassified empty image results are retried, changing how image-generation failures are handled.
Google Vertex RAI-filtered results are marked terminal, so they are not treated as retryable.