unstale

npm / @ai-sdk/provider-utils

@ai-sdk/provider-utils

What changed in @ai-sdk/provider-utils 3 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

86 breaking6 security9 deprecations37 new APIs and options2 performance14 behavior and defaults1 tooling35 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/provider-utils 751 changes

Breaking changes 36

  • OpenTelemetry span collection moved out of the ai package; install this package and register an OpenTelemetry instance to receive traces.

    7.0.0upgrade guide

  • CallSettings is split into LanguageModelCallOptions and RequestOptions; replace usages with LanguageModelCallOptions & Omit<RequestOptions, 'timeout'>.

    7.0.0upgrade guide

  • Tool callback context is now stable, scoped per tool, and inferred from contextSchema; provide tool-specific values through toolsContext rather than the shared runtime context.

    7.0.0upgrade guide

  • The deprecated export has been removed; use customProvider instead. Its options and behavior are unchanged.

    7.0.0upgrade guide

  • The deprecated export was removed; use generateImage instead.

    7.0.0upgrade guide

  • The deprecated result type export was removed; use GenerateImageResult instead.

    7.0.0upgrade guide

  • The deprecated option and generateText result property were removed; use output for both call options and result access.

    7.0.0upgrade guide

  • The deprecated option was removed; use prepareStep instead.

    7.0.0upgrade guide

  • Removes the tracer property; pass a custom OpenTelemetry Tracer to the OpenTelemetry constructor instead.

    7.0.0upgrade guide

  • The speech generation function graduated from experimental status and is available under the stable name generateSpeech.

    7.0.0upgrade guide

  • Request bodies are no longer included in generateText and streamText step results by default; set include.requestBody to true to access them.

    7.0.0upgrade guide

  • generateText no longer includes response bodies by default; set include.responseBody to true to access them.

    7.0.0upgrade guide

  • Removes the deprecated top-level cachedInputTokens field; use inputTokenDetails.cacheReadTokens instead.

    7.0.0upgrade guide

  • Removes the deprecated top-level reasoningTokens field; use outputTokenDetails.reasoningTokens instead.

    7.0.0upgrade guide

  • Minimum supported Node.js version is 22; supported versions are 22, 24, and 26.

    5.0.0, 7.0.0release notesupgrade guide

  • Renames the telemetry integration callback and tracing-channel event type from onEmbedFinish to onEmbedEnd.

    7.0.0upgrade guide

  • Renames the per-call callback for completed embed and embedMany operations from experimental_onFinish to onEnd.

    7.0.0upgrade guide

  • Renames the per-call callback for completed rerank operations from experimental_onFinish to onEnd.

    7.0.0upgrade guide

  • Renames the telemetry integration callback and tracing-channel event type from onRerankFinish to onRerankEnd.

    7.0.0upgrade guide

  • The generation start callback is available under the stable name onStart instead of experimental_onStart.

    7.0.0upgrade guide

  • Renames the per-step lifecycle callback from onStepFinish to onStepEnd across generation, streaming, agents, and UI message stream helpers; telemetry integrations should implement onStepEnd.

    7.0.0upgrade guide

  • The per-step start callback is available under the stable name onStepStart instead of experimental_onStepStart.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • Messages returned from prepareStep now form the base for subsequent steps, together with response messages from the previous step.

    7.0.0upgrade guide

  • System messages in prompt or messages are rejected by default; move instructions to the top-level instructions option or opt in with allowSystemInMessages.

    7.0.0upgrade guide

  • This field was removed from generateText and streamText responses. Read cache write and read token counts from result.usage.inputTokenDetails instead.

    7.0.0upgrade guide

  • When reasoning is set to a value other than 'none', reasoningSummary now defaults to 'detailed'. Set it to null to keep reasoning summaries disabled.

    7.0.0upgrade guide

  • Register a telemetry integration globally at application startup to continue receiving telemetry events.

    7.0.0upgrade guide

  • All AI SDK packages are ESM-only; CommonJS require() is no longer supported.

    7.0.0upgrade guide

  • Use runtimeContext for shared generation or agent state visible to orchestration, events, and step results; shared top-level context usage moves to this name.

    7.0.0upgrade guide

  • The stop-condition helper is renamed to isStepCount; update imports and tool-loop stop-condition usage.

    7.0.0upgrade guide

  • Each step's response.messages now contains only messages produced by that step; use result.responseMessages for the full response message 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

  • Provide per-tool context values through toolsContext, keyed by tool name; it is required when at least one tool declares contextSchema.

    7.0.0upgrade guide

  • The transcription API graduated from experimental status and is available under the stable name transcribe.

    7.0.0upgrade guide

  • xai(modelId) now uses the xAI Responses API by default instead of Chat Completions; use xai.chat(modelId) to keep using Chat Completions.

    7.0.0upgrade guide

Deprecations 8

  • Renamed to createGoogle; the old name remains available as a deprecated alias.

    7.0.0upgrade guide

  • Renamed to GoogleProvider; the old name remains available as a deprecated alias.

    7.0.0upgrade guide

  • Renames the final lifecycle callback from onFinish to onEnd for text generation, streaming, and agents; onFinish remains a deprecated alias, and onEnd takes precedence when both are provided.

    7.0.0upgrade guide

  • Renames experimental_onToolCallFinish for generateText and streamText; the old name remains a deprecated fallback.

    7.0.0upgrade guide

  • Renames experimental_onToolCallStart for generateText and streamText; the old name remains a deprecated fallback.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • Renames fullStream to stream; fullStream remains available as a deprecated alias.

    7.0.0upgrade guide

  • The top-level system prompt option and related prepareStep, repair, and lifecycle fields are renamed to instructions; system remains a deprecated fallback, with instructions taking precedence.

    7.0.0upgrade guide

New APIs and options 1

  • Declare tool-specific context fields with contextSchema so tool callback context is inferred and limited to declared fields.

    7.0.0upgrade guide

Behavior and default changes 5

  • Renames experimental_include to include for generateText, streamText, and ToolLoopAgent; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • The speech result type is available under the stable name SpeechResult; the old type remains a deprecated alias.

    7.0.0upgrade guide

  • Telemetry is enabled by default for AI SDK calls once an integration is registered; set isEnabled to false to opt out of a specific call.

    7.0.0upgrade guide

  • Renames experimental_telemetry to telemetry; the old option remains a deprecated alias during the migration window.

    7.0.0upgrade guide

  • The transcription result type is available under the stable name TranscriptionResult; the old type remains a deprecated alias.

    7.0.0upgrade guide

Tooling 1

  • Run this command to add the migration skill and guide your agent.

    7.0.0upgrade guide

@ai-sdk/provider-utils 5124 changes

Breaking changes 49

  • Arrays passed directly as state are interpreted as decision state parts; wrap JSON arrays in an object or a json part.

    5.0.57release notes

  • The API previously named evaluate is renamed to decide.

    5.0.54release notes

  • Packages are compiled for an ES2022 runtime target, which may affect runtime compatibility.

    5.0.49release notes

  • Use addToolOutput in place of addToolResult, passing output and the tool name for type safety.

    5.0.0upgrade guide

  • LangChainAdapter moved to this package, which provides toUIMessageStream for UI message stream responses.

    5.0.0upgrade guide

  • LlamaIndexAdapter was extracted to this package, which follows the UI message stream pattern.

    5.0.0upgrade guide

  • Update the package to the version required for AI SDK 5.0.

    5.0.0upgrade guide

  • The package has been removed and its exports moved to the ai package.

    5.0.0upgrade guide

  • The useChat configuration body is captured at first render and stays static; pass changing values at request time or use function configuration.

    5.0.0upgrade guide

  • The Vue integration replaces the useChat composable with a Chat class.

    5.0.0upgrade guide

  • The Svelte constructor now takes a function that returns configuration, using a transport in the shown pattern.

    5.0.0upgrade guide

  • The allowEmptySubmit option has been removed from ChatRequestOptions.

    5.0.0upgrade guide

  • The data option has been removed; move its contents into body.

    5.0.0upgrade guide

  • RequestOptions has been renamed to CompletionRequestOptions.

    5.0.0upgrade guide

  • Renamed experimental_context to context.

    5.0.0release notes

  • The deprecated CoreToolCall type has been removed; use ToolCall instead.

    5.0.0upgrade guide

  • The deprecated CoreToolCallUnion type has been removed; use TypedToolCall instead.

    5.0.0upgrade guide

  • The deprecated CoreToolChoice type has been removed; use ToolChoice instead.

    5.0.0upgrade guide

  • The deprecated CoreToolResult type has been removed; use ToolResult instead.

    5.0.0upgrade guide

  • The deprecated CoreToolResultUnion type has been removed; use TypedToolResult instead.

    5.0.0upgrade guide

  • createIdGenerator now requires size in its options and generates IDs at that fixed size, rather than accepting a size when the generator is called.

    5.0.0upgrade guide

  • createToolNameMapping no longer accepts resolveProviderToolName; tool names are static and based on tools keys.

    5.0.0release notes

  • The data property has been removed from the useCompletion hook.

    5.0.0upgrade guide

  • CommonJS exports were removed and all packages are ESM-only; consumers using require() must switch to ESM imports.

    5.0.0release notes

  • Renamed Experimental_Sandbox to Experimental_SandboxSession.

    5.0.0release notes

  • Changed the file part data property to be tagged with a type and removed the image part type.

    5.0.0release notes

  • The type name changed from IDGenerator to IdGenerator.

    5.0.0upgrade guide

  • The Svelte integration no longer manages input; manage input state manually and send messages yourself.

    5.0.0upgrade guide

  • The deprecated helper has been removed in favor of status.

    5.0.0upgrade guide

  • The option has been removed because it is no longer needed.

    5.0.0upgrade guide

  • The parameter has been removed from the Chat component and useChat hook; use server-side stopWhen conditions for multi-step execution.

    5.0.0upgrade guide

  • The image and file content field mimeType was renamed to mediaType for consistency.

    5.0.0upgrade guide

  • The callback has been removed from useChat and useCompletion.

    5.0.0upgrade guide

  • Returning values from onToolCall no longer automatically submits tool results; explicitly call addToolOutput instead.

    5.0.0upgrade guide

  • Vue messages now expose a parts array instead of a content string.

    5.0.0upgrade guide

  • The experimental_attachments property has been replaced by message parts, including file parts for attachments.

    5.0.0upgrade guide

  • This transport configuration option replaces experimental_prepareRequestBody for preparing chat request bodies.

    5.0.0upgrade guide

  • The API was removed entirely; use readUIMessageStream or Chat/useChat APIs instead.

    5.0.0upgrade guide

  • Embedding model settings now belong in providerOptions instead of model parameters.

    5.0.0upgrade guide

  • The rawResponse property has been renamed to response.

    5.0.0upgrade guide

  • Resume functionality has moved from experimental_resume to resumeStream.

    5.0.0upgrade guide

  • Renamed Sandbox.executeCommand to Sandbox.runCommand.

    5.0.0release notes

  • The option has been removed because sending extra message fields is now the default behavior.

    5.0.0upgrade guide

  • Svelte properties are readonly; use setter methods such as setMessages to update them.

    5.0.0upgrade guide

  • Streaming now uses start/delta/end phases with unique IDs for each content block; text-delta carries an id and uses delta instead of textDelta.

    5.0.0upgrade guide

  • The deprecated ToolCallOptions export was removed; use ToolExecutionOptions instead.

    5.0.0release notes

  • The deprecated media type part was removed; use the supported file part types instead.

    5.0.0release notes

  • ToolSet, InferToolSetContext, and UnionToIntersection were moved into @ai-sdk/provider-utils.

    5.0.0release notes

  • The hook has been removed; use useChat with a configured route instead.

    5.0.0upgrade guide

Security 5

  • Default Node.js downloads retain DNS validation and connection pinning when frameworks or instrumentation wrap global fetch before or after the SDK loads.

    3.0.41, 4.0.57, 5.0.42release notesrelease notesrelease notes

  • Prevents SSRF in OAuth metadata discovery.

    3.0.41, 4.0.57, 5.0.40release notesrelease notesrelease notes

  • download and downloadBlob validate final URLs after redirects to prevent SSRF bypasses through open redirects.

    5.0.0release notes

  • Added isSameOrigin; affected provider clients send credentials only when response-supplied URLs share the configured API origin.

    5.0.0release notes

  • Hardened URL validation against hostname and redirect bypasses, including private and reserved IPv4/IPv6 ranges; redirects are revalidated before each request.

    5.0.0release notes

Deprecations 1

  • The method remains available but is deprecated and will be removed in version 6.

    5.0.0upgrade guide

New APIs and options 34

  • Adds the box decision question type with image bounds for TypeSafe AI.

    5.0.62release notes

  • Experimental decision state now supports ordered text, file, and JSON parts, and public state forms are normalized into parts before providers are called.

    5.0.57release notes

  • Image input is supported in OpenAI Decisions and language model adapters.

    5.0.57release notes

  • Adds the portable max reasoning level, widening LanguageModelV4CallOptions['reasoning'] and ReasoningLevel; exhaustive consumers must handle max.

    5.0.55release notes

  • Experimental streaming lifecycle callbacks were added for speech generation and transcription.

    5.0.53release notes

  • Adds a shared structured language-model evaluation adapter for Choice, Score, and Boolean evaluations, preserving exact labels and metadata, validating score bounds, and returning prompted Boolean P(true) estimates validated to be in [0, 1].

    5.0.43release notes

  • Code-mode supports discovering and updating tools during a conversation.

    5.0.42release notes

  • Upload results now expose the file's byte size.

    5.0.35release notes

  • Upload results now expose the file's creation time.

    5.0.35release notes

  • Adds an optional file deletion operation to FilesV4.

    5.0.35release notes

  • Adds an optional streaming file download operation to FilesV4.

    5.0.35release notes

  • Upload results now expose the file's expiration time.

    5.0.35release notes

  • Adds abortSignal as a FilesV4 call option so calls can receive an abort signal.

    5.0.35release notes

  • Adds headers as a FilesV4 call option.

    5.0.35release notes

  • Adds a { type: 'stream' } variant for upload data.

    5.0.35release notes

  • Adds an optional FilesV4 operation for retrieving file metadata.

    5.0.35release notes

  • Adds streaming multipart uploads with deterministic part ordering and failure-path stream teardown.

    5.0.35release notes

  • UI messages retain the approval request's reason separately from an approver's response reason.

    5.0.32release notes

  • Manual tool approval statuses can include a reason, which is preserved across core, model, and UI approval requests and surfaced for OPA requires-approval decisions.

    5.0.32release notes

  • Sandbox command execution accepts optional abortSignal parameters.

    5.0.0release notes

  • Added a new custom content type.

    5.0.0release notes

  • Added an env option to the spawn and run methods of Experimental_SandboxSession.

    5.0.0release notes

  • embedMany now makes parallel requests, with maxParallelCalls available to limit concurrency.

    5.0.0upgrade guide

  • Usage data is attached as metadata to individual messages through messageMetadata in toUIMessageStreamResponse.

    5.0.0upgrade guide

  • Added support for provider references and uploading files as supported per provider.

    5.0.0release notes

  • Added readFile and writeFile, plus convenience wrappers, to the Experimental_Sandbox abstraction.

    5.0.0release notes

  • Added support for the reasoning-file type for files that are part of reasoning.

    5.0.0release notes

  • Added a top-level reasoning parameter to the specification, supported by generateText and streamText.

    5.0.0release notes

  • Use this option with lastAssistantMessageIsCompleteWithToolCalls for automatic tool result submission.

    5.0.0upgrade guide

  • Added serializeModel to extract serializable properties from a model instance so third-party provider authors can support workflows.

    5.0.0release notes

  • Added spawnCommand to Experimental_Sandbox for detached command execution.

    5.0.0release notes

  • Extracted the shared StreamingToolCallTracker class into @ai-sdk/provider-utils for reuse across OpenAI-compatible providers.

    5.0.0release notes

  • Added toolMetadata for tool-specific metadata.

    5.0.0release notes

  • Sandbox command execution accepts an optional workingDirectory parameter.

    5.0.0release notes

Performance 2

Behavior and default changes 9

  • Decision choice responses now accept exact criteria labels.

    5.0.59release notes

  • Decision file bytes are serialized as base64 in state attributes; model-call spans record normalized state parts, while outer spans retain public state inputs.

    5.0.57release notes

  • Bedrock Nova 2 maps portable xhigh to maxReasoningEffort: 'high' and returns a compatibility warning; Fireworks maps max to high and returns warnings for minimal, xhigh, and max in generation and streaming results.

    5.0.55release notes

  • Provider usage is propagated for speech generation and transcription telemetry.

    5.0.53release notes

  • Telemetry was added to speech generation and transcription.

    5.0.53release notes

  • Language-model evaluation adapters now default to reasoning: 'none' using each provider's existing reasoning mapping; explicit providerOptions reasoning settings still override it.

    5.0.43release notes

  • The type of experimental_context changed from unknown to a generic, improving context type inference.

    5.0.0release notes

  • Tool result output content file part types were aligned with top-level message file part types.

    5.0.0release notes

  • headers is now optional in provider config types, allowing manually constructed model configs to omit it.

    5.0.0release notes

Fixes and other changes 24

  • URL paths and query values now retain case sensitivity.

    4.0.59, 5.0.60release notesrelease notes

  • Shared state is labeled in language-model decision prompts.

    5.0.57release notes

  • TypeSafe AI preserves native JSON state when state contains one JSON part.

    5.0.57release notes

  • Rows are limited to 64 MB during batch result downloads.

    5.0.55release notes

  • Parallel tool calls are preserved when stream labels are missing or reused.

    5.0.55release notes

  • Hostname parts are validated using isValidHostnamePart.

    5.0.53release notes

  • Use a standards-compliant User-Agent header.

    5.0.51release notes

  • Fixes streamed tool calls with missing, blank, or repeated IDs.

    5.0.50release notes

  • Prompt conversion preserves original opaque URI strings in tagged file URLs.

    5.0.49release notes

  • Prompt conversion matches supported URL MIME types exactly so unsupported subtypes are not forwarded to providers.

    5.0.49release notes

  • Keeps per-value multimodal content aligned across automatic batches, including text-only entries, and validates content length and provider options after middleware transforms.

    4.0.54, 5.0.47release notesrelease notes

  • Executes manually approved tool inputs produced by schema transforms, preserves approved inputs during revalidation, and rejects histories whose reconstructed output differs.

    5.0.47release notes

  • Audio detection now recognizes AAC audio with ADTS headers.

    5.0.45release notes

  • Image detection now handles AVIF and HEIC images with variable ftyp box sizes.

    5.0.45release notes

  • Following validated redirects no longer waits for response clone cancellation.

    5.0.45release notes

  • Makes the lazy Undici import visible to deployment tracers.

    3.0.41, 4.0.57, 5.0.44release notesrelease notesrelease notes

  • Avoids crashing when DOMException is not a global constructor.

    5.0.42release notes

  • Plain text prefixes are no longer detected as BMP or GIF images.

    5.0.40release notes

  • The core uploadFile() helper now forwards abortSignal to the provider call.

    5.0.35release notes

  • The core uploadFile() helper now forwards headers to the provider call.

    5.0.35release notes

  • Transient network errors while reading successful response bodies are now marked retryable.

    4.0.50, 5.0.33release notesrelease notes

  • Preserves schema-valued additional properties when converting Zod 4 schemas.

    4.0.47, 5.0.29release notesrelease notes

  • Fixes handling of empty string tool call IDs.

    5.0.28release notes

  • Download rejection paths now cancel response bodies, returning sockets to the connection pool and avoiding file descriptor exhaustion.

    5.0.0release notes

@ai-sdk/provider-utils 413 changes

Security 1

  • Adds opt-in URL validation and credential origin handling for URL-based image responses, including redirect validation, unsafe header stripping, and dropping credentials on cross-origin redirects; existing unvalidated requests are preserved.

    4.0.61release notes

New APIs and options 2

Fixes and other changes 10

  • Preserves streamed tool calls when their IDs and indices are unreliable.

    3.0.40, 4.0.56release notesrelease notes

  • Matches full MIME types exactly when checking native URL support.

    4.0.55release notes

  • Preserves media types on file URLs in tool results.

    4.0.55release notes

  • Preserves approved inputs during revalidation, rejects histories whose reconstructed schema output differs, and validates transformed UI tool inputs against the reconstructed output.

    4.0.54release notes

  • OpenAI and Azure OpenAI embedding requests are split by a conservative UTF-8 byte budget derived from their aggregate token limit, in addition to input count limits.

    3.0.35, 4.0.49release notesrelease notes

  • Imports now work in runtimes without a global fetch function.

    4.0.48release notes

  • Header normalization is consolidated and custom headers are preserved.

    4.0.0release notes

  • DelayedPromise is moved into provider utils.

    4.0.0release notes

  • Calling ReadableStream.cancel() now properly finalizes async iterators.

    4.0.0release notes

  • Compatibility is fixed for V8 readonly execution environments.

    4.0.0release notes

@ai-sdk/provider-utils 32 changes

Breaking changes 1

  • Stops re-exporting createTestServer and TestResponseController; import these APIs from @ai-sdk/test-server/with-vitest instead.

    3.0.33release notes

Fixes and other changes 1

  • Transient network errors while reading successful response bodies are now marked retryable, including for AI Gateway responses.

    3.0.36release notes