npm / @ai-sdk/azure
@ai-sdk/azure
What changed in @ai-sdk/azure 2 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
54 breaking2 security17 deprecations52 new APIs and options1 performance12 behavior and defaults8 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/azure 763 changes
Breaking changes 41
OpenTelemetry span collection moved out of the ai package; install this package and register an OpenTelemetry instance globally to receive traces.
Set allowSystemInMessages to true to retain support for existing system messages in prompt or messages; use only with trusted messages.
Top-level result properties including
content, tool calls and results, files, sources, and warnings now accumulate values across every step; usefinalStepfor final-step-only values.Tool callback context replaces experimental_context and is now tool-specific, typed from contextSchema, and supplied through toolsContext.
Use customProvider in place of the removed experimental_customProvider export; its options and behavior are unchanged.
The deprecated option is removed; replace it with
activeToolsingenerateTextandstreamTextcalls.The tracer property was removed from experimental_telemetry; pass a custom OpenTelemetry tracer to the OpenTelemetry constructor instead.
Use
finalStepto access final-step result values, including reasoning, request, response, and provider metadata; forstreamText, await it first.Use generateImage and GenerateImageResult instead of the removed experimental_generateImage and Experimental_GenerateImageResult exports.
Request bodies are no longer included in generateText and streamText step results by default; opt in with include.requestBody when needed.
generateText no longer includes response bodies by default; opt in with include.responseBody when needed.
Move the deprecated top-level streamText includeRawChunks option into include.rawChunks.
prepareStep callbacks now receive instructions as the current instruction state and initialInstructions as the original top-level value.
Lifecycle callback events and tool-call repair options use instructions instead of system.
Use isStepCount instead of stepCountIs in tool-loop stop conditions.
The deprecated function is removed; replace it with
isToolUIPart.The top-level cachedInputTokens field was removed; read inputTokenDetails.cacheReadTokens instead.
The top-level reasoningTokens field was removed; read outputTokenDetails.reasoningTokens instead.
The deprecated
{ type: 'media' }tool-result content part is removed; use thefilecontent part shape for inline file content.The minimum supported Node.js version is raised to 22; supported versions are 22, 24, and 26.
Telemetry integrations and tracing-channel subscribers use onEmbedEnd instead of onEmbedFinish.
Completed embed and embedMany calls use onEnd instead of experimental_onFinish for their per-call callback.
Completed rerank calls use onEnd instead of experimental_onFinish for their per-call callback.
The callback result follows the new multi-step result shape: usage and listed content values cover all steps, while final-step-only properties are available on
finalStep.Telemetry integrations and tracing-channel subscribers use onRerankEnd instead of onRerankFinish.
The generation start callback is now named onStart instead of experimental_onStart.
The per-step start callback is now named onStepStart instead of experimental_onStepStart.
Use output instead of the removed experimental_output option and result property.
Replace the removed experimental_prepareStep option with prepareStep.
Instructions returned from prepareStep now carry forward to future steps until another instructions or system override is returned.
Messages returned from prepareStep now become the base for subsequent steps, combined with the previous step's response messages.
System messages in prompt or messages are rejected by default; pass system instructions through instructions instead.
Models can return files in reasoning traces as a distinct part type; update exhaustive part handling to support it.
AI SDK packages are ESM-only, so CommonJS require() is no longer supported; use ESM import syntax.
Shared generation or agent runtime data now flows through runtimeContext, separately from per-tool context supplied through toolsContext.
Each step's response.messages now contains only messages produced by that step, rather than accumulated history; use result.responseMessages for the full response history.
onChunk now receives every TextStreamPart, including lifecycle, boundary, and terminal parts; handlers should guard the chunk types they process.
Approval logic moves from
needsApprovalon tools totoolApprovalon the generation call or agent, allowing approval policy to vary by request.The deprecated type is removed; use
ToolExecutionOptionsfor imports and type references.Per-tool context values are supplied through toolsContext keyed by tool name; it becomes required when at least one tool declares contextSchema.
generateTextandstreamTextresult usage now totals tokens across all steps; usefinalStep.usagefor final-step-only usage.
Deprecations 13
Replace CallSettings with LanguageModelCallOptions & Omit<RequestOptions, 'timeout'>; the deprecated type remains available in AI SDK 7.
Tool-result file content uses a canonical
filevariant with taggeddataand a requiredmediaType; legacyimage-*andfile-*variants are deprecated and runtime-auto-migrated.The user-message
{ type: 'image', image, mediaType? }part is deprecated; use afilepart with an imagemediaTypeinstead.The
tool()anddynamicTool()property is deprecated; move approval logic totoolApprovalon the call or agent.The final lifecycle callback for text generation, streaming, and agents is named onEnd; onFinish remains a deprecated alias, and onEnd takes precedence when both are provided.
The per-step lifecycle callback is named onStepEnd; onStepFinish remains a deprecated alias for user-facing callbacks, and onStepEnd takes precedence.
The
streamTextresult method is deprecated; use the stateless top-level helper to pipe a text stream.The
streamTextresult method is deprecated; use the stateless top-level helper to pipe a transformed UI message stream.The full event stream property is now named stream; fullStream remains available as a deprecated alias.
The property is deprecated; use
usage, which now returns total token usage across all steps.The
streamTextresult method is deprecated; use the stateless text-stream and response helpers instead.The
streamTextresult method is deprecated; use the stateless top-level helper, which can transform any stream.The
streamTextresult method is deprecated; use the stateless top-level helpers to create a response from a transformed stream.
New APIs and options 2
The top-level prompt option for system instructions is now instructions; system remains a deprecated fallback, and instructions takes precedence when both are provided.
The top-level option is the provider-agnostic way to control reasoning effort; remove overlapping provider-specific reasoning settings because they take precedence when both are present.
Behavior and default changes 7
The speech generation function graduated from experimental status and is now named generateSpeech; the old exports remain deprecated aliases.
The stable include option replaces experimental_include for generateText, streamText, and ToolLoopAgent; the old name remains a deprecated alias.
The tool execution end callback replaces experimental_onToolCallFinish; the old name remains a deprecated fallback.
The tool execution start callback replaces experimental_onToolCallStart; the old name remains a deprecated fallback.
Once a telemetry integration is registered, AI SDK calls emit telemetry events by default; set isEnabled to false per call or omit integrations to disable telemetry globally.
The stable telemetry option replaces experimental_telemetry; the old name remains a deprecated alias during the migration window.
The transcription API graduated from experimental status and is now named transcribe; the old names remain deprecated aliases.
@ai-sdk/azure 62 changes
Breaking changes 1
Responses API metadata is now returned under azure instead of openai.
Behavior and default changes 1
For the Responses API, use azure instead of openai as the providerOptions key. The openai key remains supported for input.
@ai-sdk/azure 449 changes
Breaking changes 8
The experimental OpenAI Live method can now resolve asynchronously; await its result before using connection settings.
Azure Speech voice-reset errors from unknown voices or unsupported styles now report status 400 instead of 502, preventing retries for client input errors.
Unknown MAI voices or styles now produce descriptive, non-retryable errors.
Rejects resourceName values that are not single DNS labels, preventing malformed values from rewriting the request host.
The baseUrl option has been removed from all providers; use baseURL instead.
CommonJS exports are removed; consumers using require() must switch to ESM import syntax.
The file part data property is tagged with a type, changing how file-part data is represented.
The image part type is removed.
Security 2
Azure image downloads are kept separate from provider authentication wrappers so file hosts do not receive Azure bearer tokens.
createDownload accepts a fetch option so core downloads can use a configured transport, including guarded-fetch for opt-in DNS validation on Node.js.
Deprecations 2
Deprecated in favor of azure.tools.webSearch().
Deprecated or ineffective DeepSeek sampling options now produce warnings and are omitted, while penalty sampling remains supported for Azure-hosted DeepSeek models.
New APIs and options 27
Adds the provider option for MAI image generations and edits, accepting 'transparent' or 'opaque'.
Adds the MAI-Image-2.7 image model for image generations and edits.
Adds the MAI-Image-2.7-Flash image model for image generations and edits.
Exposes client-executed file edits through the Azure Responses API.
Exposes the shared OpenAI custom tool factory for Azure Responses models, including raw string input support.
Exposes local and hosted shell execution through the Azure Responses API.
Reports the actual OpenAI Chat HTTP endpoint used by Azure Chat through optional request metadata and model-call end events, and exposes its sanitized origin in spans, results, and callbacks.
Responses function tools now support Azure provider options.
Adds azure.tools.toolSearch.
Azure OpenAI language-model factories accept an optional modelId for accurate telemetry and capability detection with custom deployment names; deployment ID remains used for API routing.
Adds support for MAI-Image models through the MAI image API.
Adds streaming transcription support through the MAI realtime API.
Adds speech generation support for MAI-Voice-2.1 through the MAI realtime API.
Adds speech generation support for MAI-Voice-2.1-Flash through the MAI realtime API.
Adds the maiBaseURL setting for MAI realtime API integration.
Adds providerOptions.azure.api: 'mai' to select the MAI realtime API.
Adds the webSocket setting for MAI realtime API integration.
Adds MAI-Transcribe-2 file transcription through the Azure Speech API with diarization, timestamps, transcript styles, locale forcing, and phrase lists.
Adds azure.transcriptionModel as an alias of azure.transcription.
Adds an Azure API provider option that overrides model-based routing for speech generation.
Adds a setting for configuring the Azure Speech endpoint.
Exports OpenAIResponsesSystemMessageOptions for typed message-level reasoning effort updates in Azure Responses models.
Azure adds support for DeepSeek models.
File uploading is supported where supported by the provider.
Azure OpenAI adds Microsoft Entra ID token provider authentication.
Support is added for provider references.
The Azure OpenAI Responses API adds a web search tool.
Performance 1
Construction of provider validation schemas is deferred until first use to reduce package import time.
Behavior and default changes 3
The download hook can use a function returned by createDownload and now also handles generated file URLs returned by the model, covering all core downloads.
API key and token settings now support promises and synchronous or asynchronous callbacks, resolving credentials per authenticated request while preserving existing authentication behavior and synchronous credential serialization.
Azure AI Foundry Responses requests now include explicit message item types.
Fixes and other changes 6
On the MAI image API,
background: 'auto'is omitted and produces a warning; OpenAI image deployments continue accepting it.Custom download requests receive the call's abort signal, preserving cancellation and timeouts for prompt assets and generated files.
All Azure Speech 502 errors are retryable again; the Envoy protocol-error 502 special case was removed.
Hostname parts are now validated using isValidHostnamePart, affecting hostname validation for configured Azure endpoints.
Uses a standards-compliant User-Agent header.
Constructs OpenAI v1 URLs for Azure AI Foundry and Cognitive Services hostnames while preserving complete v1 and Foundry project base URLs.
@ai-sdk/azure 327 changes
Breaking changes 3
The default Microsoft Azure OpenAI api-version changes from preview to v1.
Use embeddingModel in place of textEmbeddingModel; EmbeddingModelV3 is supported.
The default Azure Provider now uses the Responses API.
Deprecations 2
textEmbedding is retained as a deprecated alias.
textEmbeddingModel is retained as a deprecated alias; use embeddingModel instead.
New APIs and options 19
Adds support for MAI-Image-2.7 with the background option.
Adds support for MAI-Image-2.7-Flash with the background option.
Adds support for MAI-Voice-2.1 and MAI-Voice-2.1-Flash speech generation.
Adds MAI-Voice-2-Flash and MAI-Voice-2 speech generation through Azure Speech text to speech with voice, output format, speed, and style options.
Adds azure.speechModel() as an alias of azure.speech().
Adds an Azure provider option to override model-based API routing for transcription.
The Azure provider supports code_interpreter capabilities through the Responses API.
EmbeddingModelV3 is supported by the provider.
Token usage reporting is extended.
The Azure provider supports file_search capabilities through the Responses API.
Image editing is supported.
The Azure provider supports image_generation capabilities through the Responses API.
ImageModelV3 is supported by the provider.
LanguageModelV3 is supported by the provider.
The raw finish reason is exposed.
The provider adds support for the speech model v3 specification.
Tool execution approval is supported.
The provider adds support for the transcription model v3 specification.
Azure OpenAI supports web-search-preview.
Behavior and default changes 1
Requests route to the Azure Speech API by default and no longer send rejected segment timestamp defaults.
Fixes and other changes 2
doStream now sets annotations from the Responses API.
Responses API providerMetadata distinguishes Azure from OpenAI.
@ai-sdk/azure 25 changes
Breaking changes 1
The Azure OpenAI provider is updated to the v1 API format.
New APIs and options 4
The Azure provider adds support for the OpenAI responses API.
Raw chunk support is added.
The Azure provider adds speech model support.
The Azure provider adds transcribe support.