@ai-sdk/openai
4.0.108 · 3 Nov 2026Apache-2.022M / weekRepositoryHomepagenpmAtom feed
523 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
4.0.57
2 Sep 2026batch: Surface the uploaded input file on the batch start result (
providerMetadata.<provider>.inputFileId/inputFileExpiresAt) and accept aninputFileExpiresAfterprovider option on the OpenAI and xAI batch input file uploadopenai: Preserve complete Responses API raw usage objects
4.0.56
2 Sep 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.36
4.0.55
1 Sep 2026openai: Implement
getFileMetadata,downloadFile(streaming), anddeleteFileon the OpenAI files interface, support streaming uploads via{ type: 'stream' }data, exposebyteSize/createdAt/expiresAton upload results, and threadabortSignal/headersthrough all file operations; blank and dot-segment file ids are rejected/encoded so they cannot retarget request paths
Patch Changes
openai: Implement
getFileMetadata,downloadFile(streaming), anddeleteFileon the OpenAI files interface, support streaming uploads via{ type: 'stream' }data, exposebyteSize/createdAt/expiresAton upload results, and threadabortSignal/headersthrough all file operations; blank and dot-segment file ids are rejected/encoded so they cannot retarget request paths
4.0.54
1 Sep 2026openai: Handle null usage in responses
Add tool calling support to batch
4.0.53
31 Aug 2026Fix workflow deserialization for OpenAI Responses models.
4.0.52
30 Aug 2026Preserve explicit prompt cache breakpoints on scalar Responses tool results.
Patch Changes
Preserve explicit prompt cache breakpoints on scalar Responses tool results.
4.0.51
28 Aug 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.33
4.0.50
26 Aug 2026Fix Responses history serialization for regular functions named
tool_search.
4.0.49
26 Aug 2026Normalize non-object replayed Chat Completions tool arguments to empty objects.
Patch Changes
Normalize non-object replayed Chat Completions tool arguments to empty objects.
4.0.47
25 Aug 2026Add batch completion webhooks.
experimental_startTextBatchaccepts awebhookUrl, and the gateway provider registers it through the batchcallbackUrlcontract and exports typed async-job metadata. Direct Anthropic and OpenAI batch providers return an unsupported warning when the option is provided.Prevent negative text output token counts when providers report reasoning tokens. Perplexity reasoning tokens are now treated as separate from completion tokens.
Patch Changes
Add batch completion webhooks.
experimental_startTextBatchaccepts awebhookUrl, and the gateway provider registers it through the batchcallbackUrlcontract and exports typed async-job metadata. Direct Anthropic and OpenAI batch providers return an unsupported warning when the option is provided.Prevent negative text output token counts when providers report reasoning tokens. Perplexity reasoning tokens are now treated as separate from completion tokens.
4.0.46
22 Aug 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.29
4.0.45
20 Aug 2026openai: Expand internal parallel tool call wrappers from the Responses API while preserving stateful continuation and streaming fallbacks
4.0.44
19 Aug 2026Handle empty string tool call IDs
Patch Changes
Handle empty string tool call IDs
4.0.43
18 Aug 2026openai: Support built-in and provider-defined tools in the Responses
allowedToolsoptionallowedToolsemitted every allow-list entry as{ type: 'function', name }, but OpenAI identifies built-in tools by type. Allow-listing a declared provider-defined tool (web search, image generation, MCP, custom, ...) therefore failed withTool choice '<name>' not found in 'tools' parameter. Entries are now derived from the declared tool, including the MCP server label and custom tool name.Tools that OpenAI cannot allow-list (the tool search tool, deferred tools, and namespaced tools) are dropped from the allow-list with a warning, and an error is thrown if that would leave the allow-list empty rather than silently sending an unrestricted request.
Ambiguous names are now reported instead of resolved silently. A name that matches both a declared tool and another tool's provider tool name resolves to the declared tool and warns; a provider tool name shared by several tools in the same request (two MCP servers, for example) is dropped with a warning. A name that matches no declared tool keeps its existing behavior and is now warned about.
4.0.42
14 Aug 2026provider/openai: Support explicit Responses compaction triggers
4.0.41
12 Aug 2026Reconstruct provider-executed shell calls when continuing OpenAI Responses with storage disabled.
4.0.40
11 Aug 2026Avoid duplicate MCP approval request references when continuing stored OpenAI Responses.
4.0.39
11 Aug 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.27
4.0.38
11 Aug 2026Keep client-executed function calls paired with their outputs when chaining OpenAI Responses with a previous response ID.
4.0.37
10 Aug 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.26
4.0.36
7 Aug 2026openai: Serialize tool text outputs when an output schema is configured
Accept
serviceTier: 'fast'on OpenAI chat and responses models. OpenAI renamed priority processing to Fast mode and acceptsservice_tier: 'fast'and'priority'interchangeably, so'fast'is now passed through verbatim and gated on the same model capability as'priority'.
Patch Changes
openai: Serialize tool text outputs when an output schema is configured
Accept
serviceTier: 'fast'on OpenAI chat and responses models. OpenAI renamed priority processing to Fast mode and acceptsservice_tier: 'fast'and'priority'interchangeably, so'fast'is now passed through verbatim and gated on the same model capability as'priority'.
4.0.35
7 Aug 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.24
4.0.34
7 Aug 2026provider/openai: Correlate rotating Responses API item IDs by output index
Patch Changes
provider/openai: Correlate rotating Responses API item IDs by output index
4.0.33
6 Aug 2026openai: Support batch APIs with experimental_startTextBatch
4.0.31 – 4.0.322 releases that only update dependencies@ai-sdk/provider 4.0.6@ai-sdk/provider-utils 5.0.23Show each
4.0.30
4 Aug 2026Fix streamed tool calls with non-zero, non-contiguous, reused, or missing indexes.
Patch Changes
Fix streamed tool calls with non-zero, non-contiguous, reused, or missing indexes.
4.0.27 – 4.0.293 releases that only update dependencies@ai-sdk/provider-utils 5.0.20@ai-sdk/provider 4.0.5Show each
4.0.26
31 Jul 2026Serialize file upload expiry settings in the multipart field shape accepted by OpenAI.
Patch Changes
Serialize file upload expiry settings in the multipart field shape accepted by OpenAI.
4.0.25
30 Jul 2026provider/openai: Resolve responses doStream at response.in_progress instead of first output token
The early-stream-error peek treated
response.in_progressas an unknown chunk, sodoStreamdid not resolve until the first output item arrived — delaying stream availability (and downstream TTFB for proxies/gateways) by the model's full time-to-first-token.response.in_progressis now modeled in the chunk schema and marks the request as accepted: the peek keeps watching for error frames for a short grace window (50ms) so quota/rate-limit errors flushed alongsideresponse.in_progressstill throw as retryableAPICallErrors, while healthy streams become available right after upstream acknowledges the request.Add experimental_toolCaller routing to generateText for code mode
Patch Changes
provider/openai: Resolve responses doStream at response.in_progress instead of first output token
The early-stream-error peek treated
response.in_progressas an unknown chunk, sodoStreamdid not resolve until the first output item arrived — delaying stream availability (and downstream TTFB for proxies/gateways) by the model's full time-to-first-token.response.in_progressis now modeled in the chunk schema and marks the request as accepted: the peek keeps watching for error frames for a short grace window (50ms) so quota/rate-limit errors flushed alongsideresponse.in_progressstill throw as retryableAPICallErrors, while healthy streams become available right after upstream acknowledges the request.Add experimental_toolCaller routing to generateText for code mode
4.0.24
29 Jul 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.15
4.0.23
28 Jul 2026Add blocked domain filters to the OpenAI and Azure Responses API web search tools.
4.0.22
28 Jul 2026Add experimental streaming speech translation models (
openai.translation('gpt-realtime-translate')over the OpenAI Realtime translations WebSocket andgoogle.translation('gemini-3.5-live-translate-preview')over the Gemini Live API).connectToWebSocketin@ai-sdk/provider-utilsnow passes close code and reason toonClose(additive, optional parameter).
Patch Changes
Add experimental streaming speech translation models (
openai.translation('gpt-realtime-translate')over the OpenAI Realtime translations WebSocket andgoogle.translation('gemini-3.5-live-translate-preview')over the Gemini Live API).connectToWebSocketin@ai-sdk/provider-utilsnow passes close code and reason toonClose(additive, optional parameter).
4.0.21
27 Jul 2026Only updates dependencies:@ai-sdk/provider 4.0.4@ai-sdk/provider-utils 5.0.13
4.0.20
23 Jul 2026Add OpenAI Responses Programmatic Tool Calling with hosted program tools, function caller controls, structured output schemas, and multi-step continuation support.
4.0.19
23 Jul 2026Apply reasoning, service tier, and image defaults to recognizable future OpenAI model family versions.
4.0.18
22 Jul 2026Preserve stored tool search output item IDs from provider metadata.
4.0.17
21 Jul 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.12
4.0.16
17 Jul 2026provider/openai, provider/open-responses: Throw a descriptive error when the Responses API returns a 200 with no
outputA successful (200) Responses body missing the
outputarray previously threw an opaqueoutput is not iterableTypeError fromdoGenerate. Both providers now surface a clearAPICallError("Responses API returned no output …"), including the incomplete-details reason (and status, for open-responses) when present. When the body includes aresponse.error, its message is surfaced first so upstream error details aren't masked by the generic fallback. This makes malformed/incomplete upstream responses actionable instead of a cryptic crash.
Patch Changes
provider/openai, provider/open-responses: Throw a descriptive error when the Responses API returns a 200 with no
outputA successful (200) Responses body missing the
outputarray previously threw an opaqueoutput is not iterableTypeError fromdoGenerate. Both providers now surface a clearAPICallError("Responses API returned no output …"), including the incomplete-details reason (and status, for open-responses) when present. When the body includes aresponse.error, its message is surfaced first so upstream error details aren't masked by the generic fallback. This makes malformed/incomplete upstream responses actionable instead of a cryptic crash.
4.0.15
15 Jul 2026Add the client-executed OpenAI Responses API computer tool with batched actions and screenshot outputs.
4.0.14
14 Jul 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.10
4.0.13
13 Jul 2026Fix realtime transcription auth header handling: per-call
authorizationheaders now override configuration headers regardless of header-key casing (last case-variant wins), and theBearerscheme is matched case-insensitively.Reject empty OpenAI, Anthropic, and Replicate base URLs with a helpful AI SDK
invalid argument error.
Patch Changes
Fix realtime transcription auth header handling: per-call
authorizationheaders now override configuration headers regardless of header-key casing (last case-variant wins), and theBearerscheme is matched case-insensitively.Reject empty OpenAI, Anthropic, and Replicate base URLs with a helpful AI SDK
invalid argument error.
4.0.11
9 Jul 2026provider/openai: Add GPT-5.6 reasoning and prompt cache controls
4.0.10
9 Jul 2026provider/openai,provider/gateway: Add gpt-5.6 model ids
Patch Changes
provider/openai,provider/gateway: Add gpt-5.6 model ids
4.0.9
8 Jul 2026Fix
StreamingToolCallTrackerfinalizing streaming tool calls on parsable partial JSON. Tool calls now only finalize during stream flush, restoring the behavior of #13137: a parsable argument buffer can still be the prefix of a longer argument string, so finalizing early could act on truncated tool inputs.
Patch Changes
Fix
StreamingToolCallTrackerfinalizing streaming tool calls on parsable partial JSON. Tool calls now only finalize during stream flush, restoring the behavior of #13137: a parsable argument buffer can still be the prefix of a longer argument string, so finalizing early could act on truncated tool inputs.
4.0.8
5 Jul 2026Send inline image file parts in OpenAI chat requests as data URLs instead of bare base64 strings.
4.0.7
2 Jul 2026Add experimental streaming transcription support for transcription models, including OpenAI
gpt-realtime-whisperand xAI WebSocket STT.
Patch Changes
Add experimental streaming transcription support for transcription models, including OpenAI
gpt-realtime-whisperand xAI WebSocket STT.
4.0.6
2 Jul 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.4