build: update dependency @ai-sdk/openai to v4 - #292
Open
angular-robot wants to merge 1 commit into
Open
Conversation
See associated pull request for more information.
angular-robot
requested review from
AndrewKushnir,
crisbeto and
devversion
as code owners
September 7, 2026 07:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.0.49→4.0.60Release Notes
vercel/ai (@ai-sdk/openai)
v4.0.60Compare Source
Patch Changes
17e489e: feat(openai): add GPT-6 reasoning configuration updatesv4.0.59Compare Source
Patch Changes
4af00d1: feat(openai): add support for the gpt-6-astraabb9ebf: feat(openai): supportgpt-4o-transcribe-diarize, including chunking and diarized speaker metadatav4.0.58Compare Source
Patch Changes
b54e551: fix(openai): support documented Responses image generation options17d3436: feat(openai): add support for ultrafast service tierv4.0.57Compare Source
Patch Changes
048ce06: feat(batch): 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 upload7243530: fix(openai): preserve complete Responses API raw usage objectsv4.0.56Compare Source
Patch Changes
6bcc0f8]v4.0.55Compare Source
Patch Changes
3fc40db: feat(openai): implementgetFileMetadata,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 paths5190b67]v4.0.54Compare Source
Patch Changes
f6fac50: fix(openai): handle null usage in responsese07b577: feat: add tool calling support to batchv4.0.53Compare Source
Patch Changes
7439d7a: Fix workflow deserialization for OpenAI Responses models.v4.0.52Compare Source
Patch Changes
1c68540: Preserve explicit prompt cache breakpoints on scalar Responses tool results.aa45741]v4.0.51Compare Source
Patch Changes
90192f1]v4.0.50Compare Source
Patch Changes
e6a2992: Fix Responses history serialization for regular functions namedtool_search.v4.0.49Compare Source
Patch Changes
2523403: Normalize non-object replayed Chat Completions tool arguments to empty objects.3e125ba]v4.0.47Compare Source
Patch Changes
591d25b: feat: 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.2214258: Prevent negative text output token counts when providers report reasoning tokens. Perplexity reasoning tokens are now treated as separate from completion tokens.591d25b]v4.0.46Compare Source
Patch Changes
b74971f]v4.0.45Compare Source
Patch Changes
6be0f51: fix(openai): expand internal parallel tool call wrappers from the Responses API while preserving stateful continuation and streaming fallbacksv4.0.44Compare Source
Patch Changes
e6087c9: fix: handle empty string tool call IDse6087c9]v4.0.43Compare Source
Patch Changes
a062795: fix(openai): support built-in and provider-defined tools in the ResponsesallowedToolsoptionallowedToolsemitted every allow-list entry as{ type: 'function', name }, but OpenAI identifiesbuilt-in tools by type. Allow-listing a declared provider-defined tool (web search, image generation,
MCP, custom, ...) therefore failed with
Tool choice '<name>' not found in 'tools' parameter. Entriesare 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.
v4.0.42Compare Source
Patch Changes
b6fff2e: feat(provider/openai): support explicit Responses compaction triggersv4.0.41Compare Source
Patch Changes
59d6def: Reconstruct provider-executed shell calls when continuing OpenAI Responses with storage disabled.v4.0.40Patch Changes
e19a4a6: Avoid duplicate MCP approval request references when continuing stored OpenAI Responses.v4.0.39Patch Changes
7fbfc6d]v4.0.38Patch Changes
d302134: Keep client-executed function calls paired with their outputs when chaining OpenAI Responses with a previous response ID.v4.0.37Compare Source
Patch Changes
401a4ba]v4.0.36Compare Source
Patch Changes
6157098: fix(openai): serialize tool text outputs when an output schema is configured4cd4548: AcceptserviceTier: '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'.ad6a650]81cd026]v4.0.35Compare Source
Patch Changes
1937bef]v4.0.34Compare Source
Patch Changes
73d48d0: fix(provider/openai): correlate rotating Responses API item IDs by output indexbbd9b31: chore: rename*TranslationModeland its related types to*SpeechTranslationModelfor consistencyv4.0.33Compare Source
Patch Changes
e6a93c4: feat(openai): support batch APIs with experimental_startTextBatchv4.0.32Compare Source
Patch Changes
3469d0c]v4.0.31Compare Source
Patch Changes
2b60826]v4.0.30Compare Source
Patch Changes
1bec07d: Fix streamed tool calls with non-zero, non-contiguous, reused, or missing indexes.1bec07d]v4.0.29Compare Source
Patch Changes
160ccdb]v4.0.28Compare Source
Patch Changes
79e133c]v4.0.27Compare Source
Patch Changes
5fc7da5: chore: centralize empty language model usage creation in provider utilities.93b2acd: chore: centralize response metadata conversion5fc7da5]93b2acd]v4.0.26Compare Source
Patch Changes
f7c4a38: Serialize file upload expiry settings in the multipart field shape accepted by OpenAI.fa95504]v4.0.25Compare Source
Patch Changes
beaecb3: fix(provider/openai): resolve responses doStream at response.in_progress instead of first output tokenThe 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.b192878: feat: add experimental_toolCaller routing to generateText for code modeUpdated dependencies [
d8210b6]Updated dependencies [
b192878]v4.0.24Compare Source
Patch Changes
1659cd5]6a5bdff]v4.0.23Compare Source
Patch Changes
96a237d: Add blocked domain filters to the OpenAI and Azure Responses API web search tools.v4.0.22Compare Source
Patch Changes
c49380c: feat: 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).0c464d9]c49380c]v4.0.21Compare Source
Patch Changes
1e2f324]v4.0.20Compare Source
Patch Changes
1f6dd3a: Add OpenAI Responses Programmatic Tool Calling with hosted program tools, function caller controls, structured output schemas, and multi-step continuation support.v4.0.19Compare Source
Patch Changes
34c53c0: Apply reasoning, service tier, and image defaults to recognizable future OpenAI model family versions.v4.0.18Compare Source
Patch Changes
bc43dc2: Preserve stored tool search output item IDs from provider metadata.v4.0.17Compare Source
Patch Changes
02ffdcb]76cb673]v4.0.16Compare Source
Patch Changes
75f86f4: fix(provider/openai, provider/open-responses): throw a descriptive error when the Responses API returns a 200 with nooutputA 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.Updated dependencies [
cd06458]v4.0.15Compare Source
Patch Changes
0063c2d: Add the client-executed OpenAI Responses API computer tool with batched actions and screenshot outputs.v4.0.14Compare Source
Patch Changes
31c7be8]v4.0.13Compare Source
Patch Changes
7805e4a: Fix realtime transcription auth header handling: per-callauthorizationheaders now override configuration headers regardless of header-key casing (last case-variant wins), and theBearerscheme is matched case-insensitively.cd12954: Reject empty OpenAI, Anthropic, and Replicate base URLs with a helpful AI SDKinvalid argument error.
4be62c1]7805e4a]cd12954]v4.0.11Compare Source
Patch Changes
b2b1bb9: feat(provider/openai): add GPT-5.6 reasoning and prompt cache controlsv4.0.10Compare Source
Patch Changes
fdb6d5d: feat(provider/openai,provider/gateway): add gpt-5.6 model ids0f93c57]v4.0.9Compare Source
Patch Changes
ac306ed: FixStreamingToolCallTrackerfinalizing 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.ac306ed]v4.0.8Compare Source
Patch Changes
b51ed36: Send inline image file parts in OpenAI chat requests as data URLs instead of bare base64 strings.v4.0.7Compare Source
Patch Changes
5c5c0f5: Add experimental streaming transcription support for transcription models, including OpenAIgpt-realtime-whisperand xAI WebSocket STT.5c5c0f5]v4.0.6Compare Source
Patch Changes
ccb8952: fix(openai): return an AI SDK error for empty chat completion choices912fb01]v4.0.5Compare Source
Patch Changes
4af00d1: feat(openai): add support for the gpt-6-astraabb9ebf: feat(openai): supportgpt-4o-transcribe-diarize, including chunking and diarized speaker metadatav4.0.4Compare Source
Patch Changes
2523403: Normalize non-object replayed Chat Completions tool arguments to empty objects.3e125ba]v4.0.3Compare Source
Patch Changes
7fbfc6d]v4.0.2Compare Source
Patch Changes
160ccdb]v4.0.1Compare Source
Patch Changes
34c53c0: Apply reasoning, service tier, and image defaults to recognizable future OpenAI model family versions.v4.0.0Compare Source
Major Changes
34bd95d: feat(ai): add support for uploading provider skills using the provider references abstractionef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only ("type": "module"). Consumers usingrequire()must switch to ESMimportsyntax.c29a26f: feat(provider): add support for provider references and uploading files as supported per provider3887c70: feat(provider): add new top-level reasoning parameter to spec and support it ingenerateTextandstreamText61753c3: ###@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:
after:
@ai-sdk/provider-utils:createToolNameMapping()no longer accepts theresolveProviderToolNameparameterbefore: tool name can be set dynamically
after: tool name is static based on
toolskeys8359612: Start v7 pre-release04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbolsFor all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
Patch Changes
29e6ac6: feat: add allowedTools provider option for OpenAI Responses38fc777: Add AI Gateway hint to provider READMEsa71d345: fix(provider/openai): drop reasoning parts without encrypted content when store: false7afaece: feat(provider/openai): add GPT-5.4 model support365da1a: Addgpt-5.4-mini,gpt-5.4-mini-2026-03-17,gpt-5.4-nano, andgpt-5.4-nano-2026-03-17models.1772a63: Default OpenAI Responses reasoning summaries to detailed when reasoning effort is enabled.83f9d04: feat(openai): upgrade v3 specs to v445b3d76: fix(security): prevent streaming tool calls from finalizing on parsable partial JSONStreaming 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.bf837fe: feat(provider/gateway): add speech and transcription model supportd6c79e3: feat(openai): add GPT-5.5 chat model IDse776fc7: feat(provider/azure):web search tool in the Azure OpenAI Responses API.817a1a6: fix(openai): support file-url parts in tool output content1f509d4: fix(ai): force template check on 'kind' param0c4ac8a: fix(openai): default undefined tool-call input to empty object before serializing tool arguments9f0e36c: trigger release for all packages after provenance setup58a2ad7: fix: more precise default message for tool execution denial6a5800e: feat(openai): add namespaces for tool definitionsae7f932: fix(openai): throw retryable errors for OpenAI stream failures before output starts2c4767d: feat(openai): add orchestration token usage details to Responses API usagebada0f3: feat(openai): preservenamespaceon function_call output itemscd3de8b: feat(openai): forwardweb_search_call.action.queriesfrom Responses API94eba1b: fix(openai): round-tripnamespaceon 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.7bbc194: feat(provider/openai): forward imageDetail providerOptions on tool-result image content156cdf0: feat(openai): add new tool search toolf7295cb: revert incorrect fix #131729ea40e0: chore(provider/openai): add type for image model options for type-safe processing7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.f807e45: Extract sharedStreamingToolCallTrackerclass 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.d9a1e9a: feat(openai): add server side compaction for openai0c4c275: trigger initial canary releaseac18f89: feat(provider/openai): addgpt-5.3-chat-latest6fd51c0: fix(provider): preserve error type prefix in getErrorMessagecd9c311: fix(openai, openai-compatible): only send null content for assistant messages with tool callse6376c2: fix(openai): preserve raw finish reason for failed responses stream eventsHandle
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.ce769dd: feat(provider): add experimental Realtime API support for voice conversationsAdds first-class support for realtime (speech-to-speech) APIs:
Experimental_RealtimeModelV4spec in@ai-sdk/providerwith normalized event types and factoryopenai.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 providere311194: feat(ai): allow passing provider instance touploadFileanduploadSkillas shorthand9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type258c093: chore: ensure consistent import handling and avoid import duplicates or cycles685cec7: feat(openai): add opt-in pass-through for unsupported file media types61bcdb5: fix(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_id5463d0d: feat(provider): align tool result output content file part types with top-level message file part typesb8396f0: trigger initial beta releasebfb756d: patch - send content: null instead of empty string for tool-only assistant messages90e2d8a: chore: fix unused vars not being flagged by our lint tooling17b5597: fix(openai): skip passing reasoning items when using previous response idb3976a2: 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.ff5eba1: feat: rollimage-*tool output types into their equivalentfile-*typesf9acbc0: feat(provider/openai): add gpt-image-2 model supportv3.0.112Compare Source
Patch Changes
1336501: fix(openai): return an AI SDK error for empty chat completion choices1a4dbb1]v3.0.111Compare Source
Patch Changes
1f75808: Include explicit message item types in Azure AI Foundry Responses requests.65150c2: feat(openai): add GPT Image 2.5 Flare and Sunburst model IDsv3.0.110Compare Source
Patch Changes
447ba18: feat(openai): add async tool calling46c6820: Addxhighandmaxquality support for GPT Image 2.5 Flare and Sunburst in image generation, image editing, and the Responses API image generation tool.v3.0.109Compare Source
Patch Changes
7f3b8f0: feat(openai): add GPT-6 reasoning configuration updatesv3.0.108Compare Source
Patch Changes
019eec8: feat(openai): add support for the gpt-6-astrav3.0.107Compare Source
Patch Changes
8844beb: fix(openai): flatten mid-stream Responses error eventscf1ba03: fix(openai): preserve complete Responses API raw usage objectsv3.0.106Compare Source
Patch Changes
85ba0b0: Preserve explicit prompt cache breakpoints on scalar Responses tool results.v3.0.105Compare Source
Patch Changes
cc23556]v3.0.104Compare Source
Patch Changes
426c9b3: Normalize non-object replayed Chat Completions tool arguments to empty objects.34d045d: Fix Responses history serialization for regular functions namedtool_search.v3.0.102Compare Source
Patch Changes
087d7e2: Signal schema-invalid known Responses stream events and preserve the error finish reason.v3.0.101Compare Source
Patch Changes
313a441: Prevent negative text output token counts when providers report reasoning tokens. Perplexity reasoning tokens are now treated as separate from completion tokens.5642849]v3.0.100Compare Source
Patch Changes
2d172fb]v3.0.99Compare Source
Patch Changes
f40afcf: fix(openai): expand internal parallel tool call wrappers from the Responses API while preserving stateful continuation and streaming fallbacksv3.0.98Compare Source
Patch Changes
91880b9: fix(openai): support built-in and provider-defined tools in the ResponsesallowedToolsoptionallowedToolsemitted every allow-list entry as{ type: 'function', name }, but OpenAI identifiesbuilt-in tools by type. Allow-listing a declared provider-defined tool (web search, image generation,
MCP, custom, ...) therefore failed with
Tool choice '<name>' not found in 'tools' parameter. Entriesare 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.
v3.0.97Compare Source
Patch Changes
31205a4]v3.0.96Compare Source
Patch Changes
64facff: Reconstruct provider-executed shell calls when continuing OpenAI Responses with storage disabled.v3.0.95Compare Source
Patch Changes
bdb46fe: Avoid duplicate MCP approval request references when continuing stored OpenAI Responses.v3.0.94Compare Source
Patch Changes
d3247d7: Keep client-executed function calls paired with their outputs when chaining OpenAI Responses with a previous response ID.b2a4d5a]v3.0.93Compare Source
Patch Changes
f471a1c: AcceptserviceTier: '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'.2171d15][
v3.0.92](https://redirect.github.com/vercel/ai/releases/tag/%40ai-sdk/openai%403.