unstale

npm / ai

ai

What changed in ai 4 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-04.

198 breaking19 security26 deprecations203 new APIs and options10 performance74 behavior and defaults1 tooling192 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

ai 7471 changes

Breaking changes 92

  • Remote file URLs in experimental_extract and experimental_decide now require an explicit hook instead of silently downloading through global fetch; inline file data remains supported without one.

    7.0.172release notes

  • Output types are now inferred as the union of schema output types when a union of schemas is passed.

    7.0.163release notes

  • Stream parts now include a typed ping variant; exhaustive stream-part switches must handle it even when opt-in is disabled.

    7.0.163release notes

  • OpenAI sends timestamp_granularities only with verbose_json and warns when requested timing is unavailable or excluded.

    7.0.163release notes

  • This telemetry value can be undefined when a provider fetches an audio URL natively; check for a missing value before using it as a number.

    7.0.163release notes

  • This telemetry value can be undefined when a provider fetches an audio URL natively; check for a missing value before using it as a string.

    7.0.163release notes

  • Streamed data parts are now validated against dataPartSchemas; invalid parts raise a TypeValidationError.

    7.0.160release notes

  • Relative paths in every method resolve against the directory run and spawn start in.

    7.0.158release notes

  • The just-bash adapter rejects writes to a directory instead of replacing it with a file.

    7.0.158release notes

  • TypeScript-guaranteed input checks were removed from text and object generation APIs and several related settings; value constraints that types cannot express remain validated.

    7.0.155release notes

  • Adds interrupted to the public finish-reason types; interrupted streams preserve partial output without an error solely for interruption and stop tool execution, agent continuation, and automatic UI follow-ups.

    7.0.149release notes

  • Low-memory streaming moves to experimental_streamTextLowMemory(options); replace calls that pass experimental_lowMemory to streamText.

    7.0.144release notes

  • Public state forms are normalized into parts before providers are called, with text and JSON objects mapped to text and json parts.

    7.0.133release notes

  • Arrays passed directly as state are interpreted as decision state parts; JSON arrays must be wrapped.

    7.0.133release notes

  • TypeSafe AI rejects file inputs in decision state.

    7.0.133release notes

  • The evaluate API was renamed to decide.

    7.0.128release notes

  • Undetermined generated audio formats now throw InvalidResponseDataError instead of a generic Error.

    7.0.128release notes

  • Provider-executed tool errors bypass the UI stream onError callback, while stream errors and invalid tool calls still invoke it.

    6.0.297, 7.0.122release notesrelease notes

  • Together AI Gemini image inputs are marked unsupported by the current single-image request mapping.

    7.0.119release notes

  • Packages are compiled for an ES2022 runtime target, which may affect the runtime environment required by developers.

    7.0.116release notes

  • URL MIME types are matched exactly so unsupported subtypes are not forwarded to providers.

    7.0.116release notes

  • Histories whose reconstructed schema output differs are rejected, including signed approvals with missing original input.

    7.0.113release notes

  • addToolOutput now rejects continuous sessions.

    7.0.102release notes

  • sendTextMessage now rejects continuous sessions.

    7.0.102release notes

  • Utility input validation now uses InvalidArgumentError, changing the error developers may need to handle.

    7.0.99release notes

  • Unsupported batch request types are now rejected.

    7.0.98release notes

  • Embedding model responses containing no embeddings are now rejected.

    5.0.259, 6.0.284, 7.0.95release notesrelease notesrelease notes

  • Batch operations now support selecting models per request.

    7.0.94release notes

  • Tool execution no longer starts automatically when a model call ends with an unsafe finish reason.

    5.0.241, 6.0.260, 7.0.70release notesrelease notesrelease notes

  • OpenTelemetry functionality moved into a new package.

    7.0.0release notesupgrade guide

  • ToolLoopAgent now validates caller-supplied options at runtime and throws InvalidArgumentError on failure.

    7.0.0release notes

  • All packages are ESM-only; consumers using require() must switch to ESM import syntax.

    7.0.0release notesupgrade guide

  • Top-level result content and the listed tool, file, source, and warning properties now accumulate values across every step; use finalStep for final-step-only values.

    7.0.0upgrade guide

  • Renames the tool callback option experimental_context to context and scopes tool callback data to fields declared by that tool's contextSchema.

    7.0.0upgrade guide

  • Tool context is validated at runtime against contextSchema; invalid context throws TypeValidationError with validation metadata in error.context.

    7.0.0release notes

  • Declares tool-specific context fields and lets tool() infer the context type available to that tool's callbacks.

    7.0.0upgrade guide

  • The deprecated option has been removed; use activeTools instead.

    7.0.0upgrade guide

  • The experimental_customProvider export was removed.

    7.0.0release notes

  • The deprecated export was removed; use customProvider instead.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • The deprecated alias was removed; migrate to output.

    7.0.0release notesupgrade guide

  • The deprecated generateText result property was removed; read result.output instead.

    7.0.0upgrade guide

  • Removed from generateText; use prepareStep instead.

    7.0.0release notesupgrade guide

  • Sandbox.executeCommand was renamed to Sandbox.runCommand.

    7.0.0release notes

  • Renamed from Experimental_Sandbox.

    7.0.0release notes

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

    7.0.0upgrade guide

  • File part data is now tagged with a type, and the image part type was removed.

    7.0.0release notes

  • Deprecated experimental generateImage exports were removed.

    7.0.0release notes

  • The stable image generation export replaces the removed experimental_generateImage export.

    7.0.0upgrade guide

  • The includeRawChunks option moved to include.rawChunks.

    7.0.0release notes

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

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • Moved to include.rawChunks.

    7.0.0release notesupgrade guide

  • Renamed from stepCountIs.

    7.0.0release notesupgrade guide

  • The deprecated function has been removed; use isToolUIPart instead.

    7.0.0upgrade guide

  • CallSettings was split into LanguageModelCallOptions and RequestOptions.

    7.0.0release notes

  • Renamed from ModelCallStreamPart as low-level stream primitives adopt language model call terminology.

    7.0.0release notes

  • 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

  • The deprecated tool-result content part type has been removed; use the file variant for inline tool-result file content.

    7.0.0upgrade guide

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

    7.0.0release notesupgrade guide

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

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • Renamed from onFinish.

    7.0.0release notesupgrade guide

  • UI message stream helpers now use a generic error message by default; raw error details are emitted only when an onError handler is explicitly supplied.

    7.0.0release notes

  • Renamed from onObjectStepFinish.

    7.0.0release notes

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

    7.0.0upgrade guide

  • The generation start callback for generateText, streamText, and agents is now named onStart instead of experimental_onStart.

    7.0.0upgrade guide

  • Renamed from onStepFinish.

    7.0.0release notesupgrade guide

  • The per-step start callback for generateText, streamText, and agents is now named onStepStart instead of experimental_onStepStart.

    7.0.0upgrade guide

  • The export was removed.

    7.0.0release notes

  • 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, with previous response messages appended.

    7.0.0upgrade guide

  • This field was removed from generateText and streamText responses; read cache token counts from the standard usage object instead.

    7.0.0upgrade guide

  • When reasoning is set to a value other than 'none', reasoning summaries now default to 'detailed'. Set this field to null to keep them disabled.

    7.0.0upgrade guide

  • MCPTransportConfig now defaults redirect to error rather than follow, rejecting HTTP redirects by default to help prevent SSRF attacks.

    7.0.0upgrade guide

  • Register a telemetry integration globally at application startup to receive OpenTelemetry traces.

    7.0.0upgrade guide

  • The codemod updates named imports and direct re-exports to the new API names while preserving local bindings and application export names as aliases; namespace member access remains unchanged.

    7.0.0upgrade guide

  • Renamed from context.

    7.0.0release notes

  • Replaces shared top-level context for generation and agent runtime data, which is visible to orchestration but no longer supplied to tool callbacks.

    7.0.0upgrade guide

  • Renamed to telemetry.includeRuntimeContext and made opt-in.

    7.0.0release notes

  • 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

  • The streaming model-call primitive was renamed to use language model call terminology.

    7.0.0release notes

  • Rejects result promises with NoOutputGeneratedError when a model stream ends without output; streams with partial output still resolve with the partial result.

    7.0.0release notes

  • System messages in prompt or messages are rejected by default; opt in to allow them. The notes recommend using instructions instead.

    7.0.0release notesupgrade guide

  • Replaces Tool.sensitiveContext and is opt-in.

    7.0.0release notes

  • Telemetry integration naming changed from *TelemetryIntegration to *Telemetry.

    7.0.0release notes

  • The deprecated export was removed; use ToolExecutionOptions instead.

    7.0.0release notesupgrade guide

  • The deprecated media type part was removed.

    7.0.0release notes

  • Provides per-tool context values 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

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

    7.0.0upgrade guide

Security 13

  • Downloads are kept separate from provider authentication wrappers so file hosts do not receive Azure bearer tokens or Vertex Express Mode API keys.

    7.0.171release notes

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

    7.0.171release notes

  • Provider request URLs are sanitized before text generation results reach telemetry integrations and tracing subscribers, preventing endpoint credentials from being exposed.

    7.0.165release notes

  • Unavailable tools no longer expose persisted output to models.

    5.0.273, 7.0.129release notesrelease notes

  • Default stream reconnection URLs encode chat IDs, reject standalone dot IDs, and preserve custom URLs unchanged.

    5.0.270, 6.0.297, 7.0.122release notesrelease notesrelease notes

  • Tracing-channel context is now filtered according to telemetry allowlists.

    7.0.114release notes

  • URL-backed language model file outputs are securely downloaded and expose actual base64 and byte content, with valid data URLs in UI streams.

    7.0.111release notes

  • Prevents direct execution of tools governed by tool callers.

    7.0.108release notes

  • Default Node.js downloads retain DNS validation and connection pinning when global fetch is wrapped before or after SDK loading.

    5.0.271, 6.0.298, 7.0.103release notesrelease notesrelease notes

  • Prevents streamText from executing tool calls that violate tool choice.

    7.0.94release notesrelease notes

  • When configured, approval replay validates HMAC signatures; replay also revalidates tool input and resolves approval policy before execution.

    7.0.0release notes

  • Client-replayed approvals are revalidated against tool schemas and approval policy before execution, with optional HMAC signature validation.

    7.0.0release notes

  • Hardens URL validation against hostname, IPv6, reserved-address, and redirect bypasses; unsafe redirect targets are checked before they are requested.

    7.0.0release notes

Deprecations 19

  • experimental_filterActiveTools remains available as a deprecated alias.

    7.0.157release notes

  • Experimental_LanguageModelStreamPart is deprecated in favor of the stable LanguageModelStreamPart.

    7.0.157release notes

  • Deprecation warnings now use stable codes and are deduplicated.

    7.0.129release notes

  • rawInput is deprecated in output-error UI message parts.

    7.0.103release notes

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

    7.0.0upgrade guide

  • The Chat class exported from @ai-sdk/vue is deprecated in favor of the useChat composable.

    7.0.0upgrade guide

  • The Google provider factory is now named createGoogle; createGoogleGenerativeAI remains available as a deprecated alias.

    7.0.0upgrade guide

  • Tool-result image-* and file-* content variants are deprecated in favor of a canonical file variant with tagged data and mediaType.

    7.0.0upgrade guide

  • Names in @ai-sdk/google containing GoogleGenerativeAI remain usable as deprecated aliases; migrate to the corresponding names using Google.

    7.0.0upgrade guide

  • The Google provider class is now named GoogleProvider; GoogleGenerativeAIProvider remains available as a deprecated alias.

    7.0.0upgrade guide

  • The user-message image content part is deprecated; use a file part with an image mediaType instead.

    7.0.0upgrade guide

  • The tool-level approval property is deprecated; move approval policy to toolApproval on the call or agent so it can vary by request.

    7.0.0upgrade guide

  • Renames the final lifecycle callback from onFinish to onEnd for generateText, streamText, agents, and ToolLoopAgent settings; onFinish remains a deprecated alias, and onEnd takes precedence.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • Top-level reasoning, reasoningText, request, response, and providerMetadata result properties are deprecated; use finalStep for final-step values.

    7.0.0upgrade guide

  • The result fullStream property is deprecated in favor of stream.

    7.0.0release notesupgrade guide

  • The streamText result helper is deprecated; use the stateless top-level helper to compose transformations over any stream.

    7.0.0upgrade guide

  • generateText and streamText result usage now reports totals across all steps; totalUsage is deprecated.

    7.0.0release notesupgrade guide

New APIs and options 132

  • Steering gains an interrupt option that can cancel a model call before it produces output.

    7.0.177release notes

  • The package now ships the AI SDK skill at this path for pnpm agent skills.

    7.0.177release notes

  • Adds extraction model support to provider registries, custom providers, and string model ids.

    7.0.174release notes

  • Parses output when retrieving batch results.

    7.0.174release notes

  • Supports output in startBatch; getBatchResults also parses it.

    7.0.174release notes

  • Set this environment variable to false to disable the warning logger.

    6.0.0, 7.0.173upgrade guiderelease notes

  • generate() and stream() accept a timeout object with totalMs, stepMs, firstChunkMs, and chunkMs; invalid values are rejected, and timeouts end a model step even when the provider stream ignores the abort signal.

    7.0.173release notes

  • Accepts toolApproval in the constructor and per generate() or stream() call; it takes precedence over a tool's needsApproval setting and runs in workflow context outside durable model steps.

    7.0.173release notes

  • An experimental extract API and extraction model spec are added.

    7.0.171release notes

  • Adds experimental_queue to queue messages sent while a response is in progress.

    7.0.168release notes

  • An optional createTransport interface is available for provider-owned realtime transports.

    7.0.163release notes

  • This alias for the RealtimeModelV4 server-side spec type is re-exported.

    7.0.163release notes

  • Anthropic emits typed heartbeat parts only when includePings is true; it is disabled by default.

    7.0.163release notes

  • Providers can optionally transcribe audio URLs natively; Groq sends HTTP(S) URLs without downloading and re-uploading them, while a custom download function retains local download behavior.

    7.0.163release notes

  • A provider connection capability is available for provider-owned realtime transports.

    7.0.163release notes

  • Shared timestamp granularities are accepted for transcription; explicit provider timing settings take precedence.

    7.0.163release notes

  • Optional word timings are exposed separately from segments and shared timestampGranularities are accepted; explicit provider timing settings take precedence.

    7.0.163release notes

  • Video generation reports videos delivered directly to caller-managed storage through uploadedVideos without downloading or synthesizing video bytes.

    7.0.163release notes

  • Typed experimental durable context hooks are available for telemetry integrations.

    7.0.162release notes

  • Pass the same OpenTelemetryIdGenerator instance to the tracer provider's idGenerator and sampler and to new OpenTelemetry({ durable }) to carry trace context and sampling across steps.

    7.0.162release notes

  • Durable runs support a single telemetry operation that reports workflow events on completion or suspension, preserving original timestamps.

    7.0.162release notes

  • Adds steering.queue() to send a message once the current task is done.

    7.0.160release notes

  • Adds deleteFile to Experimental_SandboxSession.

    7.0.158release notes

  • Adds listDirectory to Experimental_SandboxSession.

    7.0.158release notes

  • Adds stat to Experimental_SandboxSession.

    7.0.158release notes

  • Adds an onAbort callback to ToolLoopAgent.

    7.0.154release notes

  • Adds an onError callback to ToolLoopAgent.

    7.0.154release notes

  • Adds an onStepError callback to generateText, streamText, ToolLoopAgent, and telemetry integrations.

    7.0.154release notes

  • Adds experimental steering to generateText, streamText, and ToolLoopAgent.

    7.0.154release notes

  • Adds a mock streaming speech model to ai/test.

    7.0.150release notes

  • Adds an exported type for speech stream parts.

    7.0.150release notes

  • Adds an exported type for speech stream usage.

    7.0.150release notes

  • Adds an exported type for speech text parts.

    7.0.150release notes

  • Streams speech audio from text or text parts using compatible speech models; returns audio and metadata promises, with non-fatal provider errors reported through onError and aborts or cancellation rejecting result promises immediately.

    7.0.150release notes

  • Adds an exported type for the streamSpeech result.

    7.0.150release notes

  • Adds an optional cause to NoSpeechGeneratedError.

    7.0.150release notes

  • Experimental decision calls accept maxOutputTokens and forward it to language-model-backed decisions; native decision providers warn when the setting is unsupported.

    7.0.146release notes

  • Experimental decision calls accept reasoning and forward it to language-model-backed decisions; adapters keep reasoning disabled when omitted, and native providers warn when unsupported.

    7.0.146release notes

  • Moves low-memory streaming to a dedicated function, supporting reusable options and ReturnType.

    7.0.144release notes

  • Adds support for the Perplexity decisions API.

    7.0.144release notes

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

    7.0.143release notes

  • Adds experimental_lowMemory: true for single-consumer streaming without a replay buffer or retained final-content results, reducing memory retention.

    7.0.143release notes

  • Adds configurable concurrency for tool call execution.

    7.0.140release notes

  • Adds an optional shared citation representation across generated text, stream events, result content, and UI message text parts.

    7.0.138release notes

  • Embedding functions accept a new top-level dimensions setting.

    7.0.135release notes

  • Adds persistent WebSocket chat transport with correlated streaming, backpressure, cancellation, protocol validation, lifecycle handling, and sequence-based resume support.

    7.0.135release notes

  • Experimental decision state now supports ordered text, file, and JSON parts.

    7.0.133release notes

  • OpenAI Decisions and language model adapters now support image input.

    7.0.133release notes

  • Introduces a callback for persisting messages when a UI message step ends.

    7.0.132release notes

  • Adds portable max reasoning with native provider mappings, compatibility coercions, and budget-based fallback support.

    7.0.129release notes

  • ReasoningLevel now includes max, so exhaustive switches and Record mappings must handle the new value.

    7.0.129release notes

  • extractReasoningMiddleware supports custom reasoning delimiters.

    7.0.128release notes

  • WorkflowAgent gains durable non-streaming generation with a shared tool loop, typed output, and a 20-step default.

    7.0.128release notes

  • Tool search can select and rank eligible deferred tools through a search callback.

    7.0.127release notes

  • Tool search supports configuring the maximum number of returned tools.

    7.0.127release notes

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

    7.0.124release notes

  • File-input support is advertised for QuiverAI Arrow 2 and Arrow 2 Telos.

    7.0.119release notes

  • Single-image editing capability is included for Together AI FLUX.2 Pro and Flex.

    7.0.119release notes

  • Gemini TTS supports explicit A-law output.

    7.0.113release notes

  • Gemini 3.8 TTS support adds structured speech metadata and per-turn speaker and style controls for prebuilt voices.

    7.0.113release notes

  • Gemini TTS supports explicit mu-law output.

    7.0.113release notes

  • Gemini TTS supports explicit raw PCM output.

    7.0.113release notes

  • customProvider now accepts evaluationModels for experimental evaluation model aliasing and registry resolution.

    7.0.104release notes

  • Registries now expose evaluationModel for evaluation-capable model resolution.

    7.0.104release notes

  • Adds a native tool search tool for applications that need tool discovery.

    7.0.104release notes

  • Adds experimental evaluation of Choice, Score, and Boolean questions against shared state with typed answers and validation.

    7.0.103release notes

  • Adds an error for unsupported evaluation question types.

    7.0.103release notes

  • Applications exchange WebRTC SDP through an application endpoint using api.session.

    7.0.102release notes

  • Experimental client-delegated Live conversations can use browser-direct WebRTC alongside the existing WebSocket path.

    7.0.102release notes

  • The unified factory adds experimental OpenAI Live provider support for server WebSocket sessions with client delegation.

    7.0.102release notes

  • An OpenAI-specific api override is available for early-access models.

    7.0.102release notes

  • Typed AI SDK errors are exposed for UI transport and completion failures.

    7.0.100release notes

  • Image generation requests are now supported in batches.

    7.0.98release notes

  • A type guard for tool output errors was added alongside a stable UI message type.

    7.0.98release notes

  • A stable UI message type and a type guard for tool output errors were added.

    7.0.98release notes

  • Batch cancellation and listing APIs were added for managing batches.

    7.0.97release notes

  • Adds an API for canceling batches.

    7.0.96release notes

  • Adds an API for listing batches.

    7.0.96release notes

  • Array outputs now support maxItems constraints.

    7.0.93release notes

  • Array outputs now support minItems constraints.

    7.0.93release notes

  • onLanguageModelCallStart is formally included in the ToolLoopAgentSettings type.

    7.0.93release notes

  • Adds configurable recovery for provider errors after response streaming begins, with isolated retry attempts and successful-attempt-only results and metadata.

    7.0.91release notes

  • Adds a bounded callback-directed recovery path for streamed provider errors when streamRetries is configured to 0.

    7.0.91release notes

  • Upload results now expose the uploaded file size.

    7.0.89release notes

  • Provider-utils adds a handler for binary stream responses.

    7.0.89release notes

  • Upload results now expose the file creation timestamp.

    7.0.89release notes

  • FilesV4 now supports optionally deleting files.

    7.0.89release notes

  • FilesV4 now supports optional streaming file downloads.

    7.0.89release notes

  • Upload results now expose the file expiration timestamp.

    7.0.89release notes

  • FilesV4 operations can receive an abort signal for cancellation.

    7.0.89release notes

  • FilesV4 operations can receive custom request headers.

    7.0.89release notes

  • FilesV4 now supports optionally retrieving file metadata.

    7.0.89release notes

  • Provider-utils adds streaming multipart uploads with deterministic part ordering and failure-path stream teardown.

    7.0.89release notes

  • Uploads can use a stream data variant for streaming uploads.

    7.0.89release notes

  • Batch operations now support tool calling.

    7.0.88release notes

  • WorkflowAgent now supports signed tool approvals.

    7.0.86release notes

  • Anthropic batch requests now support the full language-model option surface.

    7.0.85release notes

  • Individual image generation calls are now exposed for direct use.

    7.0.85release notes

  • UI message stream end callbacks now provide operation-level outcomes.

    5.0.249, 6.0.271, 7.0.83release notesrelease notesrelease notes

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

    7.0.82release notes

  • Manual tool approval statuses can include a reason that is preserved across core, model, and UI approval requests.

    7.0.82release notes

  • The gateway provider registers batch completion webhooks through the batch callbackUrl contract.

    7.0.79release notes

  • Batch completion webhooks can be configured with a webhook URL.

    7.0.79release notes

  • ToolLoopAgent exposes the option to allow or reject system messages in prompt or messages, including dynamic per-call configuration from prepareCall.

    7.0.0release notes

  • This opt-in preserves acceptance of system messages in existing histories, but should only be used for trusted messages because user-edited messages could override or set the system prompt.

    7.0.0upgrade guide

  • Provider content supports a new custom content type.

    7.0.0release notes

  • The stream part type is now exposed.

    7.0.0release notes

  • Adds a realtime model specification with normalized event types and a factory, alongside provider implementations and client support.

    7.0.0release notes

  • Tool call repair options use instructions instead of system for the current system instructions.

    7.0.0upgrade guide

  • Adds readFile and writeFile methods with convenience wrappers to the sandbox abstraction.

    7.0.0release notes

  • Adds detached command execution to the sandbox abstraction.

    7.0.0release notes

  • Exposed on text generation results.

    7.0.0release notes

  • Adds a first-class call option for video.

    7.0.0release notes

  • Opt in to storing step request messages.

    7.0.0release notes

  • Introduced as the primary prompt option, with system deprecated.

    7.0.0release notesupgrade guide

  • Adds a stop-condition helper for unlimited steps.

    7.0.0release notes

  • This command adds the migration skill to guide an agent through migrating from AI SDK v6 to v7.

    7.0.0upgrade guide

  • Adds an abort hook to close telemetry spans.

    7.0.0release notes

  • The callback receives the current instructions state and the top-level initialInstructions value.

    7.0.0upgrade guide

  • Provider references support uploading files and provider skills.

    7.0.0release notes

  • A top-level reasoning parameter is supported by the provider specification, generateText, and streamText.

    7.0.0release notes

  • Models can return files in a distinct reasoning-file part; update exhaustive part handling to support it.

    7.0.0upgrade guide

  • Accepts plain string model IDs as well as RerankingModel objects.

    7.0.0release notes

  • Added to GenerateTextResult and StreamTextResult.

    7.0.0release notes

  • The timeout configuration now supports toolMs.

    7.0.0release notes

  • Supports per-tool timeout overrides through toolTimeouts.

    7.0.0release notes

  • Controls the order in which tools are sent to provider APIs.

    7.0.0release notes

  • Separated toolsContext from context.

    7.0.0release notes

  • Extracts text deltas from a streamText stream as a standalone helper.

    7.0.0release notes

  • Standalone helper converts a compatible text stream into UI message chunks without using a streamText result object.

    7.0.0release notes

  • Standalone helper converts a compatible text stream into a UI message stream without using a streamText result object.

    7.0.0release notes

  • The Vue composable exposes reactive messages, status, and error, and can recreate the underlying chat when its init object changes.

    7.0.0upgrade guide

Performance 4

  • Validates provider and tool metadata and citation JSON values in a single pass without copying them, except to remove __proto__ keys, reducing memory and CPU use for deeply nested values.

    7.0.174release notes

  • Reduces excessive CPU usage when streaming long arrays by parsing and validating completed elements incrementally.

    5.0.289, 6.0.330, 7.0.170release notesrelease notesrelease notes

  • Completed elements are parsed and validated incrementally, reducing excessive CPU usage when streaming long arrays.

    7.0.170release notes

  • Default chat IDs are generated on first access, allowing useChat() to prerender without reading a random value when the ID is unused during rendering.

    7.0.143release notes

Behavior and default changes 52

  • WorkflowAgent now carries returned instructions or deprecated system values forward to later steps, merges providerOptions with agent options, and merges headers over call headers.

    7.0.173release notes

  • generate() and stream() log warnings from every model call through the AI SDK warning logger; AI_SDK_LOG_WARNINGS controls the output.

    7.0.173release notes

  • The createDownload function can be used as experimental_download with generateText and streamText, and the hook now also handles generated file URLs returned by the model.

    7.0.171release notes

  • Warns when a tool error sent in the UI stream differs from the text the model received and later reasoning is sent; the request still fails.

    7.0.171release notes

  • Validation checks only the schemas for a part’s type, stops at the first invalid message or part, and reports invalid JSON metadata as a single issue, preventing excessive memory and CPU usage.

    7.0.171release notes

  • Transcription word timings are no longer included in telemetry when recordOutputs is false.

    7.0.165release notes

  • OpenAI Chat, Azure Chat, and Bedrock Mantle Chat can report their actual HTTP endpoint through optional request metadata and model-call end events; results, callbacks, and OpenTelemetry spans expose only sanitized endpoint details.

    7.0.163release notes

  • Output types are now inferred as the union of schema output types when a union of schemas is passed.

    7.0.163release notes

  • Steering messages are streamed to the UI and retained in converted messages.

    7.0.163release notes

  • filterActiveTools is now exported as a stable API.

    7.0.157release notes

  • LanguageModelStreamPart is now stable.

    7.0.157release notes

  • Adds aiVersion to telemetry events so tracing-channel subscribers and telemetry integrations can identify the emitting ai package version, including in bundled applications and applications with multiple SDK versions.

    7.0.154release notes

  • Streamed custom-tool input is marked as text so UI clients can display it progressively without JSON parsing.

    7.0.142release notes

  • A warning is logged when the default step limit stops a tool loop.

    7.0.135release notes

  • Model-call spans now record normalized state parts, while outer spans retain public state inputs.

    7.0.133release notes

  • Decision file bytes are serialized as base64 in OpenTelemetry state attributes.

    7.0.133release notes

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

    7.0.133release notes

  • Decision refusals are reported as refusal answers.

    7.0.130release notes

  • Portable minimal, xhigh, and max retain or receive provider mappings and now return compatibility warnings.

    7.0.129release notes

  • Speech generation and transcription now include telemetry and provider usage propagation.

    7.0.124release notes

  • Provider capability declarations advertise file and mask input support using confirmed model IDs.

    7.0.119release notes

  • Newer and custom model IDs default to structured speech, while legacy formats remain for older models.

    7.0.113release notes

  • UI message stream end callbacks now report consumer cancellation.

    7.0.112release notes

  • Adds telemetry support to experimental_evaluate.

    7.0.111release notes

  • Accepts string model IDs when an evaluation-capable default provider is explicitly configured; evaluation does not implicitly fall back to Gateway.

    7.0.104release notes

  • Tool search now supports direct tool calling.

    7.0.104release notes

  • Code-mode can discover and update tools during a conversation.

    7.0.103release notes

  • Live continuous sessions enforce 128 KiB frame and combined buffered-send budgets using actual encoded wire bytes.

    7.0.102release notes

  • Known Live model IDs route to Live, while unknown IDs retain legacy Realtime defaults.

    7.0.102release notes

  • maxPlaybackBufferSeconds is supported only for continuous PCM sessions.

    7.0.102release notes

  • Runtime context attribution was added to embed, embedMany, and rerank operations.

    7.0.98release notes

  • Google and Google Vertex prompt blocks are now treated as terminal.

    7.0.94release notes

  • Retryability classification is provider-independent and preserved through the AI Gateway.

    5.0.255, 6.0.280, 7.0.94release notesrelease notesrelease notes

  • The core uploadFile helper now forwards abortSignal and headers options.

    7.0.89release notes

  • Parsed structured output is now exposed in streamText end callbacks.

    6.0.273, 7.0.84release notesrelease notes

  • Chats can continue automatically after tool approval denials reach the output-denied state.

    6.0.270, 7.0.83release notesrelease notes

  • OPA requires-approval decisions now surface their reason to human approvers.

    7.0.82release notes

  • Preliminary tool outputs are filtered when ignoreIncompleteToolCalls is enabled.

    5.0.241, 6.0.260, 7.0.70release notesrelease notesrelease notes

  • Chat status remains submitted until response content begins streaming.

    6.0.255, 7.0.66release notesrelease notes

  • Telemetry is now stable rather than experimental.

    7.0.0release notes

  • Telemetry settings no longer include telemetry data in user-facing event data.

    7.0.0release notes

  • The file variant's mediaType accepts a full IANA type or a top-level segment; subtype is auto-detected from inline bytes where possible.

    7.0.0upgrade guide

  • Promoted to stable exports.

    7.0.0release notesupgrade guide

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

    7.0.0upgrade guide

  • The callback follows the result changes: usage and listed content properties include all steps, while final-step-only properties are available on finalStep.

    7.0.0upgrade guide

  • When top-level reasoning and provider-specific reasoning settings overlap, providerOptions takes precedence and can bypass the top-level configuration.

    7.0.0upgrade guide

  • The speech result type has a stable name; Experimental_SpeechResult remains a deprecated alias.

    7.0.0upgrade guide

  • Telemetry is enabled by default.

    7.0.0release notes

  • Once a telemetry integration is registered, AI SDK calls emit telemetry events by default; set isEnabled: false to opt out for a call.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • Promoted to stable exports; experimental aliases remain for backwards compatibility and are deprecated.

    7.0.0release notesupgrade guide

  • The transcription result type has a stable name; Experimental_TranscriptionResult remains a deprecated alias.

    7.0.0upgrade guide

Tooling 1

  • Run the v7 codemods from the project root to automate many v6-to-v7 code transformations.

    7.0.0upgrade guide

Fixes and other changes 158

  • Fixes locked stream errors when telemetry subscribers or integrations replace a model stream whose request or response metadata requires credential redaction.

    7.0.174release notes

  • When no tools are provided, experimental_transform factories receive an empty tool set instead of tools: undefined, matching the StreamTextTransform type.

    7.0.174release notes

  • In-place schema validation or input refinement no longer changes approved tool arguments during approval replay.

    7.0.173release notes

  • Logs the default step limit warning when generate() stops at the default limit.

    7.0.173release notes

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

    7.0.171release notes

  • Pending send-now operations are canceled when a later stop or dispose occurs, preventing an abandoned chat's queued messages and history from being sent through a replacement transport.

    7.0.170release notes

  • The queue keeps request options when sending a tool approval first and waits while an async sendAutomaticallyWhen decision is pending.

    7.0.169release notes

  • Calls onError once per invalid tool call.

    7.0.168release notes

  • Downloaded audio types are detected from bytes when servers return generic or non-audio content types.

    7.0.163release notes

  • Deprecated file-url tool result content is now downloaded and normalized like file parts when the model does not support the URL.

    7.0.163release notes

  • Empty signature text from foreign providers is omitted when replaying history through Anthropic or Bedrock, while Bedrock retains native reasoning-history handling.

    7.0.163release notes

  • Streamed Google responses preserve text and complete function-call order, standalone thought signatures, and provider metadata on empty text parts.

    7.0.163release notes

  • Groq strips media fragments from URLs and falls back to secure local download and file upload when it rejects a redirect.

    7.0.163release notes

  • Deprecated image-url tool result content is now downloaded and normalized like file parts when the model does not support the URL.

    7.0.163release notes

  • Telemetry events delivered to integrations and ai:telemetry now respect recordInputs and recordOutputs, filtering nested content and omitting raw span results when content recording is disabled.

    7.0.163release notes

  • Access video only when videos is nonempty; directly uploaded videos are reported through uploadedVideos instead.

    7.0.163release notes

  • Validation now restores server-defined tool metadata, dynamic status, and title so approval policies receive the same tool definition fields as new model calls.

    7.0.162release notes

  • cloneModelMessages now supports cross-realm binary buffers and circular structures.

    7.0.161release notes

  • data-content and file-part-data now handle cross-realm Uint8Array and ArrayBuffer values.

    7.0.161release notes

  • DefaultGeneratedFile now supports cross-realm Uint8Array and ArrayBuffer values.

    5.0.285, 6.0.322, 7.0.161release notesrelease notesrelease notes

  • Clarifies the inverted prefix error message.

    7.0.160release notes

  • Repairs partial JSON that ends with a minus sign at the start of an array.

    7.0.158release notes

  • The just-bash and Vercel Sandbox adapters resolve a relative workingDirectory for run and spawn against the sandbox's working directory.

    7.0.158release notes

  • Node.js runtime detection used by telemetry tracing no longer causes Next.js Edge Runtime warnings.

    7.0.157release notes

  • Fixes non-streaming Responses API structured output when multiple assistant messages contain JSON; OpenAI and Azure Responses models can select the last final_answer while preserving generated content, annotations, conversation history, and token usage.

    7.0.153release notes

  • Only the first approval response per tool call is processed, preventing repeated or conflicting responses from executing a tool twice or both executing and denying it.

    6.0.313, 7.0.149release notesrelease notes

  • Forwards toolChoice: 'none' to the Hugging Face Responses API and rejects tool calls before local execution in generateText, streamText, and WorkflowAgent.

    7.0.149release notes

  • Repaired tool names are now preserved in streamed UI message parts.

    6.0.313, 7.0.147release notesrelease notes

  • Optional tools no longer add an incorrect undefined member to tool call, result, error, denied output, and execution event types.

    7.0.146release notes

  • Pruning tool calls now removes orphaned reasoning, including consecutive summary and reasoning-file parts.

    7.0.146release notes

  • Raw OpenAI custom-tool input deltas are restored for consumers forwarding them to Responses API clients.

    6.0.308, 7.0.142release notesrelease notes

  • The text encoding is preserved when partial UI messages are saved and resumed.

    6.0.308, 7.0.142release notesrelease notes

  • Workflow now passes runtime context when telemetry.includeRuntimeContext allows it.

    7.0.141release notes

  • Rejects approved tool calls without results before sending later context to providers.

    6.0.304, 7.0.138release notesrelease notes

  • Fixes validation of rounded choice probabilities.

    7.0.138release notes

  • Prevents duplicate message parts when replayed streams are resumed.

    6.0.304, 7.0.138release notesrelease notes

  • Reports incomplete model streams with no output as errors.

    7.0.138release notes

  • Updates streaming chat messages by stable ID.

    5.0.274, 6.0.304, 7.0.138release notesrelease notesrelease notes

  • Updates tool outputs in the message containing the matching tool call.

    5.0.274, 6.0.304, 7.0.138release notesrelease notesrelease notes

  • Prevents a second resume request on mount when a chat is already submitted or streaming.

    5.0.274, 6.0.304, 7.0.138release notesrelease notesrelease notes

  • Discards unrelated message state when reading resumed streams.

    5.0.274, 6.0.303, 7.0.137release notesrelease notesrelease notes

  • chunkMs and firstChunkMs stop when model responses end, retries receive fresh timeout budgets, and stepMs still covers local tools.

    7.0.136release notes

  • Stopping now waits for chat stream cleanup to complete.

    5.0.274, 6.0.303, 7.0.135release notesrelease notesrelease notes

  • Repeated tool approval responses no longer trigger duplicate continuation requests.

    7.0.135release notes

  • Provider-executed tool calls are preserved when streams are resumed.

    7.0.134release notes

  • Async sendAutomaticallyWhen failures from tool updates are now propagated.

    7.0.134release notes

  • Gateway keeps its existing string and JSON request format and rejects file inputs.

    7.0.133release notes

  • Pending result promises are rejected and pending streams are canceled when the abort signal fires.

    7.0.130release notes

  • Nova 2 portable xhigh now sends maxReasoningEffort high instead of max and returns a compatibility warning.

    7.0.129release notes

  • Chat reconnect URLs no longer contain duplicate slashes.

    5.0.273, 6.0.302, 7.0.129release notesrelease notesrelease notes

  • Provider options are now preserved from approval-only tool messages.

    7.0.129release notes

  • V2 provider-reported total tokens are now preserved in raw usage.

    6.0.302, 7.0.129release notesrelease notes

  • The latest error is now published after repeated failed stream resume attempts.

    6.0.302, 7.0.129release notesrelease notes

  • WebKit network errors are now recognized.

    7.0.129release notes

  • Silent audio now returns successful empty transcripts.

    7.0.128release notes

  • Tool approval state is preserved when resuming streams.

    7.0.128release notes

  • Tool approval inputs created in another JavaScript realm are accepted when unchanged.

    7.0.127release notes

  • Merged UI message streams are canceled when the consumer disconnects.

    7.0.127release notes

  • Tool approvals are cleared when addToolOutput runs.

    7.0.126release notes

  • Partial reasoning tags are preserved when streamed text parts end.

    7.0.123release notes

  • Pending tool approvals superseded by user messages are ignored.

    7.0.123release notes

  • All tool content is pruned when retaining zero trailing messages.

    7.0.123release notes

  • Idle UI message streams remain open through optional SSE heartbeats.

    5.0.270, 6.0.297, 7.0.123release notesrelease notesrelease notes

  • Active UI message parts now continue when resuming after a disconnect.

    5.0.268, 6.0.295, 7.0.120release notesrelease notesrelease notes

  • Tool metadata is now preserved from tool output chunks.

    6.0.296, 7.0.120release notesrelease notes

  • Response streams are canceled when clients disconnect.

    5.0.268, 6.0.294, 7.0.119release notesrelease notesrelease notes

  • Static tool input errors are stored in the current input field.

    7.0.119release notes

  • Unhandled stream completion rejections are prevented in non-Node runtimes.

    7.0.119release notes

  • Original opaque URI strings are preserved in tagged file URLs during prompt conversion.

    7.0.116release notes

  • Google embedMany calls with more than 100 values now preserve multimodal alignment across automatic batches.

    7.0.113release notes

  • Content length is validated before Google embedding requests are sent.

    7.0.113release notes

  • Each automatic batch validates provider options after middleware transforms them.

    7.0.113release notes

  • Headerless audio formats are identified correctly.

    7.0.113release notes

  • Direct transport stream callbacks now preserve message history.

    7.0.113release notes

  • Empty speech transcripts are rejected before requests are sent.

    7.0.113release notes

  • Completed streamed tool input callbacks are routed to repaired tools.

    7.0.113release notes

  • Tool approvals can resume from earlier messages.

    6.0.290, 7.0.113release notesrelease notes

  • Manually approved tool inputs produced by schema transforms are executed while preserving approved inputs during revalidation.

    6.0.290, 7.0.113release notesrelease notes

  • Transformed UI tool inputs are validated against reconstructed output before returning them as static tool parts.

    7.0.113release notes

  • Video models are preserved when using legacy fallback providers.

    7.0.113release notes

  • Native WAV responses are preserved without adding a second header.

    7.0.113release notes

  • Opaque file URI strings are preserved during provider serialization.

    5.0.264, 6.0.289, 7.0.112release notesrelease notesrelease notes

  • UI message validation now preserves parsed metadata and data values.

    5.0.265, 6.0.290, 7.0.112release notesrelease notesrelease notes

  • Reasoning file parts are now pruned when reasoning is removed.

    7.0.112release notes

  • Cancellation is propagated to batch file downloads.

    7.0.111release notes

  • Reasoning extraction streams now preserve overlapping text blocks.

    7.0.109release notes

  • Replacement completion requests remain loading and cancellable when an earlier request settles.

    7.0.109release notes

  • Validated toolsContext is forwarded to host-executed tools in alignment with ToolLoopAgent.

    7.0.109release notes

  • Stops pending tool-call repairs when generation is cancelled.

    7.0.108release notes

  • Preserves file data when adapting v3 language models.

    7.0.108release notes

  • Base64 text data URLs are decoded using their declared charset.

    7.0.107release notes

  • Query parameters are preserved in chat reconnect URLs.

    7.0.107release notes

  • Chat transport requests no longer include duplicate content types.

    5.0.264, 6.0.289, 7.0.107release notesrelease notesrelease notes

  • Input callbacks receive tool-specific context.

    7.0.107release notes

  • Preliminary tool outputs no longer complete chats prematurely.

    6.0.289, 7.0.107release notesrelease notes

  • Raw speech audio format metadata is preserved.

    7.0.107release notes

  • Node stream responses preserve multiple Set-Cookie headers.

    7.0.107release notes

  • Polling timeouts are enforced for in-flight video status requests.

    7.0.107release notes

  • WorkflowAgent supports deferred tool discovery.

    7.0.107release notes

  • Provider file and skill upload APIs are preserved when using wrapProvider.

    7.0.107release notes

  • Input available callbacks are skipped for invalid streamed tool calls.

    7.0.106release notes

  • Null and empty-string JSON partial outputs are now streamed.

    6.0.286, 7.0.106release notesrelease notes

  • onEnd is no longer called after aborting a multi-step text stream.

    7.0.106release notes

  • Streamed step results now report the model selected by prepareStep.

    6.0.286, 7.0.106release notesrelease notes

  • Prompt attachment downloads are canceled when model calls are aborted or time out.

    6.0.286, 7.0.106release notesrelease notes

  • Provider metadata is preserved when simulating text streams.

    5.0.260, 6.0.286, 7.0.106release notesrelease notesrelease notes

  • Serialized tool outputs now preserve properties named after object prototypes.

    7.0.106release notes

  • Streamed JSON fences are stripped before arbitrary trailing whitespace.

    7.0.106release notes

  • Streamed response metadata fallbacks now use the model selected by prepareStep.

    7.0.106release notes

  • Structured output is streamed from the final tool-loop step.

    6.0.286, 7.0.106release notesrelease notes

  • Telemetry spans are closed when provider response streams fail.

    7.0.106release notes

  • Tool calls required by retained pending approvals are preserved.

    6.0.286, 7.0.106release notesrelease notes

  • Unhandled rejections are prevented when reading a UI message stream stops early.

    5.0.261, 6.0.286, 7.0.106release notesrelease notesrelease notes

  • Evaluation model IDs are resolved through AI Gateway when no default provider is configured, including string aliases in custom providers.

    7.0.105release notes

  • Abnormal realtime WebSocket close diagnostics are now reported through onError.

    7.0.104release notes

  • Oversized manual operations remain recoverable, while startup and automatic audio failures close the session.

    7.0.102release notes

  • Abnormal realtime WebSocket close codes and reasons are reported through the session error path.

    7.0.102release notes

  • Automatically denied tool calls in UI streams now settle instead of remaining unresolved.

    7.0.102release notes

  • Tool output JSON values are now serialized.

    7.0.101release notes

  • Invalid reranking provider indices are now rejected.

    6.0.284, 7.0.98release notesrelease notes

  • validateUIMessages now accepts inferred tools.

    7.0.98release notes

  • Receiver rejections are observed before generation starts, preventing unhandled rejections while preserving start error precedence.

    7.0.97release notes

  • Calls atob without a receiver for Cloudflare Workers compatibility.

    6.0.280, 7.0.96release notesrelease notes

  • Unclassified empty image results are retried.

    5.0.255, 6.0.280, 7.0.94release notesrelease notesrelease notes

  • Retry-attempt accounting is preserved during result retries.

    7.0.94release notes

  • Abort signals are supported when the global AbortSignal is not a constructor.

    7.0.93release notes

  • Embedding responses are rejected when their count does not match the input values.

    7.0.93release notes

  • Image call diagnostics are preserved when no image is generated.

    7.0.93release notes

  • Provider metadata is preserved when failed tool calls are converted.

    6.0.287, 7.0.93release notesrelease notes

  • Replacing a message in sendMessage now uses a new message ID.

    7.0.93release notes

  • Text data URLs are now decoded in Node.js.

    5.0.255, 6.0.279, 7.0.93release notesrelease notesrelease notes

  • onLanguageModelCallEnd is formally included in the ToolLoopAgentSettings type.

    7.0.93release notes

  • Tool part titles are preserved when UI messages are validated.

    7.0.93release notes

  • Fallback errors are surfaced when HTTP responses have empty bodies.

    7.0.92release notes

  • Skips smoothStream delays while the document is hidden.

    5.0.252, 6.0.276, 7.0.92release notesrelease notesrelease notes

  • Provider metadata stays on corresponding smoothStream chunks without carrying into later metadata-free deltas.

    5.0.269, 6.0.276, 7.0.92release notesrelease notesrelease notesrelease notes

  • onAbort callbacks now expose the call ID and abort reason.

    7.0.92release notes

  • generateText no longer accepts responses that violate required tool choices.

    7.0.88release notes

  • Approval descriptors are preserved in UI message streams.

    6.0.274, 7.0.87release notesrelease notes

  • Canonical hashes now preserve the positions of undefined elements in arrays.

    7.0.85release notes

  • Gateway now sums image-generation costs across split requests.

    7.0.85release notes

  • Anthropic provider metadata now preserves native message batch request counts.

    7.0.85release notes

  • Tool approval secrets are now allowed in prepareCall.

    7.0.84release notes

  • smoothStream now handles stateful and empty-match regular expressions.

    7.0.84release notes

  • Tool approval secrets are now allowed in ToolLoopAgent settings.

    7.0.84release notes

  • Stream cancellation is handled when it occurs before an inner stream is registered.

    6.0.270, 7.0.83release notesrelease notes

  • Persisted typed tool calls are validated against current schemas, with incompatible history loaded as dynamic tool parts.

    5.0.250, 6.0.271, 7.0.83release notesrelease notesrelease notes

  • Structured output is parsed when providers return text without a finishReason.

    7.0.79release notes

  • Active text and reasoning parts are preserved when another merged UI message stream finishes a step.

    7.0.79release notes

  • Continues approved generateText, streamText, and WorkflowAgent turns with a model-visible tool error when revalidated tool input is invalid.

    7.0.78release notes

  • Allows nullish metadata schemas for UI messages with branded IDs.

    7.0.76release notes

  • Prevents duplicate IDs for text and reasoning parts.

    6.0.264, 7.0.76release notesrelease notes

  • Exceptions in streaming onChunk and onError callbacks no longer terminate the stream or mask provider errors.

    7.0.71release notes

  • Multi-step text generation now stops for client tool approval when a provider-executed tool has a deferred result.

    7.0.70release notes

  • Result promises are rejected and failed completion is reported when the provider stream errors.

    5.0.241, 6.0.260, 7.0.70release notesrelease notesrelease notes

  • Partial UI message parts are cleared when a WorkflowAgent model-call step is retried.

    7.0.70release notes

  • Declaration emit now works for exported values that infer an Output type.

    5.0.237, 6.0.255, 7.0.66release notesrelease notesrelease notes

  • Streaming chunks are emitted through the callback, which now receives all stream text parts.

    7.0.0release notes

ai 6139 changes

Breaking changes 39

  • Failed tool call error text now matches the model's message history by default; set redactToolErrors to true to replace it with the result of onError.

    5.0.290, 6.0.331release notesrelease notes

  • Automatic chat resumption no longer occurs when completed tool output is followed by terminal text without completed stream state.

    5.0.270, 6.0.297release notesrelease notes

  • Inherited names no longer resolve as registered providers.

    6.0.297release notes

  • Rejects responses that do not satisfy a required or specifically selected tool choice.

    6.0.272release notes

  • Adds support for error results; chat.addToolResult() is renamed to chat.addToolOutput().

    6.0.0release notes

  • The Agent configuration property system is renamed to instructions.

    6.0.0release notes

  • MCP client functionality moves into the @ai-sdk/mcp package, which adds OAuth support.

    6.0.0release notes

  • Calling azure() now uses the Responses API by default; use azure.chat() for Chat Completions API behavior.

    6.0.0upgrade guide

  • Replaces chat.addToolResult() as the method for adding tool output.

    6.0.0release notes

  • The function has been removed; replace it with convertToModelMessages.

    6.0.0upgrade guide

  • The function is now async to support async Tool.toModelOutput(); callers need to await it.

    6.0.0upgrade guide

  • The deprecated CoreMessage type has been removed; use ModelMessage instead.

    6.0.0upgrade guide

  • Agent UI stream functions rename the messages property to uiMessages.

    6.0.0release notes

  • Renames createAgentStreamResponse to createAgentUIStreamResponse and supports UIMessageStreamOptions.

    6.0.0release notes

  • Generics have been removed from EmbeddingModel, embed, and embedMany.

    6.0.0upgrade guide

  • Renames the EmbeddingModelCallOptions type.

    6.0.0release notes

  • Adds EmbeddingModelV3 and changes the provider method from textEmbeddingModel to embeddingModel.

    6.0.0release notesupgrade guide

  • MCP client imports move from ai to @ai-sdk/mcp; MCP clients also gain OAuth support.

    6.0.0release notes

  • The static-tool-name helper is renamed to getStaticToolName; getToolName now handles static or dynamic tool parts.

    6.0.0upgrade guide

  • The ToolLoopAgent system parameter is renamed to instructions.

    6.0.0upgrade guide

  • The static-tool-part helper is renamed to isStaticToolUIPart; isToolUIPart now checks static or dynamic tool parts.

    6.0.0upgrade guide

  • The V2 mock class has been removed from ai/test; use MockLanguageModelV3.

    6.0.0upgrade guide

  • Provider options move to the main Agent configuration.

    6.0.0release notes

  • Azure Responses API metadata now uses the azure key instead of openai.

    6.0.0upgrade guide

  • Google Vertex metadata output now uses the vertex key instead of google.

    6.0.0upgrade guide

  • Renames relevanceScore to score.

    6.0.0release notes

  • OpenAI JSON outputs and tool calls now use strict schema mode by default; disable it if schema rejection errors occur.

    6.0.0upgrade guide

  • The option has been removed from OpenAI chat models; use strictJsonSchema instead.

    6.0.0upgrade guide

  • Provider method renamed to embeddingModel.

    6.0.0upgrade guide

  • Changes the argument toModelOutput receives to a parameter object.

    6.0.0release notes

  • Function tool definitions no longer accept name; the tool name comes from its key in the tools object.

    6.0.0upgrade guide

  • Strict mode is now configurable on each tool, allowing fine-grained control based on its input schema.

    6.0.0upgrade guide

  • The parameter is now an object with an output property rather than the output value itself.

    6.0.0upgrade guide

  • Renames ToolCallOptions to ToolExecutionOptions.

    6.0.0release notesupgrade guide

  • ToolLoopAgent replaces BasicAgent and gains support for experimental_download.

    6.0.0release notes

  • The default stopWhen changes from isStepCount(1) to isStepCount(20).

    6.0.0upgrade guide

  • Replaces Experimental_Agent as the agent class.

    6.0.0upgrade guide

  • The unknown finish reason is removed and is now returned as other.

    6.0.0upgrade guide

  • A single Warning type exported from ai replaces separate warning types for generation functions.

    6.0.0upgrade guide

Security 4

  • Telemetry recorded by generateText and streamText now redacts OpenAI MCP authorization and header values, plus Code Interpreter and shell domain-secret values, while preserving original application and provider arguments.

    6.0.328release notes

  • Provider metadata is hidden from telemetry when recordOutputs is false.

    5.0.286, 6.0.325release notesrelease notes

  • For toolChoice: 'none', the value is forwarded to the Hugging Face Responses API and tool calls are rejected before local execution; streamed tool parts are withheld and experimental_repairToolCall is not invoked for rejected calls.

    5.0.281, 6.0.314release notesrelease notes

  • Unavailable tools, including names matching Object.prototype properties, no longer expose persisted output to models.

    6.0.302release notes

Deprecations 7

New APIs and options 46

  • Streamed input is marked as text so UI clients can display it progressively without JSON parsing.

    6.0.308release notes

  • Exposes normalized response content for opt-in recovery from tool choice violations.

    6.0.272release notes

  • Allows tool approval secrets in ToolLoopAgent settings and prepareCall.

    6.0.272release notes

  • Agent generate and stream accept an abortSignal parameter.

    6.0.0release notes

  • Agent gains an onFinish callback.

    6.0.0release notes

  • Adds a version property to Agent.

    6.0.0release notes

  • Exports AgentCallParameters and AgentStreamParameters types.

    6.0.0release notes

  • Exports AgentStreamParameters for typing agent stream parameters.

    6.0.0release notes

  • The AI Gateway adds support for image models.

    6.0.0release notes

  • Adds a type-safe callback for converting custom data parts to text or file parts models can process.

    6.0.0release notes

  • Adds createAgentUIStream and pipeAgentUIStreamToResponse.

    6.0.0release notes

  • OpenAI provider-defined tools can use custom names.

    6.0.0release notes

  • Adds experimental_context to prepareStep and allows it to be modified there.

    6.0.0release notes

  • Adds experimental reranking support.

    6.0.0release notes

  • Agents support experimental stream transforms.

    6.0.0release notes

  • Adds extended token usage information.

    6.0.0release notes

  • Exposes usage tokens for generateImage.

    6.0.0release notes

  • Adds image editing capabilities.

    6.0.0release notes

  • Adds the v3 image model specification.

    6.0.0release notes

  • Adds the LanguageModelV3 specification for language model providers.

    6.0.0release notes

  • Adds an onFinish callback to generateText and passes context into text-generation finish callbacks.

    6.0.0release notes

  • Adds Output.array() as an output mode.

    6.0.0release notes

  • Adds Output.choice() as an output mode.

    6.0.0release notes

  • Adds Output.json() for structured output.

    6.0.0release notes

  • Exports parseJsonEventStream from the ai package.

    6.0.0release notes

  • Adds a helper to pipe an agent UI stream to a response.

    6.0.0release notes

  • Adds support for provider-executed dynamic tools.

    6.0.0release notes

  • Azure Responses API options now use the azure key; the openai key remains supported for input.

    6.0.0upgrade guide

  • Google Vertex options now use the vertex key; the google key remains supported for input.

    6.0.0upgrade guide

  • Adds a helper for pruning messages.

    6.0.0release notes

  • Exposes the raw finish reason.

    6.0.0release notes

  • Validates UI messages without throwing and returns a success or failure result.

    6.0.0release notes

  • Adds the v3 speech model specification.

    6.0.0release notes

  • Adds standard JSON Schema support.

    6.0.0release notes

  • Adds stable structured output support and exposes output on StreamTextResult.

    6.0.0release notes

  • Anthropic adds an option to select outputFormat, jsonTool, or auto mode for structured outputs; auto uses native output format when supported.

    6.0.0upgrade guide

  • system and instructions properties accept SystemModelMessage arrays.

    6.0.0release notes

  • Adds tool execution approval, including support for dynamic tools.

    6.0.0release notes

  • Adds tool input examples and middleware for them.

    6.0.0release notes

  • Adds strict mode configured per tool.

    6.0.0release notes

  • The state union adds approval-requested, approval-responded, and output-denied; exhaustive handling should cover them.

    6.0.0upgrade guide

  • Tool.needsApproval can now be a function.

    6.0.0release notes

  • The system parameter now accepts SystemModelMessage in addition to string.

    6.0.0upgrade guide

  • Exports uiMessageChunkSchema from ai and updates it to satisfy the UIMessageChunk type.

    6.0.0release notes

  • The useChat onFinish callback receives finishReason.

    6.0.0release notes

  • Introduces a helper for customizing embedding models, similar to wrapLanguageModel.

    6.0.0release notes

Performance 3

  • Validates JSON values in provider and tool metadata in a single pass without copying them, except to remove __proto__ keys, reducing memory and CPU usage for deeply nested metadata.

    6.0.333release notes

  • Validation checks each part against schemas for its type, stops at the first invalid message or part, and reports invalid JSON in provider or tool metadata as a single issue, reducing excessive memory and CPU usage.

    6.0.331release notes

  • Avoids repeatedly cloning accumulated text while preserving independent snapshots for mutable nested values.

    5.0.237, 6.0.255release notesrelease notes

Behavior and default changes 13

  • Google and Google Vertex content-filtered results are treated as terminal and are not retried.

    6.0.280release notes

  • Tool result handling supports error results.

    6.0.0release notes

  • Agent moves to stable.

    6.0.0release notes

  • Agent now defaults stopWhen to stepCountIs(20).

    6.0.0release notes

  • Context is passed to streamText and generateText onFinish callbacks.

    6.0.0release notes

  • Tool output and result content support is more flexible for richer interactions and complex tool execution patterns.

    6.0.0upgrade guide

  • Adds stable structured output support and a schema name and description for output.

    6.0.0release notes

  • Output.text() becomes the default output mode.

    6.0.0release notes

  • Model warnings are also printed by embed and embedMany.

    6.0.0release notes

  • Warnings include provider and model id, and are unified across provider and ai packages.

    6.0.0release notes

  • Structured output is stable on generateText, streamText, and ToolLoopAgent.

    6.0.0release notes

  • Tool.toModelOutput may be asynchronous and receives a toolCallId argument.

    6.0.0release notes

  • Adds stable structured output support.

    6.0.0release notes

Fixes and other changes 27

  • Preserves toolChoice: 'none' when SDK tools are omitted or empty, allowing providers to disable native tools configured through provider options. For Perplexity native tools, use @ai-sdk/perplexity 3.1.10 or later.

    5.0.286, 6.0.324release notesrelease notes

  • Prompt data validation and conversion now handle cross-realm Uint8Array and ArrayBuffer values.

    5.0.285, 6.0.322release notesrelease notes

  • Orphaned reasoning, including consecutive reasoning parts, is removed when pruning tool calls.

    6.0.313release notes

  • Buffered stream parts are no longer emitted after a streamText transform calls stopStream.

    5.0.279, 6.0.311release notesrelease notes

  • Final provider tool-call inputs remain JSON-encoded after streamed input uses text encoding.

    6.0.308release notes

  • Prevents global type conflicts when multiple SDK versions are used.

    5.0.274, 6.0.303release notesrelease notes

  • Hydrated partial static tool input is preserved across stream resumptions.

    5.0.270, 6.0.297release notesrelease notes

  • Custom URLs returned by prepareReconnectToStreamRequest remain unchanged.

    5.0.270, 6.0.297release notesrelease notes

  • Prototype-named tools are preserved as own properties without changing lookup object prototypes.

    6.0.297release notes

  • Agent UI streams can use original messages as input.

    6.0.296release notes

  • Preserves media types on tool result file URLs and matches full MIME types exactly when checking native URL support.

    6.0.293release notes

  • Google embedMany now keeps per-value multimodal content aligned across automatic batches and validates content and provider options.

    6.0.290release notes

  • Streamed tool input callbacks now await start and delta callbacks before onInputAvailable on newer Node.js versions.

    5.0.264, 6.0.289release notesrelease notes

  • Retry-attempt accounting is preserved during image-result retries.

    6.0.280release notes

  • Approved turns continue with a model-visible tool error when revalidated tool input is invalid.

    6.0.266release notes

  • Aborted, errored, or cancelled calls no longer retain per-call state through abort cleanup listeners.

    6.0.266release notes

  • Exceptions in streaming onChunk callbacks no longer terminate the stream or mask provider errors.

    5.0.243, 6.0.262release notesrelease notes

  • Exceptions in streaming onError callbacks no longer terminate the stream or mask provider errors.

    6.0.262release notes

  • A missing gateway API key produces a user-friendly error in non-production environments.

    6.0.0release notes

  • HttpChatTransport no longer drops custom headers, and header normalization preserves them.

    6.0.0release notes

  • Parses experimental_output only when finishReason is stop.

    6.0.0release notes

  • Updates the OpenAI specification for MCP approval.

    6.0.0release notes

  • The specification terminology changes from provider-defined tool to provider tool.

    6.0.0release notes

  • Preserves providerExecuted when tool input validation fails.

    6.0.0release notes

  • Preserves providerMetadata when tool input validation fails.

    6.0.0release notes

  • ProviderV3 adds specificationVersion and introduces the shared provider specification.

    6.0.0release notes

  • Adds support for v2 specifications and restores version support for V2 providers.

    6.0.0release notes

ai 580 changes

Breaking changes 35

  • Adds ToolChoiceViolationError for tool calls rejected before local execution when toolChoice is 'none'.

    5.0.281release notes

  • Prototype-named tools and providers are preserved as own properties, while inherited names no longer resolve as registered providers.

    5.0.270release notes

  • createTestServer and TestResponseController are no longer re-exported here; import them from @ai-sdk/test-server/with-vitest instead.

    5.0.245release notes

  • The default provider global was renamed to AI_SDK_DEFAULT_PROVIDER.

    5.0.0release notes

  • React Server Components functionality moved to a separate package.

    5.0.0release notes

  • UI messages are no longer automatically converted to model messages.

    5.0.0release notes

  • The data and allowEmptySubmit options were removed from ChatRequestOptions.

    5.0.0release notes

  • Replaces maxSteps as the stopping condition for generateText and streamText.

    5.0.0release notes

  • The options argument was removed along with the deprecated throwErrorForEmptyVectors option.

    5.0.0release notes

  • The data UIMessage role and UI message data property were removed.

    5.0.0release notes

  • The null option was removed.

    5.0.0release notes

  • The deprecated experimental_providerMetadata API was removed.

    5.0.0release notes

  • The deprecated experimental_wrapLanguageModel API was removed.

    5.0.0release notes

  • The getUIText helper was removed.

    5.0.0release notes

  • Tools use input and output in place of args and result.

    5.0.0release notes

  • Image model settings were removed; maxImagesPerCall is now passed directly to generateImage, and other image settings go in providerOptions.

    5.0.0release notes

  • maxTokens was renamed to maxOutputTokens.

    5.0.0release notes

  • CoreMessage was renamed to ModelMessage.

    5.0.0release notes

  • DataStreamOptions.getErrorMessage was renamed to onError.

    5.0.0release notes

  • The onResponse callback was removed.

    5.0.0release notes

  • Image settings other than maxImagesPerCall are now passed through providerOptions.

    5.0.0release notes

  • The reasoningDetails field was renamed to reasoning in streamText and generateText.

    5.0.0release notes

  • Reasoning is sent to the client by default.

    5.0.0release notes

  • experimental_resume was renamed to resumeStream.

    5.0.0release notes

  • The source UI message part is now named source-url.

    5.0.0release notes

  • The SDK no longer supplies a default for stopSequences, allowing middleware changes to take effect.

    5.0.0release notes

  • continueUntil was renamed to stopWhen, and the maxSteps stop condition was renamed to stepCountIs.

    5.0.0release notes

  • The onCompletion callback was removed from StreamCallbacks.

    5.0.0release notes

  • The mergeIntoDataStream method was removed.

    5.0.0release notes

  • The SDK no longer sets temperature to 0 or supplies a default temperature, allowing middleware changes to take effect.

    5.0.0release notes

  • Replaces Message as the UI message type.

    5.0.0release notes

  • UIMessageStreamPart was renamed to UIMessageChunk.

    5.0.0release notes

  • The useAssistant hook was removed.

    5.0.0release notes

  • Attachments in useChat were replaced with file UI parts.

    5.0.0release notes

  • The keepLastMessageOnError option was removed from useChat.

    5.0.0release notes

Security 2

  • For Perplexity native tools, use version 2.1.6 or a later compatible version to get the provider-side guard.

    5.0.286release notes

  • Deleted tools named after Object.prototype properties no longer expose persisted output to models.

    5.0.273release notes

New APIs and options 25

  • Exported isDynamicToolUIPart from the ai package, making it available for application code.

    5.0.272release notes

  • Adds an experimental Agent abstraction.

    5.0.0release notes

  • Adds Chat.clearError().

    5.0.0release notes

  • Supports replacing a chat message by passing messageId to sendMessage.

    5.0.0release notes

  • Introduces ChatStore and ChatTransport for chat state and transport handling.

    5.0.0release notes

  • HTTP chat transport supports resolvable headers, body, and credentials.

    5.0.0release notes

  • Adds a consumeSseStream option to UI message stream responses.

    5.0.0release notes

  • Adds a function for creating a text stream response.

    5.0.0release notes

  • Supports injecting a message ID when creating a UI message stream.

    5.0.0release notes

  • Adds support for dynamic tools, including tool calls and results.

    5.0.0release notes

  • Adds speech generation through experimental_generateSpeech.

    5.0.0release notes

  • Adds an experimental repairText function to streamObject.

    5.0.0release notes

  • Adds transcription generation through experimental_transcribe.

    5.0.0release notes

  • Adds GLOBAL_DEFAULT_PROVIDER for default provider setup.

    5.0.0release notes

  • Adds an option to convertToModelMessages for ignoring incomplete tool calls.

    5.0.0release notes

  • Adds an onAbort callback to streamText.

    5.0.0release notes

  • Adds a function for piping a text stream to a response.

    5.0.0release notes

  • Adds step preparation support, including modifying step input messages and changing the system prompt.

    5.0.0release notes

  • Adds support for tools executed by providers.

    5.0.0release notes

  • Adds a helper for reading UI message streams.

    5.0.0release notes

  • Adds sendAutomaticallyWhen to Chat.

    5.0.0release notes

  • Adds transcription support to the fal provider.

    5.0.0release notes

  • UI messages now support typed tool parts.

    5.0.0release notes

  • UI message APIs now use the UI_MESSAGE generic.

    5.0.0release notes

  • UI messages support metadata.

    5.0.0release notes

Performance 3

  • Validates provider metadata in a single pass without copying JSON values, reducing memory and CPU usage for deeply nested metadata.

    5.0.291release notes

  • Validates provider metadata in a single pass without copying JSON values, reducing memory and CPU usage for deeply nested metadata.

    5.0.291release notes

  • Validation now checks each part against schemas for its type, stops at the first invalid message or part, and reports invalid JSON in provider metadata as a single issue, preventing excessive memory and CPU use.

    5.0.290release notes

Behavior and default changes 9

  • Diagnostics from completed attempts are preserved, giving developers more information when retries occur.

    5.0.255release notes

  • Google Vertex RAI-filtered results are treated as terminal and are not retried.

    5.0.255release notes

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

    5.0.248release notes

  • Tool execution errors are handled automatically.

    5.0.0release notes

  • The experimental_useObject hook supports both Zod v4 and v3 schemas.

    5.0.0release notes

  • Retry logic respects reasonable retry-after-ms and retry-after rate limit headers instead of using exponential backoff.

    5.0.0release notes

  • Tool execute functions may be synchronous.

    5.0.0release notes

  • totalUsage includes usage across all steps, while usage reports a single step.

    5.0.0release notes

  • Generation, streaming, and UI object methods accept both Zod v4 and v3 schemas for validation.

    5.0.0release notes

Fixes and other changes 6

  • Pruning tool calls now removes orphaned reasoning, including consecutive summary parts.

    5.0.280release notes

  • Prototype-named provider metadata no longer causes image metadata aggregation to fail.

    5.0.270release notes

  • Result retryability classification is preserved through the AI Gateway.

    5.0.255release notes

  • Manual continuations can reuse JSON tool outputs containing undefined object properties.

    5.0.253release notes

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

    5.0.250release notes

  • Mocks now return configured results in order starting with the first call.

    5.0.242release notes

ai 433 changes

Breaking changes 32

  • The 2.x prompt helpers were removed.

    4.0.0release notes

  • AIStream and related exports were removed.

    4.0.0release notes

  • Experimental function exports from ai/core were removed.

    4.0.0release notes

  • The experimental_StreamData export was removed.

    4.0.0release notes

  • The ExperimentalTool export was removed.

    4.0.0release notes

  • ExperimentalXXXMessage types were removed.

    4.0.0release notes

  • The isXXXError methods were removed.

    4.0.0release notes

  • The type was removed; developers can no longer use it in type annotations.

    4.0.0release notes

  • Legacy function and tool calling support was removed.

    4.0.0release notes

  • Legacy providers and RSC render support were removed.

    4.0.0release notes

  • The nanoid export was removed.

    4.0.0release notes

  • The openai peer dependency was removed.

    4.0.0release notes

  • Deprecated provider registry exports were removed.

    4.0.0release notes

  • rawResponse was removed from generate and stream result objects.

    4.0.0release notes

  • The values parameter was renamed to chunks.

    4.0.0release notes

  • streamObject now returns its result immediately instead of returning a Promise.

    4.0.0release notes

  • The experimental_continuationSteps option was removed.

    4.0.0release notes

  • The init option was removed from streamText result methods.

    4.0.0release notes

  • responseMessage was removed from the streamText onFinish callback.

    4.0.0release notes

  • The responseMessages property was removed from streamText and generateText results.

    4.0.0release notes

  • Deprecated roundtrip settings were removed from streamText and generateText.

    4.0.0release notes

  • The warnings result is now a Promise.

    4.0.0release notes

  • ai-stream related methods were removed from streamText.

    4.0.0release notes

  • streamText now returns its result immediately instead of returning a Promise.

    4.0.0release notes

  • streamToResponse and streamingTextResponse were removed.

    4.0.0release notes

  • Deprecated telemetry data was removed.

    4.0.0release notes

  • The LangChain adapter toAIStream method was removed.

    4.0.0release notes

  • The toJSON method was removed from AI SDK errors.

    4.0.0release notes

  • The Tokens RSC helper was removed.

    4.0.0release notes

  • TokenUsage, CompletionTokenUsage, and EmbeddingTokenUsage types were removed.

    4.0.0release notes

  • The setInput helper was removed from useObject.

    4.0.0release notes

  • The vue, svelte, and solid re-exports and dependencies were removed.

    4.0.0release notes

Fixes and other changes 1

  • AssistantResponse was cleaned up; the notes do not specify the API details.

    4.0.0release notes