Packages

@ai-sdk/openai

4.0.121 · 17 Nov 2026Apache-2.025.8M / weekRepositoryHomepagenpmAtom feed

Your version

4.0.109

5 Nov 2026Where it was published

4.0.122 is the newest release of 4.x.

In short

10 new11 internal

Release note

Patch Changes

  • Expose customTool through azure.tools for 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 with serverUrl or connectorId; 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), and safetyIdentifier for image models

  • Feat (provider/openai): forward the moderation option to /images/edits

  • Report 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

    OpenAIRealtimeModel now implements getServerWebSocketConfig(), returning the upstream realtime WebSocket URL for conversation and transcription intents plus header auth derived from the model's configured credentials. Dedicated transcription sessions serialize with session.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 normalized usage on response-done and input-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.name on Chat Completions system, developer, user, and assistant messages. Validate names as strings and warn when configured on unsupported tool messages.

  • Expose azure.tools.shell for 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.