npm / @ai-sdk/openai
@ai-sdk/openai
What changed in @ai-sdk/openai 1 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.
69 breaking6 security17 deprecations137 new APIs and options1 performance39 behavior and defaults84 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/openai 752 changes
Breaking changes 28
The package is ESM-only; consumers using require() must switch to ESM import syntax.
OpenTelemetry span collection moved out of the ai package; install this package and register an OpenTelemetry instance globally to receive traces.
Top-level content, tool-call and result, file, source, and warning properties on generateText and streamText results now accumulate values across every step; use finalStep for previous final-step-only behavior.
Replaces experimental_context in tool callbacks and is now tool-specific, typed from contextSchema, and supplied through toolsContext keyed by tool name.
The deprecated option has been removed; replace remaining usages with activeTools.
The tracer property is removed from experimental_telemetry; pass a custom tracer to the OpenTelemetry constructor instead.
Move the deprecated top-level streamText includeRawChunks option to include.rawChunks.
Request bodies are no longer included in generateText and streamText step results by default; opt in with include.requestBody to read them.
generateText no longer includes response bodies by default; opt in with include.responseBody to read them.
The deprecated function has been removed; replace remaining usages with isToolUIPart.
The deprecated top-level cachedInputTokens field is removed; use inputTokenDetails.cacheReadTokens instead.
The deprecated top-level reasoningTokens field is removed; use outputTokenDetails.reasoningTokens instead.
The redirect option for HTTP and SSE transports now defaults to error rather than follow, rejecting redirects by default to prevent SSRF; set it to follow if redirects are required.
The deprecated tool-result content part type has been removed. Use the file content shape for inline tool-result file content, including images.
The minimum supported Node.js version is raised to 22; supported versions are 22, 24, and 26.
streamText now calls onChunk for every TextStreamPart, including lifecycle, boundary, and terminal parts; handlers should guard the chunk types they process.
Replaces onEmbedFinish in telemetry integrations and tracing-channel events for individual embedding model calls.
Replaces experimental_onFinish as the per-call completion callback for embed and embedMany operations.
Replaces experimental_onFinish as the per-call completion callback for rerank operations.
Replaces onRerankFinish in telemetry integrations and tracing-channel events for individual reranking model calls.
Replaces onStepFinish as the per-step lifecycle callback across text and object generation, agents, and UI message stream helpers; telemetry integrations should implement onStepEnd.
When reasoning or reasoningEffort is set to a value other than 'none', reasoningSummary now defaults to 'detailed'. Set it to null to keep summaries disabled.
The codemod updates named imports and direct re-exports to new Google API names while preserving local bindings and application export names as aliases; namespace member access remains unchanged.
Shared generation or agent runtime data now flows through runtimeContext, separate from tool-specific context supplied through toolsContext.
Each StepResult now contains only messages produced by that step; use result.responseMessages for the full response message history.
The deprecated type has been removed; replace remaining imports and references with ToolExecutionOptions.
Supply tool-specific context values through toolsContext under the matching tool name; tools declare their fields with contextSchema.
generateText and streamText result usage now reports token usage across all steps; use finalStep.usage for final-step-only usage.
Deprecations 13
The @ai-sdk/vue Chat class is deprecated in favor of the useChat composable, which exposes reactive refs and recreates the underlying chat when its init object changes.
Tool result content should use the canonical file variant with tagged data and mediaType instead of image-* and legacy file-* variants; legacy outputs are runtime-migrated.
Final-step reasoning, request, response, and provider metadata properties are accessed through finalStep; deprecated top-level aliases continue to work in AI SDK 7.
The user-message image content part is deprecated; use a file part with an image mediaType instead.
The needsApproval property on tool() and dynamicTool() is deprecated; move approval logic to toolApproval on the call or agent to keep policy configurable per request.
Replaces onFinish as the final lifecycle callback for generateText, streamText, and agents; onFinish remains a deprecated alias, and onEnd takes precedence when both are provided.
The streamText result method is deprecated; use the top-level stateless helper with a text stream.
The streamText result method is deprecated; use the top-level stateless helper with a UI message stream.
Replaces StreamTextResult.fullStream as the full event stream returned by streamText; fullStream remains a deprecated alias.
totalUsage is deprecated; use usage, which now contains token usage across all steps.
The streamText result method is deprecated; use the top-level stateless toTextStream and createTextStreamResponse helpers.
The streamText result method is deprecated; use the stateless top-level helper, which can transform any stream rather than only a streamText result.
The streamText result method is deprecated; use the top-level stateless stream helpers and createUIMessageStreamResponse.
New APIs and options 3
Declare a tool's context fields with contextSchema so tool callback context is inferred and limited to the declared fields.
Models can return files in reasoning traces as reasoning-file parts, distinct from regular output files; update exhaustive part handling accordingly.
Register a telemetry integration globally at application startup to enable telemetry collection.
Behavior and default changes 8
mediaType accepts a full IANA type or a top-level segment; when only a segment is provided, the subtype is auto-detected from inline bytes where possible.
Replaces experimental_include as the stable option for generateText, streamText, and ToolLoopAgent; the old name remains a deprecated alias.
The onEnd callback follows the result changes: usage and content-related properties cover all steps, while final-step-only properties are available on finalStep.
Replaces experimental_onToolCallFinish as the tool execution end callback for generateText and streamText; the old name remains a deprecated alias.
Replaces experimental_onToolCallStart as the tool execution start callback for generateText and streamText; the old name remains a deprecated alias.
The top-level reasoning option is the provider-agnostic way to control reasoning effort; overlapping providerOptions settings take precedence and can bypass it.
Once a telemetry integration is registered, AI SDK calls emit telemetry events by default; set isEnabled: false to opt out for a call.
Replaces experimental_telemetry as the stable telemetry configuration option; the old name remains a deprecated alias during the migration window.
@ai-sdk/openai 62 changes
Breaking changes 2
Strict JSON is enabled by default.
The provider option has been removed from chat models; use
strictJsonSchemainstead.
@ai-sdk/openai 4212 changes
Breaking changes 29
The Responses provider derives tool definitions from tools registered in the call, drops unregistered entries with a warning, and loads only registered tools named by a namespace entry.
Chat Completions refusal text is emitted as text content in generateText and streamText, including alongside any content; refusals with a stop finish reason are reported as content-filter.
The experimental OpenAI Live method can now resolve asynchronously; await its result before using the connection settings.
The max reasoning effort is now sent only on the Responses API.
Rejects non-streaming transcription because the model has no REST endpoint.
Transcription requests send response_format=verbose_json and segment timestamp granularity only when the caller sets them or the model needs them.
Affected error paths that previously reported other as the finish reason now report error.
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.
The
baseUrloption has been removed from all providers; usebaseURLinstead.File part data is tagged with a type, and the image part type is removed.
The OpenAI facade has been removed; use the
openaiobject orcreateOpenAIfunction instead.customTool() no longer accepts a name field; the tool name is derived from its key in the tools object.
Security 6
Azure image downloads are kept separate from provider authentication wrappers so file hosts do not receive Azure bearer tokens.
Adds a fetch option so downloads can use a configured transport, including guarded-fetch for opt-in DNS validation on Node.js.
Vertex tool-result downloads are kept separate from provider authentication wrappers so file hosts do not receive Vertex Express Mode API keys.
Add Secure MCP tunnel support through tunnelId; tunnel targets cannot be combined with serverUrl or connectorId.
Denied programmatic tool calls are now rejected.
Blank and dot-segment file IDs are rejected or encoded to prevent request-path retargeting.
Deprecations 3
The webSearchPreview() tool is deprecated.
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 87
Adds support for the GPT-6.2 Astra model.
Adds support for the GPT-6.2 Sol model.
Adds experimental extraction models backed by structured language model output.
Adds positioned additionalTools and accepts custom and namespace tools.
Exposes prompt cache comparison diagnostics for generation, streaming, and batch results.
Expose customTool through azure.tools for Azure Responses models, sharing the OpenAI custom tool factory and its raw string input support.
Expose shell for local and hosted shell execution through the Azure Responses API.
Add the memoryLimit property to the codeInterpreter tool.
Add the networkPolicy property to the codeInterpreter tool.
Support complexity for GPT Image 2.6 models.
Support markup-guided edits for GPT Image 2.6 models.
Return the upstream realtime WebSocket URL and header authentication derived from configured credentials for conversation and transcription intents.
Support animated GIF output for GPT Image 2.6 models, with frameCount and frameDurationMs.
Support safetyIdentifier for image models.
Expose optional transcription word timings separately from segments.
Provider API key settings now accept promises and synchronous or asynchronous callbacks, resolving credentials per authenticated request while preserving existing authentication behavior and synchronous credential serialization.
Provider token settings now accept promises and synchronous or asynchronous callbacks, resolving credentials per authenticated request while preserving existing authentication behavior and synchronous credential serialization.
Adds support for the GPT-6.1 Terra model.
Responses function tools now support Azure provider options.
Adds azure.tools.toolSearch.
Adds support for 12h prompt cache writes and cache prewarming.
Decision calls accept maxOutputTokens and reasoning and forward them to language-model-backed decisions; omitted reasoning stays disabled for language-model adapters, and native providers warn when either setting is unsupported.
Adds decisions API support for Perplexity.
Azure OpenAI language-model factories accept an optional modelId for accurate telemetry and capability detection with custom deployment names, while keeping the deployment ID for API routing.
Tool results can provide ordered additional_tools.
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.
An allowedTools provider option is available for OpenAI Responses.
The gpt-5.3-chat-latest model is added.
GPT-5.4 model support is added.
The gpt-5.4-mini model and dated variant are added.
The gpt-5.4-nano model and dated variant are added.
GPT-5.5 chat model IDs are added.
Support for the gpt-image-2 model is added.
Realtime session configuration can request transcribed user audio messages when the provider supports it.
Experimental realtime support enables speech-to-speech conversations, including an OpenAI realtime provider and a static getToken() method for server-side ephemeral token creation.
Tool definitions support namespaces.
Orchestration token usage details are added to Responses API usage.
Provider references are supported, including uploading files as supported per provider.
A top-level reasoning parameter is added to the spec and supported in generateText and streamText.
Server side compaction for OpenAI is added.
A new tool search tool is added.
An opt-in pass-through is added for unsupported file media types.
A provider instance can be passed to uploadFile as shorthand.
Provider skills can be uploaded using the provider references abstraction.
A provider instance can be passed to uploadSkill as shorthand.
Performance 1
Provider validation schemas are constructed on first use to reduce package import time.
Behavior and default changes 19
Known model ID suggestions are derived from provider model catalog declarations, so catalog updates automatically update autocomplete while preserving existing suggestions, endpoint-specific lists, and support for custom model IDs.
The function returned by createDownload can be passed to generateText and streamText, and the hook now handles generated file URLs as well as other core downloads.
Changing structured output schemas can preserve earlier reasoning and prompt cache reuse.
Adds a stable request-level text format override.
Report the actual OpenAI Chat HTTP endpoint through optional request metadata, model-call end events, OpenTelemetry chat spans, generation results, and callbacks; expose only sanitized origins where applicable.
Accept shared timestampGranularities; explicit provider timing settings take precedence, and OpenAI sends timestamp_granularities only with verbose_json.
Native JSON input and prompt cache keys are sent to Decisions.
OpenAI streams that end cleanly without a provider completion signal now report interrupted and preserve partial output without emitting an error solely for the interruption.
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.
imageDetail providerOptions are forwarded on tool-result image content.
Reasoning summaries now default to detailed when reasoning effort is enabled.
Queries from web_search_call.action.queries are forwarded from the Responses API.
Fixes and other changes 67
Input transformations are returned in responses provider metadata.
Keeps tool-result additionalTools working for parallel results and OpenAI options.
Custom download requests receive the call's abort signal, preserving cancellation and timeouts for prompt assets and generated files.
Refusal logprobs are included after content logprobs in emission order for generateText and streamText.
streamText now collects logprobs across all chunks, reporting every streamed token rather than only the last chunk's tokens.
Responses API refusal content parts and stream events are parsed; refusal explanations become text and the finish reason is content-filter, except when a client-side function call keeps it tool-calls.
Forward the moderation option to /images/edits.
Forward per-message names on Chat Completions system, developer, user, and assistant messages; validate names as strings and warn for unsupported tool messages.
Serialize dedicated transcription sessions with session.type set to transcription and the selected realtime model id; reject unsupported output settings and translation.
Populate normalized usage on response-done and input-transcription-completed events, including gross token counts, cached portions, and duration-billed transcription.
Transcription hints are forwarded as repeated multipart fields instead of being silently dropped; REST-only options supplied to streaming transcription trigger a warning.
Preserves valid JSON string tool arguments and serializes BigInt and cycles in tool calls and results, while retaining malformed argument replay fallbacks.
OpenAI no longer drops provider-specific reasoning effort values that are not in its list for the model.
Top-level reasoning maps to efforts supported by GPT-5.x models instead of sending unsupported values; GPT-5.6 Chat Completions uses reasoning_effort: 'none' with function tools and warns when a reasoning level was requested.
Falls back to usage.seconds for duration-billed json responses when the response has no top-level duration.
Schemas with propertyNames that omit type: 'string' are stripped instead of triggering an unsupported functionality error.
Supports streaming transcription with gpt-live-transcribe and gpt-transcribe; for these models, the language provider option is sent as a single-entry languages list.
gpt-transcribe warns about and omits streaming.delay because the model does not support it.
Unfinished web searches are reported as tool errors.
Fixes string interpolation in OpenAI and OpenAI-compatible completion errors for unexpected system messages.
Fixes string interpolation in Amazon Bedrock unsupported provider tool warnings.
Fixes non-streaming structured output when multiple assistant messages contain JSON, selecting the last final_answer while preserving generated content, annotations, conversation history, and token usage.
Provider-returned identifiers are encoded in credentialed follow-up request paths.
The shell_call max_output_length value is forwarded to the shell tool and round-tripped.
The shell_call timeout_ms value is forwarded to the shell tool.
Transcription responses preserve detected language codes.
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.
Client-executed tool calls are sent as full function_call items in the Responses API so they pair with their function_call_output by call_id.
Tool result output content file part types are aligned with top-level message file part types.
File-URL parts are supported in tool output content.
The namespace is preserved on function_call output items.
The namespace is read from providerOptions.openai.namespace or providerMetadata.openai.namespace and included when serializing function_call input items.
Reasoning items are skipped when using a previous response id.
Streaming tool calls are finalized only after the stream is fully consumed, preventing execution with incomplete arguments when partial JSON is parsable.
Tool-only assistant messages send content: null instead of an empty string.
Provider models can cross workflow step boundaries without serialization errors; provider config headers are optional.
@ai-sdk/openai 363 changes
Breaking changes 4
OpenAI-compatible Chat Completions providers now return refusal text after content and report non-empty refusals with a stop finish reason as content-filter; non-string refusals are ignored.
Use embeddingModel instead of textEmbeddingModel to select an embedding model.
Reasoning model detection changes from a blocklist to an allowlist and adds an override option.
Support code for the unsupported o1-mini and o1-preview models is removed.
Deprecations 1
textEmbeddingModel is deprecated in favor of embeddingModel.
New APIs and options 36
Responses now supports contextManagement and compaction items.
Prompt cache comparison diagnostics are exposed for generation and streaming results.
Image models now support the frameCount option for animated GIF output.
Image models now support the frameDurationMs option for animated GIF output.
GPT Image 2.6 models are now supported by the OpenAI provider.
Image models can now produce animated GIF output with outputFormat set to 'gif'.
Adds support for 12h prompt cache writes.
Adds support for cache prewarming.
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.
A provider-defined apply_patch tool is available, with streaming support for partial diffs.
Azure supports image_generation, code_interpreter, and file_search capabilities through the Responses API.
The provider supports the OpenAI conversations API.
Additional settings are available for the file search tool.
The gpt-5-codex model ID is supported.
The gpt-5.1 model ID is supported.
GPT-5.1 Codex Max is added to the OpenAI Responses model IDs list.
GPT-5.2 models are supported.
The gpt-image-1-mini, gpt-5-pro, and gpt-5-pro-2025-10-06 model IDs are supported.
The gpt-image-1.5 model is supported.
Image editing is supported.
Image generation results can be previewed.
A local shell tool is available.
An OpenAI provider MCP tool is available.
The o3-deep-research and o4-mini-deep-research models are supported.
The provider supports the OPENAI_BASE_URL environment variable for configuring its base URL.
The OpenAIChatLanguageModelOptions type is exported for typing OpenAI chat provider options.
The gpt5.1 series supports promptCacheRetention set to 24h.
Provider-defined tools can be given custom names.
The raw finish reason is exposed.
OpenAI supports the xhigh reasoning effort setting.
default is now supported as a service tier.
Tool execution approval is supported.
Tool output content supports flexible content forms.
The Responses API supports the truncation parameter.
The web_search tool supports the external_web_access parameter.
Behavior and default changes 9
Complete parallel-tool wrapper input is no longer repeated in every expanded tool call's metadata; wrapper reconstruction for follow-up Responses API requests is preserved.
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.
Azure OpenAI supports web-search-preview.
Built-in Code Interpreter tool input code is streamed in tool-input start, delta, and end chunks.
OpenAI provider tools support file and image results.
Image generation responses include more metadata.
When store is true, assistant text and tool call parts are sent as reference IDs.
When store is false, reasoning.encrypted_content is automatically included.
Web-search actions include sources.
Fixes and other changes 13
Logprobs now include refusal logprobs and collect tokens across all streamed chunks, rather than reporting only the last chunk's logprobs.
Forwards the keywords transcription hint as a repeated multipart field instead of silently dropping it.
Reads durationInSeconds from usage.seconds when a duration-billed response has no top-level duration.
Requests with OpenAI provider options use response_format: 'json' for gpt-transcribe and dated gpt-4o-mini-transcribe snapshots, which reject verbose_json.
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.
Responses API providerMetadata distinguishes between OpenAI and Azure.
GPT-5.1 and GPT-5.2 support temperature and related non-reasoning parameters when reasoningEffort is none.
@ai-sdk/openai 223 changes
Breaking changes 5
Requests with OpenAI provider options use response_format: 'json' for gpt-transcribe and dated gpt-4o-mini-transcribe snapshots, which reject verbose_json.
File search gains filters and updated field names.
Legacy function calling is removed.
OpenAI provider settings move to providerOptions.
The OpenAI provider switches its default to the Responses API.
New APIs and options 11
OpenAI Responses models now support asynchronous function tool calling.
The Responses API gains support for encrypted_reasoning.
Speech generation is available through experimental_generateSpeech.
Transcription is available through experimental_transcribe.
The include parameter can request file_search_call.results.
The provider adds GPT-4.1 models.
The provider adds support for gpt-4o-search-preview and handles unsupported parameters.
The provider adds support for gpt-image-1 image generation.
The provider adds o3 and o4-mini models.
The provider adds support for reasoning summaries in the Responses API.
The provider adds service tier support for priority and flex processing.
Behavior and default changes 3
OpenAI image generation returns revised prompts in providerMetadata.
Strict mode defaults to false for the OpenAI provider.
Structured outputs are enabled by default and switched to a provider option.
Fixes and other changes 4
Transcription hints are forwarded as repeated multipart fields instead of being silently dropped.
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.
Log probabilities are exposed as providerMetadata.
@ai-sdk/openai 11 changes
Breaking changes 1
The baseUrl option was removed.