unstale

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

@unstale/cli on npm

@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.

    7.0.0upgrade guide

  • Set allowSystemInMessages to true to retain support for existing system messages in prompt or messages; use only with trusted messages.

    7.0.0upgrade guide

  • Top-level result properties including content, tool calls and results, files, sources, and warnings now accumulate values across every step; use finalStep for final-step-only values.

    7.0.0upgrade guide

  • Tool callback context replaces experimental_context and is now tool-specific, typed from contextSchema, and supplied through toolsContext.

    7.0.0upgrade guide

  • Use customProvider in place of the removed experimental_customProvider export; its options and behavior are unchanged.

    7.0.0upgrade guide

  • The deprecated option is removed; replace it with activeTools in generateText and streamText calls.

    7.0.0upgrade guide

  • The tracer property was removed from experimental_telemetry; pass a custom OpenTelemetry tracer to the OpenTelemetry constructor instead.

    7.0.0upgrade guide

  • Use finalStep to access final-step result values, including reasoning, request, response, and provider metadata; for streamText, await it first.

    7.0.0upgrade guide

  • Use generateImage and GenerateImageResult instead of the removed experimental_generateImage and Experimental_GenerateImageResult exports.

    7.0.0upgrade guide

  • Request bodies are no longer included in generateText and streamText step results by default; opt in with include.requestBody when needed.

    7.0.0upgrade guide

  • generateText no longer includes response bodies by default; opt in with include.responseBody when needed.

    7.0.0upgrade guide

  • Move the deprecated top-level streamText includeRawChunks option into include.rawChunks.

    7.0.0upgrade guide

  • prepareStep callbacks now receive instructions as the current instruction state and initialInstructions as the original top-level value.

    7.0.0upgrade guide

  • Lifecycle callback events and tool-call repair options use instructions instead of system.

    7.0.0upgrade guide

  • Use isStepCount instead of stepCountIs in tool-loop stop conditions.

    7.0.0upgrade guide

  • The deprecated function is removed; replace it with isToolUIPart.

    7.0.0upgrade guide

  • The top-level cachedInputTokens field was removed; read inputTokenDetails.cacheReadTokens instead.

    7.0.0upgrade guide

  • The top-level reasoningTokens field was removed; read outputTokenDetails.reasoningTokens instead.

    7.0.0upgrade guide

  • The deprecated { type: 'media' } tool-result content part is removed; use the file content part shape for inline file content.

    7.0.0upgrade guide

  • The minimum supported Node.js version is raised to 22; supported versions are 22, 24, and 26.

    4.0.0, 7.0.0release notesupgrade guide

  • Telemetry integrations and tracing-channel subscribers use onEmbedEnd instead of onEmbedFinish.

    7.0.0upgrade guide

  • Completed embed and embedMany calls use onEnd instead of experimental_onFinish for their per-call callback.

    7.0.0upgrade guide

  • Completed rerank calls use onEnd instead of experimental_onFinish for their per-call callback.

    7.0.0upgrade guide

  • 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.

    7.0.0upgrade guide

  • Telemetry integrations and tracing-channel subscribers use onRerankEnd instead of onRerankFinish.

    7.0.0upgrade guide

  • The generation start callback is now named onStart instead of experimental_onStart.

    7.0.0upgrade guide

  • The per-step start callback is now named onStepStart instead of experimental_onStepStart.

    7.0.0upgrade guide

  • Use output instead of the removed experimental_output option and result property.

    7.0.0upgrade guide

  • Replace the removed experimental_prepareStep option with prepareStep.

    7.0.0upgrade guide

  • Instructions returned from prepareStep now carry forward to future steps until another instructions or system override is returned.

    7.0.0upgrade guide

  • Messages returned from prepareStep now become the base for subsequent steps, combined with the previous step's response messages.

    7.0.0upgrade guide

  • System messages in prompt or messages are rejected by default; pass system instructions through instructions instead.

    7.0.0upgrade guide

  • Models can return files in reasoning traces as a distinct part type; update exhaustive part handling to support it.

    7.0.0upgrade guide

  • AI SDK packages are ESM-only, so CommonJS require() is no longer supported; use ESM import syntax.

    7.0.0upgrade guide

  • Shared generation or agent runtime data now flows through runtimeContext, separately from per-tool context supplied through toolsContext.

    7.0.0upgrade guide

  • 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.

    7.0.0upgrade guide

  • onChunk now receives every TextStreamPart, including lifecycle, boundary, and terminal parts; handlers should guard the chunk types they process.

    7.0.0upgrade guide

  • Approval logic moves from needsApproval on tools to toolApproval on the generation call or agent, allowing approval policy to vary by request.

    7.0.0upgrade guide

  • The deprecated type is removed; use ToolExecutionOptions for imports and type references.

    7.0.0upgrade guide

  • Per-tool context values are supplied through toolsContext keyed by tool name; it becomes required when at least one tool declares contextSchema.

    7.0.0upgrade guide

  • generateText and streamText result usage now totals tokens across all steps; use finalStep.usage for final-step-only usage.

    7.0.0upgrade guide

Deprecations 13

  • Replace CallSettings with LanguageModelCallOptions & Omit<RequestOptions, 'timeout'>; the deprecated type remains available in AI SDK 7.

    7.0.0upgrade guide

  • Tool-result file content uses a canonical file variant with tagged data and a required mediaType; legacy image-* and file-* variants are deprecated and runtime-auto-migrated.

    7.0.0upgrade guide

  • The user-message { type: 'image', image, mediaType? } part is deprecated; use a file part with an image mediaType instead.

    7.0.0upgrade guide

  • The tool() and dynamicTool() property is deprecated; move approval logic to toolApproval on the call or agent.

    7.0.0upgrade guide

  • 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.

    7.0.0upgrade guide

  • The per-step lifecycle callback is named onStepEnd; onStepFinish remains a deprecated alias for user-facing callbacks, and onStepEnd takes precedence.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless top-level helper to pipe a text stream.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless top-level helper to pipe a transformed UI message stream.

    7.0.0upgrade guide

  • The full event stream property is now named stream; fullStream remains available as a deprecated alias.

    7.0.0upgrade guide

  • The property is deprecated; use usage, which now returns total token usage across all steps.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless text-stream and response helpers instead.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless top-level helper, which can transform any stream.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless top-level helpers to create a response from a transformed stream.

    7.0.0upgrade guide

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.

    7.0.0upgrade guide

  • 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.

    7.0.0upgrade guide

Behavior and default changes 7

  • The speech generation function graduated from experimental status and is now named generateSpeech; the old exports remain deprecated aliases.

    7.0.0upgrade guide

  • The stable include option replaces experimental_include for generateText, streamText, and ToolLoopAgent; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • The tool execution end callback replaces experimental_onToolCallFinish; the old name remains a deprecated fallback.

    7.0.0upgrade guide

  • The tool execution start callback replaces experimental_onToolCallStart; the old name remains a deprecated fallback.

    7.0.0upgrade guide

  • 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.

    7.0.0upgrade guide

  • The stable telemetry option replaces experimental_telemetry; the old name remains a deprecated alias during the migration window.

    7.0.0upgrade guide

  • The transcription API graduated from experimental status and is now named transcribe; the old names remain deprecated aliases.

    7.0.0upgrade guide

@ai-sdk/azure 62 changes

Breaking changes 1

  • Responses API metadata is now returned under azure instead of openai.

    6.0.0upgrade guide

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.

    6.0.0upgrade guide

@ai-sdk/azure 449 changes

Breaking changes 8

  • The experimental OpenAI Live method can now resolve asynchronously; await its result before using connection settings.

    4.0.114release notes

  • Azure Speech voice-reset errors from unknown voices or unsupported styles now report status 400 instead of 502, preventing retries for client input errors.

    3.0.134, 4.0.91release notesrelease notes

  • Unknown MAI voices or styles now produce descriptive, non-retryable errors.

    3.0.133, 4.0.90release notesrelease notes

  • Rejects resourceName values that are not single DNS labels, preventing malformed values from rewriting the request host.

    3.0.131, 4.0.84release notesrelease notes

  • The baseUrl option has been removed from all providers; use baseURL instead.

    4.0.0upgrade guide

  • CommonJS exports are removed; consumers using require() must switch to ESM import syntax.

    4.0.0release notes

  • The file part data property is tagged with a type, changing how file-part data is represented.

    4.0.0release notes

  • The image part type is removed.

    4.0.0release notes

Security 2

  • Azure image downloads are kept separate from provider authentication wrappers so file hosts do not receive Azure bearer tokens.

    4.0.124release notes

  • createDownload accepts a fetch option so core downloads can use a configured transport, including guarded-fetch for opt-in DNS validation on Node.js.

    4.0.124release notes

Deprecations 2

  • Deprecated in favor of azure.tools.webSearch().

    4.0.104release notes

  • Deprecated or ineffective DeepSeek sampling options now produce warnings and are omitted, while penalty sampling remains supported for Azure-hosted DeepSeek models.

    3.0.107, 4.0.49release notesrelease notes

New APIs and options 27

  • Adds the provider option for MAI image generations and edits, accepting 'transparent' or 'opaque'.

    4.0.127release notes

  • Adds the MAI-Image-2.7 image model for image generations and edits.

    4.0.127release notes

  • Adds the MAI-Image-2.7-Flash image model for image generations and edits.

    4.0.127release notes

  • Exposes client-executed file edits through the Azure Responses API.

    4.0.117release notes

  • Exposes the shared OpenAI custom tool factory for Azure Responses models, including raw string input support.

    4.0.117release notes

  • Exposes local and hosted shell execution through the Azure Responses API.

    4.0.117release notes

  • 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.

    4.0.117release notes

  • Responses function tools now support Azure provider options.

    3.0.143, 4.0.111release notesrelease notes

  • Adds azure.tools.toolSearch.

    3.0.143, 4.0.111release notesrelease notes

  • 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.

    4.0.105release notes

  • Adds support for MAI-Image models through the MAI image API.

    3.0.135, 4.0.92release notesrelease notes

  • Adds streaming transcription support through the MAI realtime API.

    4.0.90release notes

  • Adds speech generation support for MAI-Voice-2.1 through the MAI realtime API.

    4.0.90release notes

  • Adds speech generation support for MAI-Voice-2.1-Flash through the MAI realtime API.

    4.0.90release notes

  • Adds the maiBaseURL setting for MAI realtime API integration.

    4.0.90release notes

  • Adds providerOptions.azure.api: 'mai' to select the MAI realtime API.

    4.0.90release notes

  • Adds the webSocket setting for MAI realtime API integration.

    4.0.90release notes

  • Adds MAI-Transcribe-2 file transcription through the Azure Speech API with diarization, timestamps, transcript styles, locale forcing, and phrase lists.

    3.0.128, 4.0.83release notesrelease notes

  • Adds azure.transcriptionModel as an alias of azure.transcription.

    3.0.128, 4.0.83release notesrelease notes

  • Adds an Azure API provider option that overrides model-based routing for speech generation.

    3.0.131, 4.0.83release notesrelease notes

  • Adds a setting for configuring the Azure Speech endpoint.

    3.0.128, 4.0.83release notesrelease notes

  • Exports OpenAIResponsesSystemMessageOptions for typed message-level reasoning effort updates in Azure Responses models.

    2.0.137, 3.0.126, 4.0.79release notesrelease notesrelease notes

  • Azure adds support for DeepSeek models.

    4.0.0release notes

  • File uploading is supported where supported by the provider.

    4.0.0release notes

  • Azure OpenAI adds Microsoft Entra ID token provider authentication.

    4.0.0release notes

  • Support is added for provider references.

    4.0.0release notes

  • The Azure OpenAI Responses API adds a web search tool.

    4.0.0release notes

Performance 1

  • Construction of provider validation schemas is deferred until first use to reduce package import time.

    3.0.142, 4.0.107release notesrelease notes

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.

    4.0.124release notes

  • 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.

    4.0.114release notes

  • Azure AI Foundry Responses requests now include explicit message item types.

    2.0.132, 3.0.118, 4.0.66release notesrelease notesrelease notes

Fixes and other changes 6

  • On the MAI image API, background: 'auto' is omitted and produces a warning; OpenAI image deployments continue accepting it.

    4.0.127release notes

  • Custom download requests receive the call's abort signal, preserving cancellation and timeouts for prompt assets and generated files.

    4.0.124release notes

  • All Azure Speech 502 errors are retryable again; the Envoy protocol-error 502 special case was removed.

    3.0.144, 4.0.112release notesrelease notes

  • Hostname parts are now validated using isValidHostnamePart, affecting hostname validation for configured Azure endpoints.

    4.0.87release notes

  • Uses a standards-compliant User-Agent header.

    4.0.84release notes

  • Constructs OpenAI v1 URLs for Azure AI Foundry and Cognitive Services hostnames while preserving complete v1 and Foundry project base URLs.

    2.0.129, 3.0.113, 4.0.55release notesrelease notesrelease notes

@ai-sdk/azure 327 changes

Breaking changes 3

  • The default Microsoft Azure OpenAI api-version changes from preview to v1.

    3.0.0release notes

  • Use embeddingModel in place of textEmbeddingModel; EmbeddingModelV3 is supported.

    3.0.0release notes

  • The default Azure Provider now uses the Responses API.

    3.0.0release notes

Deprecations 2

  • textEmbedding is retained as a deprecated alias.

    3.0.0release notes

  • textEmbeddingModel is retained as a deprecated alias; use embeddingModel instead.

    3.0.0release notes

New APIs and options 19

  • Adds support for MAI-Image-2.7 with the background option.

    3.0.155release notes

  • Adds support for MAI-Image-2.7-Flash with the background option.

    3.0.155release notes

  • Adds support for MAI-Voice-2.1 and MAI-Voice-2.1-Flash speech generation.

    3.0.133release notes

  • 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.

    3.0.131release notes

  • Adds azure.speechModel() as an alias of azure.speech().

    3.0.131release notes

  • Adds an Azure provider option to override model-based API routing for transcription.

    3.0.128release notes

  • The Azure provider supports code_interpreter capabilities through the Responses API.

    3.0.0release notes

  • EmbeddingModelV3 is supported by the provider.

    3.0.0release notes

  • Token usage reporting is extended.

    3.0.0release notes

  • The Azure provider supports file_search capabilities through the Responses API.

    3.0.0release notes

  • Image editing is supported.

    3.0.0release notes

  • The Azure provider supports image_generation capabilities through the Responses API.

    3.0.0release notes

  • ImageModelV3 is supported by the provider.

    3.0.0release notes

  • LanguageModelV3 is supported by the provider.

    3.0.0release notes

  • The raw finish reason is exposed.

    3.0.0release notes

  • The provider adds support for the speech model v3 specification.

    3.0.0release notes

  • Tool execution approval is supported.

    3.0.0release notes

  • The provider adds support for the transcription model v3 specification.

    3.0.0release notes

  • Azure OpenAI supports web-search-preview.

    3.0.0release notes

Behavior and default changes 1

  • Requests route to the Azure Speech API by default and no longer send rejected segment timestamp defaults.

    3.0.131release notes

Fixes and other changes 2

  • doStream now sets annotations from the Responses API.

    3.0.0release notes

  • Responses API providerMetadata distinguishes Azure from OpenAI.

    3.0.0release notes

@ai-sdk/azure 25 changes

Breaking changes 1

  • The Azure OpenAI provider is updated to the v1 API format.

    2.0.0release notes

New APIs and options 4