[KongchangAI]
Productai-sdk/openai-compatible

@ai-sdk/openai-compatible

An adapter package in the Vercel AI SDK ecosystem for third-party services compatible with the OpenAI API specification. It allows any service that follows the OpenAI Chat Completions protocol to be integrated into the AI SDK.

Core Facts

Timeline (last 90 days)

Nov 26

It is recommended to run npm ls @ai-sdk/provider-utils @ai-sdk/openai-compatible after upgrading to verify the resolved results, and to use overrides/resolutions to force unified versions if necessary.

Unverified50%
Nov 26

In the npm/pnpm/yarn dependency tree, @ai-sdk/xai usually declares provider-utils and openai-compatible as ^ range dependencies; when upgrading the xai package, the package manager may reuse the old versions in the lock file, causing the actual installed combination to differ from what the publisher tested.

Unverified50%
Nov 25

The coexistence of different major version numbers (e.g., provider-utils 5.x, openai-compatible and zai 3.x) is the normal result of independent version evolution and does not indicate incompatibility.

Unverified50%
Nov 25

The risk of upgrading to @ai-sdk/xai 3.0.155 is low, but if a project directly pins the versions of provider-utils or openai-compatible, it needs to check whether the lockfile conflicts.

Unverified50%
Nov 11

The core logic of @ai-sdk/vue depends on the ai package.

Unverified50%
Nov 10

To judge whether a coordinated release is relevant, one should first check the changelogs of provider-utils and openai-compatible rather than going through each adapter package; if the base library has no behavioral changes, the adapter patches can usually be safely skipped.

Unverified50%
Nov 10

Version changes in the compatibility layer often affect the actual shape of requests, such as message role mapping, field assembly for tool calling, and how finish_reason is handled in streaming responses.

Unverified50%
Nov 10

If a project pins a newer @ai-sdk/provider-utils but still uses an older @ai-sdk/zai, upgrading @ai-sdk/zai is worthwhile; conversely, if the dependency tree has an older provider-utils version, upgrading zai alone is of little value.

Partially Verified75%
Nov 7

The xAI provider's request construction, streaming parsing, error handling and other foundational logic are all inherited from openai-compatible.

Unverified50%
Nov 7

Z.ai's API design is itself compatible with the OpenAI format.

Verified80%

40 more timeline events

All Facts (20)

Verified

@ai-sdk/zai is built on the @ai-sdk/openai-compatible compatibility layer and only requires configuring Zhipu-specific endpoint addresses and parameters.

90%
Verified

xAI provides an OpenAI-compatible API interface, which was the basis for early @ai-sdk/xai being able to adapt via the Chat Completions endpoint.

90%
Verified

This update upgrades the dependency ai to 7.0.102 and @ai-sdk/provider-utils to 5.0.41.

90%
Verified

The core change in @ai-sdk/tui@1.0.100 is an update to dependencies, with the associated commit being 615ac89.

90%
Verified

When upgrading @ai-sdk/voyage, it is recommended to simultaneously update @ai-sdk/provider and @ai-sdk/provider-utils to ensure dependency tree version alignment

90%
Verified

@ai-sdk/zai depends on @ai-sdk/openai-compatible, indicating that Zhipu GLM's API interface is largely compatible with OpenAI's calling conventions.

90%
Verified

@ai-sdk/zai@3.0.8 synchronously updated upstream dependencies: @ai-sdk/provider@4.0.12, @ai-sdk/openai-compatible@3.0.46, and @ai-sdk/provider-utils@5.0.38.

90%
Verified

@ai-sdk/togetherai is the official Vercel AI SDK adapter for the TogetherAI platform, built on top of the openai-compatible base package.

90%
Verified

Vercel AI SDK provides unified abstract interfaces (such as generateText and streamText), allowing developers to maintain a consistent coding style when calling different model providers.

90%
Verified

OpenAI's API interface specification has become the de facto communication standard in the AI industry, and many model providers including Anthropic, Google, and Mistral offer interfaces compatible with this format.

90%
Verified

@ai-sdk/openai-compatible is the common compatibility layer for many OpenAI-compatible model services, and changes to its version may affect multiple provider adapter packages at once.

85%
Verified

For projects that use multiple @ai-sdk/* packages simultaneously, keeping their versions synchronized during upgrades helps avoid potential compatibility issues.

85%
Verified

The fact that @ai-sdk/amazon-bedrock depends on @ai-sdk/openai does not mean an OpenAI account or key is required, because @ai-sdk/openai encapsulates general-purpose capabilities such as HTTP request handling, streaming response parsing, and tool-calling protocols that are shared across multiple provider packages.

85%
Verified

@ai-sdk/xai is an official adapter for integrating xAI's Grok series of models, encapsulating details such as authentication, request construction, and streaming response parsing.

85%
Verified

xAI's Grok series models follow OpenAI's interface specification in API design.

85%
Verified

The zai provider depends on @ai-sdk/openai-compatible, indicating it is most likely built on top of an OpenAI-compatible interface.

85%
Verified

@ai-sdk/openai-compatible handles common logic such as streaming output, tool calling, and error format normalization.

80%
Verified

Z.ai's API design is itself compatible with the OpenAI format.

80%
Verified

@ai-sdk/openai-compatible's core responsibilities include: converting the AI SDK's unified call parameters into OpenAI format, parsing responses and mapping them back to the AI SDK's standardized results, and handling chunking and errors in streaming responses.

80%
Verified

Within the AI SDK ecosystem, there exists an adapter package @ai-sdk/zod similar to @ai-sdk/valibot, with both providing the same public interface.

80%

Source Articles