unstale

npm / @ai-sdk/openai-compatible

@ai-sdk/openai-compatible

What changed in @ai-sdk/openai-compatible 1 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

48 breaking3 security21 deprecations25 new APIs and options1 performance19 behavior and defaults33 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@ai-sdk/openai-compatible 770 changes

Breaking changes 35

  • The package is ESM-only; consumers using require() must switch to ESM import syntax.

    3.0.0, 7.0.0release notesupgrade guide

  • OpenTelemetry span collection moved out of the ai package; install this package and register an OpenTelemetry instance to receive traces.

    7.0.0upgrade guide

  • Tool callback context is now tool-specific, stable, and typed from contextSchema; provide per-tool values through toolsContext rather than shared runtime data.

    7.0.0upgrade guide

  • The deprecated experimental_activeTools option is removed; replace remaining usages with activeTools.

    7.0.0upgrade guide

  • The deprecated export was removed; use customProvider instead.

    7.0.0upgrade guide

  • The deprecated export was removed; use generateImage instead.

    7.0.0upgrade guide

  • The deprecated type export was removed; use GenerateImageResult instead.

    7.0.0upgrade guide

  • The generation start callback is renamed to onStart for generateText, streamText, and agents.

    7.0.0upgrade guide

  • The per-step start callback is renamed to onStepStart for generateText, streamText, and agents.

    7.0.0upgrade guide

  • The deprecated option and generateText result property were removed; use output for both call options and result access.

    7.0.0upgrade guide

  • The deprecated option was removed; use prepareStep instead.

    7.0.0upgrade guide

  • The tracer property is removed from experimental_telemetry; pass a custom tracer to the OpenTelemetry constructor instead.

    7.0.0upgrade guide

  • Top-level content, tool, file, source, and warning properties now accumulate values across every step; use finalStep for final-step-only values.

    7.0.0upgrade guide

  • Request bodies are no longer included in generateText and streamText step results by default; opt in with include.requestBody.

    7.0.0upgrade guide

  • generateText no longer includes response bodies by default; opt in with include.responseBody.

    7.0.0upgrade guide

  • The stop-condition helper is renamed from stepCountIs to isStepCount.

    7.0.0upgrade guide

  • The deprecated function is removed; replace usages with isToolUIPart.

    7.0.0upgrade guide

  • The deprecated top-level cachedInputTokens field is removed; use inputTokenDetails.cacheReadTokens instead.

    7.0.0upgrade guide

  • The deprecated top-level reasoningTokens field is removed; use outputTokenDetails.reasoningTokens instead.

    7.0.0upgrade guide

  • The deprecated tool-result content part type is removed; use the file variant with a tagged data value for inline file content.

    7.0.0upgrade guide

  • The minimum supported Node.js version is 22; supported versions are 22, 24, and 26.

    3.0.0, 7.0.0release notesupgrade guide

  • Replaces onEmbedFinish in telemetry integrations and tracing-channel event types.

    7.0.0upgrade guide

  • The callback follows the updated result shape: usage and content-related properties cover all steps, while final-step-only properties are available on finalStep.

    7.0.0upgrade guide

  • Replaces onRerankFinish in telemetry integrations and tracing-channel event types.

    7.0.0upgrade guide

  • Instructions returned from prepareStep now carry forward to future steps until another instructions or system override is returned.

    7.0.0upgrade guide

  • Messages returned from prepareStep now become the base for subsequent steps and are combined with the previous step's response messages.

    7.0.0upgrade guide

  • Register a telemetry integration globally at application startup to enable telemetry collection.

    7.0.0upgrade guide

  • Use runtimeContext for shared generation or agent state visible to orchestration, events, and step results, separate from tool-specific context.

    7.0.0upgrade guide

  • Each step's response.messages now contains only messages produced by that step; use result.responseMessages for the full response history.

    7.0.0upgrade guide

  • onChunk now receives every TextStreamPart, including lifecycle, boundary, and terminal parts; handlers may need to guard chunk types.

    7.0.0upgrade guide

  • System messages in prompt or messages are rejected by default; use the top-level instructions option, or opt in with allowSystemInMessages for existing trusted histories.

    7.0.0upgrade guide

  • Configure per-tool approval on the call or agent, keeping approval policy close to generation and allowing it to vary by request.

    7.0.0upgrade guide

  • The deprecated ToolCallOptions type is removed; use ToolExecutionOptions for imports and type references.

    7.0.0upgrade guide

  • Pass tool-specific context values through toolsContext, keyed by tool name; it becomes required when at least one tool declares contextSchema.

    7.0.0upgrade guide

  • generateText and streamText usage now totals token usage across all steps; use finalStep.usage for final-step-only usage.

    7.0.0upgrade guide

Deprecations 19

  • CallSettings is split into LanguageModelCallOptions and RequestOptions; its deprecated type remains available.

    7.0.0upgrade guide

  • Tool-result file content uses one canonical file variant with a tagged data union and required mediaType; legacy variants are runtime-migrated.

    7.0.0upgrade guide

  • The user-message image content part is deprecated; use a file part with an image mediaType instead.

    7.0.0upgrade guide

  • The tool-level needsApproval property is deprecated; move approval logic to toolApproval on the call or agent.

    7.0.0upgrade guide

  • Replaces onFinish as the final lifecycle callback for generateText, streamText, agents, embed, embedMany, and rerank; onFinish remains a deprecated alias.

    7.0.0upgrade guide

  • Replaces onStepFinish as the per-step lifecycle callback; the old name remains a deprecated alias for user-facing callbacks.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the top-level stateless helper instead.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the top-level stateless helper.

    7.0.0upgrade guide

  • The top-level final-step provider metadata result property is deprecated; read it from finalStep instead.

    7.0.0upgrade guide

  • The top-level final-step reasoning result property is deprecated; read it from finalStep instead.

    7.0.0upgrade guide

  • The top-level final-step reasoning text result property is deprecated; read it from finalStep instead.

    7.0.0upgrade guide

  • The top-level final-step request result property is deprecated; read it from finalStep instead.

    7.0.0upgrade guide

  • The top-level final-step response result property is deprecated; read it from finalStep instead.

    7.0.0upgrade guide

  • The top-level includeRawChunks option is deprecated; move it to include.rawChunks.

    7.0.0upgrade guide

  • The full event stream property is renamed to stream; fullStream remains available as a deprecated alias.

    7.0.0upgrade guide

  • totalUsage is deprecated; use usage for token totals across all steps.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the top-level stateless text-stream helpers instead.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless top-level helper to transform any stream.

    7.0.0upgrade guide

  • The streamText result method is deprecated; compose the top-level stateless stream helpers instead.

    7.0.0upgrade guide

New APIs and options 5

  • mediaType accepts a full IANA type or a top-level segment; when given a segment, the subtype is auto-detected from inline bytes where possible.

    7.0.0upgrade guide

  • Read final-step-only result values, including reasoning and metadata, through finalStep.

    7.0.0upgrade guide

  • The top-level system prompt option is renamed to instructions. system remains a deprecated fallback, and instructions takes precedence when both are provided.

    7.0.0upgrade guide

  • The prepareStep callback receives initialInstructions, the top-level instruction value from the original call.

    7.0.0upgrade guide

  • Models can return files in reasoning as a distinct content part; update exhaustive handling and account for these parts in content or reasoning rather than generated-files collections.

    7.0.0upgrade guide

Behavior and default changes 11

  • Repair-tool-call options use instructions instead of system for the current system instructions.

    7.0.0upgrade guide

  • The speech generation function graduated from experimental status and is available under the stable name generateSpeech; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • Replaces experimental_include as the stable option for generateText, streamText, and ToolLoopAgent; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • Replaces experimental_onToolCallFinish as the tool execution end callback; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • Replaces experimental_onToolCallStart as the tool execution start callback; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • When migrating to the top-level reasoning option, remove overlapping providerOptions settings because provider-specific settings take precedence.

    7.0.0upgrade guide

  • The speech result type has a stable name; Experimental_SpeechResult remains a deprecated alias.

    7.0.0upgrade guide

  • Telemetry configuration is opt-out once an integration is registered: calls emit events by default, and can opt out with isEnabled: false.

    7.0.0upgrade guide

  • Replaces experimental_telemetry as the stable telemetry option; the old name remains a deprecated alias during the migration window.

    7.0.0upgrade guide

  • The transcription API graduated from experimental status and is available under the stable name transcribe; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • The transcription result type has a stable name; Experimental_TranscriptionResult remains a deprecated alias.

    7.0.0upgrade guide

@ai-sdk/openai-compatible 62 changes

Breaking changes 2

  • The provider shorthand method textEmbedding has been renamed to embedding.

    6.0.0upgrade guide

  • The provider method textEmbeddingModel has been renamed to embeddingModel.

    6.0.0upgrade guide

@ai-sdk/openai-compatible 350 changes

Breaking changes 7

  • Chat Completions refusals from message.refusal and delta.refusal are returned as text after content; a non-empty refusal with a stop finish reason is reported as content-filter, including when both arrive in the same streamed chunk.

    1.0.62, 3.0.86release notesrelease notes

  • The experimental OpenAI Live method can now resolve asynchronously; await its result before using the connection settings.

    3.0.82release notes

  • Reasoning is now put before text in doGenerate.

    2.0.86, 3.0.73release notesrelease notes

  • Empty chat completion choices now return an AI SDK error.

    1.0.54, 3.0.46release notesrelease notes

  • Truncated chat streams are reported as errors.

    2.0.70, 3.0.33release notesrelease notes

  • The file part data property is now tagged with a type, and the image part type has been removed.

    3.0.0release notes

  • The image part type has been removed.

    3.0.0release notes

Security 2

  • Adds a fetch option so downloads can use a configured transport, including guarded-fetch for opt-in DNS validation on Node.js.

    3.0.91release notes

  • Azure image and Vertex tool-result downloads no longer use provider authentication wrappers, preventing file hosts from receiving provider credentials.

    3.0.91release notes

Deprecations 1

  • A warning is emitted when providerOptions uses kebab-case instead of camelCase.

    3.0.0release notes

New APIs and options 9

  • Provider API key settings can now be promises or synchronous or asynchronous callbacks, resolved per authenticated request while preserving existing authentication behavior and synchronous credential serialization.

    3.0.82release notes

  • Provider token settings can now be promises or synchronous or asynchronous callbacks, resolved per authenticated request while preserving existing authentication behavior and synchronous credential serialization.

    3.0.82release notes

  • OpenAICompatibleChatConfig adds an optional mapReasoning function for mapping the top-level reasoning option.

    3.0.81release notes

  • Supports URL-based image responses.

    3.0.70release notes

  • Supports uploaded file references via file_id.

    3.0.68release notes

  • Adds the portable max reasoning level, widening LanguageModelV4CallOptions['reasoning'] and ReasoningLevel. Exhaustive switches and mappings must handle max.

    3.0.64release notes

  • headers is now optional in provider config types, allowing manually constructed model configs to omit it when auth is provided separately.

    3.0.0release notes

  • Support was added for provider references and for uploading files as supported per provider.

    3.0.0release notes

  • Providers now support a new top-level reasoning parameter.

    3.0.0release notes

Performance 1

Behavior and default changes 6

  • The function returned by createDownload can be passed to generateText and streamText, and the hook now handles generated file URLs as well as other core downloads.

    3.0.91release notes

  • Top-level reasoning now maps to the closest effort level the model supports, rounding down when possible; unsupported none values map to the model's lowest level with a compatibility warning.

    3.0.81release notes

  • Top-level embedding dimensions are now mapped to provider settings.

    3.0.67release notes

  • Capability declarations use confirmed model IDs, leaving unrecognized model names unknown; asynchronous lookups and middleware overrides can also resolve to unknown.

    3.0.58release notes

  • Video file parts are converted to video_url content parts.

    3.0.35release notes

  • Image generation token usage is now reported.

    3.0.34release notes

Fixes and other changes 24

  • Custom download requests receive the call's abort signal, preserving cancellation and timeouts for prompt assets and generated files.

    3.0.91release notes

  • Non-string refusals, such as refusal: false, are ignored instead of causing the response to fail.

    3.0.86release notes

  • Inline text file data is accepted as text content, matching text files supplied as bytes or base64.

    3.0.85release notes

  • A raw verbosity passed through provider options is preserved when textVerbosity is unset; textVerbosity still takes precedence when both are set.

    3.0.85release notes

  • An unset reasoningEffort no longer overwrites a raw reasoning_effort provider option.

    2.0.89, 3.0.83release notesrelease notes

  • An explicit null is sent as "reasoning_effort": null.

    2.0.89, 3.0.83release notesrelease notes

  • String tool call arguments are preserved instead of being altered.

    3.0.83release notes

  • BigInt and circular structures are safely serialized in tool calls and outputs.

    3.0.83release notes

  • Fixed string interpolation in OpenAI-compatible completion errors for unexpected system messages.

    3.0.79release notes

  • Multipart tool results are now supported for compatible providers.

    3.0.62release notes

  • The User-Agent header now follows standards-compliant formatting.

    3.0.59release notes

  • Advertises file-input support for QuiverAI Arrow 2 and Arrow 2 Telos, and marks Together AI Gemini image inputs unsupported by the current single-image request mapping.

    3.0.58release notes

  • Fixes streamed tool calls when IDs are missing, blank, or repeated.

    3.0.58release notes

  • Extracts streaming response metadata after placeholder chunks.

    3.0.50release notes

  • Reasoning streams now remain contiguous when deltas include empty tool call arrays.

    2.0.75, 3.0.44release notesrelease notes

  • Supports text and thinking parts in array-based chat completion content and ignores unknown part types.

    2.0.74, 3.0.41release notesrelease notes

  • Sends reasoning_effort: "none" when top-level reasoning is disabled.

    3.0.36release notes

  • Handles tool call IDs that are empty strings.

    3.0.32release notes

  • Preserves Gemini thought signatures when using custom OpenAI-compatible provider names.

    3.0.32release notes

  • Chat and completion models now honor the camelCase providerOptions key.

    3.0.0release notes

  • Streaming delta chunks from OpenAI-compatible providers may now contain an empty string role.

    3.0.0release notes

  • Streaming tool calls are finalized only after the stream is fully consumed, preventing execution with incomplete arguments when partial JSON happens to be parsable.

    3.0.0release notes

  • Tool-only assistant messages send content: null instead of an empty string.

    3.0.0release notes

  • Provider model classes can cross workflow step boundaries without serialization errors.

    3.0.0release notes

@ai-sdk/openai-compatible 219 changes

Breaking changes 2

  • Streaming refusals are returned as text after any content; a non-empty refusal with a stop finish reason becomes content-filter, including when both arrive in the same chunk. Non-string refusals are ignored.

    2.0.91release notes

  • Non-streaming refusals are returned as text after any content; a non-empty refusal with a stop finish reason becomes content-filter, and non-string refusals are ignored.

    2.0.91release notes

Security 1

  • Supports URL-based image responses with opt-in URL validation and credential origin handling; redirect targets are validated, unsafe request headers stripped, and credentials dropped on cross-origin redirects while existing unvalidated requests are preserved.

    2.0.85release notes

Deprecations 1

  • The textEmbeddingModel and textEmbedding aliases are deprecated in favor of embeddingModel.

    2.0.0release notes

New APIs and options 9

  • Adds EmbeddingModelV3 and replaces textEmbeddingModel with embeddingModel; textEmbeddingModel and textEmbedding aliases are deprecated.

    2.0.0release notes

  • Adds extended token usage support.

    2.0.0release notes

  • Adds support for image editing.

    2.0.0release notes

  • Adds the ImageModelV3 API for providers implementing the v3 specification.

    2.0.0release notes

  • Adds the LanguageModelV3 API for providers implementing the v3 specification.

    2.0.0release notes

  • Exposes the raw finish reason.

    2.0.0release notes

  • Adds support for the textVerbosity provider option.

    2.0.0release notes

  • Adds support for tool execution approval.

    2.0.0release notes

  • Adds support for tool-specific strict mode.

    2.0.0release notes

Behavior and default changes 1

  • Updates the OpenAI specification for MCP approval.

    2.0.0release notes

Fixes and other changes 5

  • For Baseten's DeepSeek V4 Pro 0813 with reasoning enabled, empty structured-output answers are avoided by falling back to JSON prompt instructions while retaining reasoning and SDK output validation; the fallback is reported through request transformation warnings.

    2.0.91release notes

  • Tool calls now preserve string arguments and safely serialize BigInt and circular structures in tool calls and outputs.

    1.0.61, 2.0.90release notesrelease notes

  • Preserves streamed tool calls when their IDs or indices are unreliable.

    2.0.80release notes

  • Preserves unmapped fields in provider usage data, including fields nested in prompt_tokens_details and completion_tokens_details; mapped token counts are unaffected.

    2.0.69release notes

  • Adds ProviderV3 with specificationVersion support for providers implementing the v3 specification.

    2.0.0release notes

@ai-sdk/openai-compatible 19 changes

Breaking changes 2

  • OpenAI-compatible provider settings are now supplied through providerOptions.

    1.0.0release notes

  • The simulateStreaming option was removed.

    1.0.0release notes

New APIs and options 2

Behavior and default changes 1

Fixes and other changes 4

  • For Baseten's DeepSeek V4 Pro 0813, structured-output answers fall back to JSON prompt instructions when reasoning is enabled, preserving reasoning and SDK output validation; the fallback is reported through request transformation warnings.

    1.0.62release notes

  • Preserves streamed tool calls when their IDs and indices are unreliable.

    1.0.57release notes

  • Empty tool calls are now supported.

    1.0.0release notes

  • The tool_call type schema now accepts nullish values.

    1.0.0release notes