@ai-sdk/openai
4.0.121 · 17 Nov 2026Apache-2.025.8M / weekRepositoryHomepagenpmAtom feed
4.0.122 is the newest release of 4.x.
In short
10 new11 internal
Release note
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.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.