@ai-sdk/openai
4.0.111 · 7 Nov 2026Apache-2.022.5M / weekRepositoryHomepagenpmAtom feed
Where each line stands
Plan an upgrade- 4.x4.0.111No known advisoryLatest line
- 3.x3.0.139No known advisoryTo 4.0.111
- 2.x2.0.141No known advisoryTo 4.0.111
- 1.x1.3.24No known advisoryTo 4.0.111
- 0.x0.0.72No known advisoryTo 4.0.111
Latest releases
All 530 releases- 4.x · latest line
4.0.111
7 Nov 2026Add
resolveProviderOptionsto parse provider options that a model accepts under severalproviderOptionskeys, either as aliases (first) or merged in order (merge), and use it for the existing multi-key lookups in the OpenAI, OpenAI-compatible, Anthropic, Google, and Amazon Bedrock models. Resolution behavior for these models is unchanged.
Patch Changes
Add
resolveProviderOptionsto parse provider options that a model accepts under severalproviderOptionskeys, either as aliases (first) or merged in order (merge), and use it for the existing multi-key lookups in the OpenAI, OpenAI-compatible, Anthropic, Google, and Amazon Bedrock models. Resolution behavior for these models is unchanged.
4.0.110
6 Nov 2026Refactor Azure model ID logic into a model catalog that declares capabilities and provider options, and generate provider capability documentation from it. Export the OpenAI catalog internally for Azure to reuse. Request behavior is unchanged.
openai: Surface Chat Completions refusals as text content
The Chat Completions model ignored
message.refusal(non-streaming) anddelta.refusal(streaming). When the model refused to answer,contentwasnull, so the AI SDK returned empty text with astopfinish reason and silently dropped the refusal. Refusal text is now emitted as text content in bothgenerateTextandstreamTextresults, and it is emitted in addition to content when the API returns both. A refusal with astopfinish reason is now reported as acontent-filterfinish reason, matching the Anthropic provider and the Responses API.openai,openai-compatible: Surface refusal logprobs and openai-compatible refusals
@ai-sdk/openai: Chat Completions responses that contain a refusal can returnlogprobs.refusalnext tologprobs.content. The provider previously read onlylogprobs.content, soproviderMetadata.openai.logprobswas empty or missing for refusals. Refusal logprobs are now included in emission order (content logprobs followed by refusal logprobs) in bothgenerateTextandstreamText.Streaming logprobs are now collected across all chunks in
streamText: previously only the logprobs of the last streamed chunk were reported. This applies to content logprobs as well, soproviderMetadata.openai.logprobsnow contains the logprobs of every streamed token instead of only the last chunk's tokens. Explicitly empty logprobs (logprobs: { content:, refusal: null }) are reported as an empty array, as before.A refusal that arrives in the same streamed chunk as the
finish_reasonis now taken into account: such a response is reported with acontent-filterfinish reason instead ofstop.@ai-sdk/openai-compatible: Chat Completions responses that carrymessage.refusal(non-streaming) ordelta.refusal(streaming) were ignored, so providers such as OpenAI served throughcreateOpenAICompatiblelost the refusal text and reported an emptystopresponse. Refusals are now returned as text content after any content text, and a non-empty refusal with astopfinish reason is reported as acontent-filterfinish reason. This also applies when the refusal and the finish reason arrive in the same streamed chunk. Non-string refusals (for examplerefusal: falsefrom servers that use booleans) are ignored instead of failing the response.
Patch Changes
Refactor Azure model ID logic into a model catalog that declares capabilities and provider options, and generate provider capability documentation from it. Export the OpenAI catalog internally for Azure to reuse. Request behavior is unchanged.
openai: Surface Chat Completions refusals as text content
The Chat Completions model ignored
message.refusal(non-streaming) anddelta.refusal(streaming). When the model refused to answer,contentwasnull, so the AI SDK returned empty text with astopfinish reason and silently dropped the refusal. Refusal text is now emitted as text content in bothgenerateTextandstreamTextresults, and it is emitted in addition to content when the API returns both. A refusal with astopfinish reason is now reported as acontent-filterfinish reason, matching the Anthropic provider and the Responses API.openai,openai-compatible: Surface refusal logprobs and openai-compatible refusals
@ai-sdk/openai: Chat Completions responses that contain a refusal can returnlogprobs.refusalnext tologprobs.content. The provider previously read onlylogprobs.content, soproviderMetadata.openai.logprobswas empty or missing for refusals. Refusal logprobs are now included in emission order (content logprobs followed by refusal logprobs) in bothgenerateTextandstreamText.Streaming logprobs are now collected across all chunks in
streamText: previously only the logprobs of the last streamed chunk were reported. This applies to content logprobs as well, soproviderMetadata.openai.logprobsnow contains the logprobs of every streamed token instead of only the last chunk's tokens. Explicitly empty logprobs (logprobs: { content:, refusal: null }) are reported as an empty array, as before.A refusal that arrives in the same streamed chunk as the
finish_reasonis now taken into account: such a response is reported with acontent-filterfinish reason instead ofstop.@ai-sdk/openai-compatible: Chat Completions responses that carrymessage.refusal(non-streaming) ordelta.refusal(streaming) were ignored, so providers such as OpenAI served throughcreateOpenAICompatiblelost the refusal text and reported an emptystopresponse. Refusals are now returned as text content after any content text, and a non-empty refusal with astopfinish reason is reported as acontent-filterfinish reason. This also applies when the refusal and the finish reason arrive in the same streamed chunk. Non-string refusals (for examplerefusal: falsefrom servers that use booleans) are ignored instead of failing the response.openai: Handle refusal content parts in the Responses API
The Responses API returns a
refusalcontent part instead ofoutput_textwhen the model declines a request. The response schema rejected these parts, so non-streaming calls failed with anAPICallError("Invalid JSON response"), and streamedresponse.refusal.delta/response.refusal.doneevents were dropped, producing empty text. Refusal content parts and stream events are now parsed: the refusal explanation is surfaced as text and the finish reason is mapped tocontent-filter. When the response also contains a client-side function call, the finish reason staystool-callsso the tools are still executed.
4.0.109
5 Nov 2026Expose
customToolthroughazure.toolsfor Azure Responses models, sharing the OpenAI custom tool factory and its raw string input support.Add memoryLimit and networkPolicy properties in codeInterpreter tool
Add Secure MCP tunnel support to the OpenAI MCP tool via
tunnelId. Tunnel targets cannot be combined withserverUrlorconnectorId; existing URL and connector configurations remain compatible.
Patch Changes
Expose
customToolthroughazure.toolsfor Azure Responses models, sharing the OpenAI custom tool factory and its raw string input support.Add memoryLimit and networkPolicy properties in codeInterpreter tool
Add Secure MCP tunnel support to the OpenAI MCP tool via
tunnelId. Tunnel targets cannot be combined withserverUrlorconnectorId; existing URL and connector configurations remain compatible.openai: Support GPT Image 2.6 models with
complexity, markup-guided edits (markup), animated GIF output (outputFormat: 'gif',frameCount,frameDurationMs), andsafetyIdentifierfor image modelsFeat (provider/openai): forward the
moderationoption to/images/editsReport the actual OpenAI Chat HTTP endpoint (also used by Azure Chat and Bedrock Mantle Chat) through optional request metadata and model-call end events. Record its host and port on OpenTelemetry chat spans without exposing URL credentials, paths, queries, or fragments. Expose only the sanitized HTTP origin in text and object generation results and step/finish callbacks. Providers that do not report an endpoint leave these attributes unset.
Feat (provider/openai): implement server-side realtime extensions
OpenAIRealtimeModelnow implementsgetServerWebSocketConfig(), returning the upstream realtime WebSocket URL forconversationandtranscriptionintents plus header auth derived from the model's configured credentials. Dedicated transcription sessions serialize withsession.type: "transcription"and the selected realtime model id. Translation is rejected until the normalized realtime codec supports its distinct wire protocol. The event mapper now populates normalizedusageonresponse-doneandinput-transcription-completed(gross input/output token counts with cached portions reported separately; duration usage for duration-billed transcription).Transcription serialization honors the explicit transcription model and rejects unsupported output settings. Gross token totals and reported modality/cache counts are retained; duration uses
seconds. OpenAI Live retains its existing connection API and rejects unsupported intents.Forward per-message
providerOptions.openai.nameon Chat Completions system, developer, user, and assistant messages. Validate names as strings and warn when configured on unsupported tool messages.Expose
azure.tools.shellfor local and hosted shell execution through the Azure Responses API.Expose optional transcription word timings separately from segments and accept shared timestampGranularities. Explicit provider timing settings take precedence. OpenAI now sends timestamp_granularities only with verbose_json and warns when a requested timing is unavailable or excluded.
Dependency tracking · free for 3 projects
Know when your own dependencies move
@ai-sdk/openai shipped 2 new majors in the last 12 months, among 322 releases. inlinr shows which of your projects are behind, and what the upgrade breaks.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Registry facts last checked 9 Nov 2026. Releases and advisories last read 9 Nov 2026.