@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.x · latest line
4.0.4 – 4.0.52 releases that only update dependencies@ai-sdk/provider-utils 5.0.3@ai-sdk/provider 4.0.1Show each
4.0.3
29 Jun 2026Return a helpful error when the Responses stream parser receives Chat Completions chunks.
4.0.2
27 Jun 2026Only updates a dependency:@ai-sdk/provider-utils 5.0.1
4.0.1
27 Jun 2026openai: Add support for web_search_call.results include option
4.0.0
25 Jun 2026- breaking
ai: Add support for uploading provider skills using the provider references abstraction
- breaking
Remove CommonJS exports from all packages. All packages are now ESM-only (
"type": "module"). Consumers usingrequire()must switch to ESMimportsyntax. - breaking
provider: Add support for provider references and uploading files as supported per provider
Major Changes
- breaking
ai: Add support for uploading provider skills using the provider references abstraction
- breaking
Remove CommonJS exports from all packages. All packages are now ESM-only (
"type": "module"). Consumers usingrequire()must switch to ESMimportsyntax. - breaking
provider: Add support for provider references and uploading files as supported per provider
- breaking
provider: Add new top-level reasoning parameter to spec and support it in
generateTextandstreamText - breaking
@ai-sdk/openai: remove redundantnameargument fromopenai.tools.customTool()openai.tools.customTool()no longer accepts anamefield. the tool name is now derived from the sdk tool key (the object key in thetoolsobject).migration: remove the
nameproperty fromcustomTool()calls. the object key is now used as the tool name sent to the openai api.before:
tools: { write_sql: openai.tools.customTool({ name: 'write_sql', description: '...', }), }after:
tools: { write_sql: openai.tools.customTool({ description: '...', }), }
@ai-sdk/provider-utils:createToolNameMapping()no longer accepts theresolveProviderToolNameparameterbefore: tool name can be set dynamically ```ts const toolNameMapping = createToolNameMapping({ tools, providerToolNames: { "openai.code_interpreter": "code_interpreter", "openai.file_search": "file_search", "openai.image_generation": "image_generation", "openai.local_shell": "local_shell", "openai.shell": "shell", "openai.web_search": "web_search", "openai.web_search_preview": "web_search_preview", "openai.mcp": "mcp", "openai.apply_patch": "apply_patch", }, resolveProviderToolName: (tool) => tool.id === "openai.custom" ? (tool.args as { name?: string }).name : undefined, }); ``` after: tool name is static based on `tools` keys const toolNameMapping = createToolNameMapping({ tools, providerToolNames: { 'openai.code_interpreter': 'code_interpreter', 'openai.file_search': 'file_search', 'openai.image_generation': 'image_generation', 'openai.local_shell': 'local_shell', 'openai.shell': 'shell', 'openai.web_search': 'web_search', 'openai.web_search_preview': 'web_search_preview', 'openai.mcp': 'mcp', 'openai.apply_patch': 'apply_patch', } });Start v7 pre-release
Patch Changes
Add allowedTools provider option for OpenAI Responses
Add AI Gateway hint to provider READMEs
provider/openai: Drop reasoning parts without encrypted content when store: false
provider/openai: Add GPT-5.4 model support
Add
gpt-5.4-mini,gpt-5.4-mini-2026-03-17,gpt-5.4-nano, andgpt-5.4-nano-2026-03-17models.Default OpenAI Responses reasoning summaries to detailed when reasoning effort is enabled.
openai: Upgrade v3 specs to v4
security: Prevent streaming tool calls from finalizing on parsable partial JSON
Streaming tool call arguments were finalized using
isParsableJson()as a heuristic for completion. If partial accumulated JSON happened to be valid JSON before all chunks arrived, the tool call would be executed with incomplete arguments. Tool call finalization now only occurs inflush()after the stream is fully consumed.provider/gateway: Add speech and transcription model support
openai: Add GPT-5.5 chat model IDs
feat(provider/azure):web search tool in the Azure OpenAI Responses API.
openai: Support file-url parts in tool output content
ai: Force template check on 'kind' param
openai: Default undefined tool-call input to empty object before serializing tool arguments
Trigger release for all packages after provenance setup
More precise default message for tool execution denial
openai: Add namespaces for tool definitions
openai: Throw retryable errors for OpenAI stream failures before output starts
openai: Add orchestration token usage details to Responses API usage
openai: Preserve
namespaceon function_call output itemsopenai: Forward
web_search_call.action.queriesfrom Responses APIopenai: round-trip
namespaceon function_call input itemsWhen
tool_searchdispatches a deferred tool, the resultingfunction_callcarries anamespacefield identifying which deferred-tool group the model picked.#14789preserved this on the read side (providerMetadata.openai.namespace), but the write side still serializedfunction_callinput items withoutnamespace. Multi-step / multi-turn conversations then failed withMissing namespace for function_call '<name>'. ... Round-trip the model's function_call item with its namespace field included.convert-to-openai-responses-input.tsnow readsnamespacefromproviderOptions.openai.namespace(orproviderMetadata.openai.namespace) ontool-callparts and includes it on the serializedfunction_callitem, mirroring howitemIdis round-tripped.provider/openai: Forward imageDetail providerOptions on tool-result image content
openai: Add new tool search tool
Revert incorrect fix #13172
- breaking
Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
Extract shared
StreamingToolCallTrackerclass into@ai-sdk/provider-utilsto deduplicate streaming tool call handling across OpenAI-compatible providers. Also adds missinggenerateId()fallback fortoolCallIdin Alibaba'sdoGeneratepath and ensures all providers finalize unfinished tool calls during stream flush.openai: Add server side compaction for openai
Trigger initial canary release
provider/openai: Add
gpt-5.3-chat-latestprovider: Preserve error type prefix in getErrorMessage
openai, openai-compatible: Only send null content for assistant messages with tool calls
openai: Preserve raw finish reason for failed responses stream events
Handle
response.failedchunks in Responses API streaming sofinishReason.rawis preserved fromincomplete_details.reason(e.g.max_output_tokens), and map failed-without-reason cases to unifiederrorinstead ofother.provider: Add experimental Realtime API support for voice conversations
Adds first-class support for realtime (speech-to-speech) APIs:
Experimental_RealtimeModelV4spec in@ai-sdk/providerwith normalized event types and factoryOpenAI, Google, and xAI realtime provider implementations
openai.experimental_realtime()/google.experimental_realtime()/xai.experimental_realtime()work in both server and browser.getToken()static method on each provider for server-side ephemeral token creationexperimental_getRealtimeToolDefinitionshelper for provider session tool definitionsexperimental_useRealtimehook in@ai-sdk/reactreturningUIMessage(aligned withuseChat), withonToolCallandaddToolOutputfor client-driven tool executioninputAudioTranscriptionsession config for showing transcribed user audio messages when supported by the provider
ai: Allow passing provider instance to
uploadFileanduploadSkillas shorthandprovider: Change file part data property to be tagged with a type and remove the image part type
openai: Add opt-in pass-through for unsupported file media types
provider/openai: Send client-executed tool calls as full function_call items in the Responses API so they pair with their function_call_output by call_id
provider: Align tool result output content file part types with top-level message file part types
Trigger initial beta release
Patch - send content: null instead of empty string for tool-only assistant messages
openai: Skip passing reasoning items when using previous response id
Add workflow serialization support to all provider models.
@ai-sdk/provider-utils: NewserializeModel()helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.All providers:
headersis now optional in provider config types. This is non-breaking — existing code that passesheaderscontinues to work. Custom provider implementations that construct model configs manually can now omitheaders, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.All provider model classes now include
WORKFLOW_SERIALIZEandWORKFLOW_DESERIALIZEstatic methods, enabling them to cross workflow step boundaries without serialization errors.Roll
image-*tool output types into their equivalentfile-*typesprovider/openai: Add gpt-image-2 model support
- 3.x
3.0.136
3 Nov 2026openai: Preserve valid JSON string tool arguments and serialize BigInt and cycles in tool calls and results, retaining malformed argument replay fallbacks
Forward
languagesandkeywordstranscription hints as repeated multipart fields instead of silently dropping them.
Patch Changes
openai: Preserve valid JSON string tool arguments and serialize BigInt and cycles in tool calls and results, retaining malformed argument replay fallbacks
Forward
languagesandkeywordstranscription hints as repeated multipart fields instead of silently dropping them.
3.0.135
29 Oct 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.63
3.0.134
27 Oct 2026openai: Report unfinished web searches as tool errors
Report failed and incomplete web searches as tool errors instead of successful tool results in OpenAI Responses API calls.
3.0.133
27 Oct 2026openai: Add GPT-6.1 Terra model support
Fix
gpt-transcribeREST transcription. Requests with OpenAI provider options now useresponse_format: 'json'forgpt-transcribeand datedgpt-4o-mini-transcribesnapshots, which rejectverbose_json.durationInSecondsis read fromusage.secondswhen a duration-billed response has no top-levelduration.
3.0.132
26 Oct 2026Add azure.tools.toolSearch and support azure provider options on responses function tools
3.0.131
21 Oct 2026Defer validation schema construction until first use to reduce provider import time.
openai: Support 12h prompt cache writes and cache prewarming
Patch Changes
Defer validation schema construction until first use to reduce provider import time.
openai: Support 12h prompt cache writes and cache prewarming
3.0.130
16 Oct 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.61
3.0.129
15 Oct 2026Restore raw OpenAI custom-tool input deltas for consumers that forward them to Responses API clients. Mark streamed input with
inputEncoding: 'text'so UI clients can display it progressively without JSON parsing. Preserve the encoding when partial UI messages are saved and resumed. Final provider tool-call inputs remain JSON-encoded.
Patch Changes
Restore raw OpenAI custom-tool input deltas for consumers that forward them to Responses API clients. Mark streamed input with
inputEncoding: 'text'so UI clients can display it progressively without JSON parsing. Preserve the encoding when partial UI messages are saved and resumed. Final provider tool-call inputs remain JSON-encoded.
3.0.128
15 Oct 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.59
3.0.127
13 Oct 2026openai: Send assistant text with content instead of an item reference when its reasoning was removed
With reasoning models, pruning reasoning (e.g.
pruneMessages({ reasoning: 'all' })) caused follow-up requests to fail with "Item 'msg_...' of type 'message' was provided without its required 'reasoning' item". Assistant text parts are now only sent as item references, or with their item id, when they are preceded by reasoning in the same assistant message.
Patch Changes
openai: Send assistant text with content instead of an item reference when its reasoning was removed
With reasoning models, pruning reasoning (e.g.
pruneMessages({ reasoning: 'all' })) caused follow-up requests to fail with "Item 'msg_...' of type 'message' was provided without its required 'reasoning' item". Assistant text parts are now only sent as item references, or with their item id, when they are preceded by reasoning in the same assistant message.
3.0.126
12 Oct 2026openai: JSON-encode custom tool input deltas for progressive UI updates
3.0.125
9 Oct 2026openai: Replay web search results when response storage is disabled
openai: Classify Responses stream errors with null codes
3.0.124
1 Oct 2026openai: Rewrite recursive Zod schemas that use
allOfwrappers
3.0.123
30 Sep 2026openai: Add support for ultrafast service tier
3.0.122
30 Sep 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.57
3.0.121
30 Sep 2026openai: Add GPT-6.1 Sol model support
3.0.120
28 Sep 2026provider-utils: Preserve streamed tool calls with unreliable IDs and indices
Patch Changes
provider-utils: Preserve streamed tool calls with unreliable IDs and indices
3.0.119
27 Sep 2026Only updates dependencies:@ai-sdk/provider 3.0.18@ai-sdk/provider-utils 4.0.55
3.0.118
24 Sep 2026The OpenAI Responses provider now accepts
providerOptions.openai.reasoningEffortUpdateon empty system messages and sends each update at its position in the conversation. This lets applications change reasoning effort during a conversation while preserving the prompt prefix for caching.
3.0.117
23 Sep 2026openai: Expose Chat Completions audio transcripts as generated text
openai: Preserve retryability for early stream errors
Patch Changes
openai: Expose Chat Completions audio transcripts as generated text
openai: Preserve retryability for early stream errors
3.0.116
23 Sep 2026openai: Accept
incompletefunction_call and custom_tool_call items on the Responses stream, so a call truncated bymax_output_tokensfinishes withlengthinstead of aTypeValidationErrorGPT-6 Sol and Luna model IDs
Patch Changes
openai: Accept
incompletefunction_call and custom_tool_call items on the Responses stream, so a call truncated bymax_output_tokensfinishes withlengthinstead of aTypeValidationErrorGPT-6 Sol and Luna model IDs
3.0.115
21 Sep 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.52
3.0.114
18 Sep 2026openai: Preserve provider file references in Responses tool results
3.0.113
16 Sep 2026openai: Report apply patch responses with a tool-calls finish reason
3.0.112
9 Sep 2026openai: Return an AI SDK error for empty chat completion choices
Patch Changes
openai: Return an AI SDK error for empty chat completion choices
3.0.111
9 Sep 2026Include explicit message item types in Azure AI Foundry Responses requests.
openai: Add GPT Image 2.5 Flare and Sunburst model IDs
3.0.110
8 Sep 2026openai: Add async tool calling
Add
xhighandmaxquality support for GPT Image 2.5 Flare and Sunburst in image generation, image editing, and the Responses API image generation tool.
3.0.109
5 Sep 2026openai: Add GPT-6 reasoning configuration updates
3.0.108
4 Sep 2026openai: Add support for the gpt-6-astra
3.0.107
3 Sep 2026openai: Flatten mid-stream Responses error events
openai: Preserve complete Responses API raw usage objects
3.0.106
31 Aug 2026Preserve explicit prompt cache breakpoints on scalar Responses tool results.
3.0.105
30 Aug 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.50
3.0.104
26 Aug 2026Normalize non-object replayed Chat Completions tool arguments to empty objects.
Fix Responses history serialization for regular functions named
tool_search.
3.0.102
26 Aug 2026Signal schema-invalid known Responses stream events and preserve the error finish reason.
3.0.101
25 Aug 2026Prevent negative text output token counts when providers report reasoning tokens. Perplexity reasoning tokens are now treated as separate from completion tokens.
Patch Changes
Prevent negative text output token counts when providers report reasoning tokens. Perplexity reasoning tokens are now treated as separate from completion tokens.
3.0.100
24 Aug 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.47
3.0.99
20 Aug 2026openai: Expand internal parallel tool call wrappers from the Responses API while preserving stateful continuation and streaming fallbacks
3.0.98
19 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.
3.0.97
14 Aug 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.46
3.0.96
12 Aug 2026Reconstruct provider-executed shell calls when continuing OpenAI Responses with storage disabled.
3.0.95
12 Aug 2026Avoid duplicate MCP approval request references when continuing stored OpenAI Responses.
3.0.94
11 Aug 2026Keep client-executed function calls paired with their outputs when chaining OpenAI Responses with a previous response ID.
Patch Changes
Keep client-executed function calls paired with their outputs when chaining OpenAI Responses with a previous response ID.
3.0.93
11 Aug 2026Accept
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
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'.
3.0.92
10 Aug 2026Only updates a dependency:@ai-sdk/provider-utils 4.0.43