@ai-sdk/xai
The official provider package in the Vercel AI SDK ecosystem for accessing xAI (Grok) models, implemented on an OpenAI-compatible layer and supporting capabilities such as streaming responses and tool calling.
Core Facts
@ai-sdk/xai is the adapter-layer provider package in the AI SDK targeting the xAI Grok series of models.
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.
@ai-sdk/zai is the official Provider in the Vercel AI SDK for Zhipu AI models.
Timeline (last 90 days)
The changes in version 3.0.146 are: exposing the costInUsdTicks field in the response's provider metadata.
Version 3.0.146 introduces no API breaking changes and is an incremental capability addition.
The key commit for this fix is 0eb8de6, with the commit message 'fix(xai): stop emitting each citation twice when streaming responses with web or X search'.
Developers using @ai-sdk/xai with the Web Search or X Search feature enabled are advised to upgrade to 5.0.32 to eliminate the duplicate citation issue.
Version 5.0.32 fixes a defect where citations were emitted twice in streaming responses when using the Web Search or X Search feature.
After the fix, each citation is sent only once, making the citation list in streaming output match expectations.
Upgrading to 5.0.30 is a low-risk operation, with no API signature changes or deprecation warnings, and existing code requires no modification.
The 5.0.x series has already accumulated a considerable number of patches, and teams accustomed to planning upgrades by major version need to establish an automated dependency inspection mechanism.
Applications that are using the xai provider to call Grok-series models and that also integrate multiple AI SDK providers in the same project should follow up on this release the most.
Version 3.0.40 contains documentation maintenance commit e729d58, which updates README.md to unify formatting and avoid duplicate content.
40 more timeline events
All Facts (20)
@ai-sdk/xai is the adapter-layer provider package in the AI SDK targeting the xAI Grok series of models.
90%VerifiedxAI 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@ai-sdk/zai is the official Provider in the Vercel AI SDK for Zhipu AI models.
90%VerifiedxAI's Grok series models follow OpenAI's interface specification in API design.
85%Verified@ai-sdk/xai@3.0.134 was automatically built by GitHub Actions.
80%VerifiedIt is recommended to upgrade related @ai-sdk/* packages as a group, since provider-utils has been synchronized to 5.0.49.
75%VerifiedPatch version upgrades generally do not require modifications to existing business code, but it is recommended to run integration tests after upgrading to confirm dependency version compatibility.
75%Verified@ai-sdk/xai@5.0.5 was automatically published by github-actions and belongs to Patch Changes (patch-level update).
75%VerifiedIt is recommended to run the full test suite after upgrading, especially when the project simultaneously locks the versions of related dependencies such as ai and @ai-sdk/provider.
75%VerifiedDevelopers using the AI SDK to integrate xAI models and who have defined tools or structured output schemas with strict property constraints are advised to upgrade to 4.0.59.
75%VerifiedIt is recommended to run existing test cases after upgrading to confirm that streaming output and message handling logic work correctly.
75%VerifiedDue to version linkage among AI SDK packages, it is recommended to keep @ai-sdk/provider, @ai-sdk/provider-utils, and the voyage package within compatible version ranges.
75%VerifiedWhen upgrading @ai-sdk/xai, it is recommended to also update the associated @ai-sdk/provider and @ai-sdk/provider-utils dependencies to ensure consistency.
75%VerifiedThe @ai-sdk/xai adapter is specifically designed to interface with xAI's Grok series models.
75%VerifiedThis version follows the PATCH update strategy in Semantic Versioning, introducing no breaking changes and remaining backward compatible.
75%VerifiedPatch versions follow the Semantic Versioning (SemVer) specification and should theoretically not introduce breaking changes.
75%VerifiedThis dependency update is associated with commit 9942196.
75%VerifiedPatch version updates are generally backward compatible and can be upgraded via npm update @ai-sdk/zai or the equivalent package manager command.
75%Verified@ai-sdk/xai 5.0.23 is a patch-level release containing 2 commits, automatically released by github-actions.
75%VerifiedThe @ai-sdk/zai package released version 3.0.8, which is a patch change.
90%