npm / @ai-sdk/openai
@ai-sdk/openai
What changed in @ai-sdk/openai 2 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
18 breaking2 security2 deprecations46 new APIs and options9 behavior and defaults41 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/openai 4105 changes
Breaking changes 18
Failed and incomplete web searches now become tool errors instead of successful tool results in Responses API calls and batch results.
Arrays passed directly as state are interpreted as decision state parts; JSON arrays must be wrapped in an object or JSON part.
Tool error payloads in OpenAI Chat Completions and Responses are now wrapped in an error object.
Google tool errors and denied executions are now sent under functionResponse.response.error.
Uses the native Decisions API; only gpt-6-luna is supported, so other Responses models no longer work.
The deprecated alias now uses the native Decisions API and no longer works with Responses models other than gpt-6-luna.
A refusal for an individual question now causes the decision call to fail.
Adds a portable max reasoning level, widening the reasoning type and requiring exhaustive consumers to handle max.
Responses API options such as reasoningEffort are no longer applied and produce unsupported-option warnings.
The evaluate API was renamed to decide.
Marks Together AI Gemini image inputs unsupported by the current single-image request mapping.
OpenAI Responses function tools now default to strict: false when tool strict mode is omitted.
Responses delegation and Live session updates are rejected before sending.
Unsupported batch request types are now rejected.
propertyNames is removed from JSON Schema generated for OpenAI.
Adds reasoning configuration updates for GPT-6 models.
Unsupported tools are dropped with a warning, and an error is thrown if that leaves allowedTools empty instead of sending an unrestricted request.
Ambiguous or unknown tool names are now warned about or dropped, with declared tools taking precedence over provider tool names.
Security 2
Denied programmatic tool calls are now rejected.
Blank and dot-segment file IDs are rejected or encoded to prevent request-path retargeting.
Deprecations 2
A warning is emitted when reasoningSummary is used with chat models.
Direct OpenAI batch providers return an unsupported warning when webhookUrl is provided.
New APIs and options 43
Decision state now supports ordered text, file, and JSON parts.
OpenAI Decisions and language model adapters now support image input.
The Decisions API supports the OpenAI safetyIdentifier provider option.
Adds telemetry to speech generation and transcription, with provider usage propagation and experimental streaming lifecycle callbacks.
Adds GPT-6.1 Sol model support for developers using the OpenAI provider.
Adds capability declarations for Together AI FLUX.2 Pro and Flex single-image editing with masks.
Supports the 'none' reasoning effort for GPT-6 Sol and Luna in request-level options and positioned system messages.
Applications can change reasoning effort during a conversation while preserving the prompt prefix for caching.
GPT-6 Sol and Luna model IDs are now available for use.
Adds experimental Choice, Score, and Boolean evaluations with preserved labels and metadata, score-bound validation, and Boolean P(true) estimates constrained to [0, 1].
An OpenAI-specific api override is available for early-access models.
Applications exchange SDP through an application endpoint for browser-direct Live sessions.
Live sessions expose cumulative voice usage information.
Live sessions support microphone mute controls.
Adds experimental OpenAI Live provider support through a unified factory for server WebSocket sessions with client delegation.
Realtime v4 supports per-connection raw-event parsers.
Realtime v4 adds optional server WebSocket configuration for server adapters.
Experimental browser-direct WebRTC is available for client-delegated Live conversations alongside WebSocket sessions.
Image generation requests are now supported in batches.
Providers can now disable web search source includes.
Adds support for cancelling batches.
Adds support for listing batches.
Adds GPT Image 2.5 Flare and Sunburst model IDs for use with the OpenAI provider.
Adds max quality support for GPT Image 2.5 Flare and Sunburst across image generation, image editing, and the Responses API image generation tool.
Adds xhigh quality support for GPT Image 2.5 Flare and Sunburst across image generation, image editing, and the Responses API image generation tool.
Async tool calling is now supported.
Batch requests can now specify models per request.
Adds support for transcription with chunking and diarized speaker metadata.
Adds support for the gpt-6-astra model.
Adds support for the ultrafast service tier, allowing developers to use that service tier with the OpenAI provider.
OpenAI and xAI batch input file uploads now accept an input file expiration provider option.
Batch start results now expose the uploaded input file ID and its expiration metadata.
Adds deleteFile to the OpenAI files interface.
Adds streaming downloadFile support to the OpenAI files interface.
All file operations now accept and propagate abortSignal.
All file operations now accept and propagate headers.
File uploads support streaming data through the { type: 'stream' } form.
Adds getFileMetadata to the OpenAI files interface.
Upload results now expose byteSize.
Upload results now expose createdAt.
Upload results now expose expiresAt.
Batch operations now support tool calling.
Adds support for explicitly triggering compaction in Responses.
Behavior and default changes 8
Streamed custom-tool input is marked as text for progressive display, encoding is preserved across saved and resumed UI messages, while final tool-call inputs remain JSON-encoded.
Complete web-search URLs and file-search documents are exposed as sources, including citation-derived sources when retrieval data is unavailable.
Top-level embedding dimensions are mapped to provider settings.
Image detail is sent in decisions.
Decision refusals are now reported as refusal answers.
Asynchronous capability lookups and middleware overrides can now resolve to unknown.
Known Live model IDs are routed to Live, while unknown IDs retain legacy Realtime defaults.
Azure AI Foundry Responses requests now include explicit message item types.
Fixes and other changes 32
Assistant text parts are sent as item references only when preceded by reasoning, preventing follow-up request failures after reasoning is pruned.
Custom tool input deltas are JSON-encoded for progressive UI updates.
Web search results are replayed when response storage is disabled.
Sampling parameters are preserved for GPT-6 Sol and Luna when reasoning is disabled, including reasoning effort updates in Responses requests.
Avoids duplicate references for stored messages containing multiple text parts.
JSONL rows are limited to 64 MB during batch result downloads.
Recursive Zod schemas using allOf wrappers are rewritten correctly.
Uses a standards-compliant User-Agent header.
Capability declarations now use confirmed model IDs, keeping unrecognized model names unknown.
Advertises file-input support for QuiverAI Arrow 2 and Arrow 2 Telos image models.
Fixes streamed tool calls when IDs are missing, blank, or repeated.
Unsupported efforts are validated per model, with request-level updates warned and omitted and historical updates rejected.
Responses stream errors with null codes are classified correctly.
Chat Completions audio transcripts are now exposed as generated text.
Unsupported regex patterns are stripped from JSON schemas.
Speech provider options are now included in requests.
Image edit URL downloads are canceled when the request is aborted, preventing unnecessary continued downloads.
Responses tool results now preserve provider file references.
Assistant text is now sent as Responses easy input messages.
Realtime client event IDs are preserved for session updates and audio appends, enabling correlated server errors.
Returns an AI SDK error when chat completion choices are empty.
Apply patch responses now report a tool-calls finish reason.
Adds support for documented Responses image generation options.
Responses API raw usage objects now preserve their complete contents.
Responses now handle null usage values correctly.
Fixes workflow deserialization for OpenAI Responses models.
Explicit prompt cache breakpoints are preserved on scalar Responses tool results.
Fixes Responses history serialization for regular functions named tool_search.
Non-object replayed Chat Completions tool arguments are normalized to empty objects.
Internal parallel tool call wrappers from the Responses API are expanded while preserving stateful continuation and streaming fallbacks.
Tool call IDs that are empty strings are now handled correctly.
Responses allowedTools now supports built-in and provider-defined tools by deriving entries from each declared tool.
@ai-sdk/openai 310 changes
New APIs and options 2
Image generation, editing, and the Responses API image generation tool now support xhigh and max quality for GPT Image 2.5 Flare and Sunburst.
Added GPT-6 reasoning configuration updates for OpenAI integrations.
Behavior and default changes 1
Streamed input is marked with inputEncoding: 'text' for progressive UI display without JSON parsing, and the encoding persists when partial UI messages are saved and resumed.
Fixes and other changes 7
Assistant text is sent with content when reasoning was removed, preventing follow-up request failures after reasoning is pruned.
Preserves streamed tool calls when IDs and indices are unreliable.
Early stream errors now preserve retryability.
Incomplete function-call and custom-tool-call items now finish with length instead of causing a TypeValidationError.
Mid-stream Responses error events are flattened for more consistent error handling.
Schema-invalid known Responses stream events are signaled, and the error finish reason is preserved.
Prevents negative text output token counts by treating Perplexity reasoning tokens separately from completion tokens.
@ai-sdk/openai 23 changes
New APIs and options 1
OpenAI Responses models now support asynchronous function tool calling.
Fixes and other changes 2
Follow-up requests no longer fail when reasoning is pruned; assistant text and function calls are sent with content unless preceded by reasoning.
Web search results, including tools with custom names, are replayed when response storage is disabled.