Packages

@ai-sdk/openai

4.0.108 · 3 Nov 2026Apache-2.022M / weekRepositoryHomepagenpmAtom feed

Your version

523 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 4.0.108

    3 Nov 2026

    Only updates a dependency:@ai-sdk/provider-utils 5.0.74

  2. 4.0.107

    2 Nov 2026
    • openai: Preserve valid JSON string tool arguments and serialize BigInt and cycles in tool calls and results, retaining malformed argument replay fallbacks

    • Forward languages and keywords transcription hints as repeated multipart fields instead of silently dropping them. Warn when these REST-only options are supplied to streaming transcription.

  3. 4.0.106

    30 Oct 2026
    • Support promises and synchronous or asynchronous callbacks in provider API key and token settings. Resolve credentials per authenticated request while preserving existing authentication behavior and synchronous credential serialization.

      The experimental OpenAI Live getServerWebSocketConfig() method can now resolve asynchronously. Await its result before using the connection settings.

    • Introduce a model entry contract with named capability sections and request configuration. Consolidate the OpenAI and Anthropic model catalogs so existing request behavior and generated capability documentation use the same source of truth. Catalogs also declare the provider options each provider accepts and which models support them.

  4. 4.0.105

    29 Oct 2026
    • openai: Send native JSON input and prompt cache keys to Decisions

    • openai: Map top-level reasoning to efforts supported by GPT-5.x models instead of sending unsupported values that OpenAI rejects with a 400. max is now only sent on the Responses API, and GPT-5.6 on Chat Completions sends reasoning_effort: 'none' when function tools are used, since it rejects function tools with reasoning. A warning is emitted when a reasoning level was requested.

    • Map the top-level reasoning option consistently across providers

      Providers now resolve reasoning the same way:

      mapReasoningToProviderEffort now accepts any reasoning value, returns an optional providerOptionsEffort unchanged, and rounds levels that are missing from the effort map to the closest supported level. mapReasoningToProviderBudget maps 'none' to the minimum reasoning budget, always returns a budget, and uses the default percentage for levels missing from budgetPercentages. OpenAICompatibleChatConfig adds an optional mapReasoning function for mapping the top-level reasoning option.

  5. 4.0.104

    27 Oct 2026
    • openai: Add GPT-6.1 Terra model support

    • openai: Read transcription duration from usage for duration-billed json responses

      durationInSeconds now falls back to usage.seconds when usage.type is duration and the response has no top-level duration (e.g. gpt-transcribe with the default json response format).

    • Support streaming transcription with gpt-live-transcribe and gpt-transcribe. For these models the language provider option is sent as a single-entry languages list. gpt-transcribe warns about and omits streaming.delay, which it does not support. gpt-live-transcribe rejects non-streaming transcription, since it has no REST endpoint.

  6. 4.0.103

    26 Oct 2026
    • Add azure.tools.toolSearch and support azure provider options on responses function tools

    • Fix string interpolation in Amazon Bedrock unsupported provider tool warnings and OpenAI / OpenAI-compatible completion errors for unexpected system messages.

  7. 4.0.102

    24 Oct 2026
    • Fix non-streaming Responses API structured output failing when multiple assistant messages contain JSON. Providers can supply separate structured-output text for parsing, allowing OpenAI and Azure Responses models to select the last final_answer while preserving all generated content, annotations, conversation history, and token usage.

  8. 4.0.100

    22 Oct 2026
    • Report interrupted when a stream ends cleanly without its provider completion signal, preserving partial output without emitting an error solely for the interruption.

      This applies to OpenAI (Chat, Responses, and Completions), Anthropic, Google (Generate Content and Interactions), Alibaba, Amazon Bedrock Converse, Cohere, DeepSeek, Groq, Hugging Face Responses, Mistral Chat, Moonshot AI, Open Responses, Perplexity, and xAI Responses. It also covers cutoffs in later Anthropic messages and Google automatic continuations.

      Compatibility notice: These streams previously fell back to other or omitted the finish part. Applications must now handle interrupted in finish-reason switches, mappings, and custom validation. Check finishReason === 'interrupted' to detect incomplete responses; interruption alone does not trigger error handling.

      Explicit unknown completion reasons still map to other. Actual provider, parsing, and transport errors retain their error paths; affected error paths that previously left the finish reason as other now report error. OpenAI-compatible remains unchanged.

  9. 4.0.99

    21 Oct 2026
    • Add a shared encodePathSegment helper and use it to encode provider-returned identifiers in credentialed follow-up request paths.

    • Defer construction of provider validation schemas until first use to reduce package import time.

    • openai: Support 12h prompt cache writes and cache prewarming

  10. 4.0.98

    20 Oct 2026
    • Add maxOutputTokens and reasoning to experimental decision calls and forward them to language-model-backed decisions. Language-model adapters keep reasoning disabled when omitted. Native decision providers warn when either setting is unsupported.

    • openai: Preserve detected language codes in transcription responses

    • openai: Forward shell_call timeout_ms and max_output_length to the shell tool and round-trip max_output_length

  11. 4.0.97

    19 Oct 2026
    • Add an optional modelId setting to Azure OpenAI language-model factories for
      accurate telemetry and capability detection with custom deployment names. Keep
      the deployment ID for API routing and preserve existing behavior when the model
      ID is omitted.

    • perplexity: Add decisions api support

  12. 4.0.96

    16 Oct 2026
    • deprecated

      openai: Deprecate 'webSearchPreview()' tool

    • openai: Support ordered 'additional_tools' from tool results

  13. 4.0.95

    15 Oct 2026
    • 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.

  14. 4.0.94

    15 Oct 2026

    Only updates a dependency:@ai-sdk/provider-utils 5.0.60

  15. 4.0.93

    13 Oct 2026
    • openai: Send assistant text with content instead of an item reference when its reasoning was removed

      With reasoning models and store: true, 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 when they are preceded by reasoning in the same assistant message.

  16. 4.0.92

    12 Oct 2026
    • openai: Replay web search results when response storage is disabled

    • Expose complete retrieved web-search URLs and file-search documents as sources, and normalize inline references separately as citations on text parts and text-end events. Preserve citation-derived sources when retrieval data is unavailable, including web-search-preview and Azure responses. Keep raw annotations, citation titles, and text locations available. Deduplicate file-search passages by file ID.

    • openai: JSON-encode custom tool input deltas for progressive UI updates

  17. 4.0.91

    8 Oct 2026
    • Map the top level embedding dimensions to provider settings

    • openai: Send image detail in decisions

    • Report failed and incomplete web searches as tool errors instead of successful tool results in OpenAI Responses API calls and batch results.

  18. 4.0.90

    8 Oct 2026
    • openai: Preserve sampling parameters for GPT-6 Sol and Luna when reasoning is disabled, accounting for reasoning effort updates in Responses requests

  19. 4.0.89

    8 Oct 2026
    • Add ordered text, file, and JSON parts to experimental decision state. Support image input in OpenAI Decisions and language model adapters. Gateway retains its existing string and JSON request format and rejects files, as does TypeSafe AI.

      Arrays passed directly as state now contain decision state parts. Wrap JSON arrays in an object or a json part.

      Normalize all public state forms into an array of parts before calling decision providers. Providers receive text and JSON objects as text and json parts.

      Serialize decision file bytes as base64 in OpenTelemetry state attributes. Model-call spans record normalized state parts, while outer spans retain public state inputs.

      Preserve native JSON state in TypeSafe AI when state contains one JSON part. Label shared state in language-model decision prompts.

  20. 4.0.88

    7 Oct 2026
    • Preserve tool errors in OpenAI Chat Completions and Responses by wrapping their payloads in an error object. Send Google tool errors and denied executions under functionResponse.response.error.

  21. 4.0.87

    7 Oct 2026
    • openai: Avoid duplicate references for stored messages with multiple text parts

  22. 4.0.86

    7 Oct 2026
    • provider: Report decision refusals as refusal answers

  23. 4.0.85

    6 Oct 2026
    • Limit jsonl rows to 64mb during batch result downloads

    • Replace the OpenAI structured-output wrapper for decide with the native Decisions API. Only gpt-6-luna is currently supported by this endpoint; other Responses models no longer work with openai.decisionModel() or its deprecated evaluationModel() alias.

      Responses API options, such as reasoningEffort, are no longer applied and produce unsupported-option warnings. The Decisions API supports providerOptions.openai.safetyIdentifier. Native token usage and confidence values are preserved, and per-question refusals fail the decision call.

    • provider: Add a portable max reasoning level with native provider mappings, compatibility coercions, and budget-based fallback support.

      Compatibility notes:

      Release classification: This remains a patch changeset under the repository's explicit release policy, which uses patch releases for both fixes and features. The TypeScript source-compatibility caveat for exhaustive consumers is disclosed above. Maintainers can override this classification with a major label if they decide to align the provider-spec addition with a future AI SDK major release.

  24. 4.0.84

    5 Oct 2026
    • Rename evaluate to decide

    • openai: Warn when reasoningSummary is used with chat models

  25. 4.0.83

    30 Sep 2026
    • ai: Add telemetry to speech generation and transcription, including provider usage propagation and experimental streaming lifecycle callbacks

  26. 4.0.82

    30 Sep 2026
    • openai: Add GPT-6.1 Sol model support

  27. 4.0.81

    29 Sep 2026
    • openai: Rewrite recursive Zod schemas that use allOf wrappers

  28. 4.0.80

    28 Sep 2026
    • Use standards-compliant User-Agent header

  29. 4.0.79

    28 Sep 2026
    • Fix streamed tool calls with missing, blank, or repeated IDs.

    • provider: Advertise image model file and mask input support

      Use confirmed model IDs for capability declarations so unrecognized model names remain unknown. Include Together AI FLUX.2 Pro and Flex single-image editing, and allow asynchronous capability lookups and middleware overrides to resolve to unknown.

      Advertise QuiverAI Arrow 2 and Arrow 2 Telos file-input support, and mark Together AI Gemini image inputs unsupported by the current single-image request mapping.

  30. 4.0.78

    26 Sep 2026
    • Support reasoningEffortUpdate: 'none' for GPT-6 Sol and Luna in request-level options and positioned system messages. Validate update efforts against the model's supported efforts, warning and omitting unsupported request-level updates and rejecting unsupported historical updates.

  31. 4.0.77

    25 Sep 2026
    • Default OpenAI Responses function tools to strict: false when tool strict mode is omitted.

  32. 4.0.75

    24 Sep 2026
    • The OpenAI Responses provider now accepts providerOptions.openai.reasoningEffortUpdate on 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.

  33. 4.0.74

    23 Sep 2026
    • openai: Classify Responses stream errors with null codes

  34. 4.0.73

    23 Sep 2026
    • openai: Expose Chat Completions audio transcripts as generated text

    • GPT-6 Sol and Luna model IDs

  35. 4.0.72

    21 Sep 2026
    • openai: Strip unsupported regex patterns from JSON schemas

    • openai: Include speech provider options in requests

  36. 4.0.71

    18 Sep 2026
    • openai: Cancel image edit URL downloads when the request is aborted

  37. 4.0.70

    18 Sep 2026
    • openai: Preserve provider file references in Responses tool results

    • openai: Send assistant text as Responses easy input messages

  38. 4.0.69

    16 Sep 2026
    • Add experimental Choice, Score, and Boolean evaluations through openai.evaluationModel() and a shared structured language-model evaluation adapter in @ai-sdk/provider-utils/experimental-evaluation. Preserve exact labels and metadata, validate score bounds, and return prompted Boolean P(true) estimates validated to be in [0, 1]. Boolean estimates are not guaranteed to be calibrated; application code chooses thresholds.

  39. 4.0.67

    15 Sep 2026
    • Add optional browser-direct WebRTC for experimental client-delegated Live conversations alongside the existing WebSocket path. Exchange SDP through an application endpoint with api.session, configure server-owned data-channel permissions, and preserve committed React session ownership. Capture follows the selected sender track, borrowed tracks remain caller-owned, and disconnect recovery and finalization stay bounded. Applications continue to handle client delegation and submit context; Live session updates and Responses delegation remain unsupported.

      Serialize microphone sender changes and close the peer if detachment fails, without stopping borrowed tracks. Validate nonempty SDP setup answers with a bounded response body, and document the same-origin broker authentication contract.

    • Add experimental OpenAI Live provider support through the unified openai.experimental_realtime factory for server WebSocket sessions with client delegation. Applications own their agents and tools, receive continuous audio/transcript events and delegation metadata, and return context through validated channels. Support immutable startup options, microphone mute controls, graceful session close, and cumulative voice usage. Responses delegation and Live session updates reject before sending.

      Route known Live model IDs to Live, allow an OpenAI-specific api override for early-access models, and preserve legacy Realtime defaults for unknown IDs. Token minting follows the same selection rules and rejects Live before requesting unsupported credentials. Extend the realtime v4 specification with optional server WebSocket configuration, per-connection raw-event parsers, and model-wide startup/finalization capabilities. This provider layer supplies connection settings and protocol mapping for server adapters; browser lifecycle and UI integration belong to the core runtime and framework hooks.

      Preserve Realtime client event IDs for session updates and audio appends, and correlate server errors with the originating client event.

  40. 4.0.66

    11 Sep 2026
    • Reject unsupported batch request types

    • Support image generation requests in batches

    • openai: Allow providers to disable web search source includes

  41. 4.0.65

    9 Sep 2026
    • openai: Add batch cancellation and listing

  42. 4.0.64

    9 Sep 2026
    • openai: Return an AI SDK error for empty chat completion choices

  43. 4.0.63

    9 Sep 2026
    • Include explicit message item types in Azure AI Foundry Responses requests.

    • openai: Add GPT Image 2.5 Flare and Sunburst model IDs

    • openai: Reject denied programmatic tool calls

  44. 4.0.62

    8 Sep 2026
    • Add xhigh and max quality support for GPT Image 2.5 Flare and Sunburst in image generation, image editing, and the Responses API image generation tool.

  45. 4.0.61

    8 Sep 2026
    • Support per-request models in batch

    • openai: Add async tool calling

  46. 4.0.60

    5 Sep 2026
    • openai: Add GPT-6 reasoning configuration updates

  47. 4.0.59

    4 Sep 2026
    • openai: Add support for the gpt-6-astra

    • openai: Support gpt-4o-transcribe-diarize, including chunking and diarized speaker metadata

  48. 4.0.58

    3 Sep 2026
    • openai: Support documented Responses image generation options

    • openai: Add support for ultrafast service tier