npm / @ai-sdk/xai
@ai-sdk/xai
What changed in @ai-sdk/xai 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
3 breaking1 security10 new APIs and options4 behavior and defaults6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/xai 521 changes
Breaking changes 2
Together AI Gemini image inputs are marked unsupported by the current single-image request mapping.
The Chat Completions API was removed.
Security 1
@ai-sdk/provider-utils has an Uncontrolled Resource Consumption issue
New APIs and options 9
Adds opus as a supported audio format.
Adds grok-imagine-image-2.0 as an image model ID for use with the xAI provider.
Adds auto as an image quality option for the xAI provider.
Adds 1.5k as an image resolution provider option.
Adds support for transcription model IDs.
Adds vadThreshold support for transcription.
Adds missing Responses API provider options.
Adds missing video provider options.
Adds the grok 4.7 model ID for use with @ai-sdk/xai.
Behavior and default changes 4
The xSearch tool now allows up to 20 allowedXHandles.
The xSearch tool now allows up to 20 excludedXHandles.
Asynchronous capability lookups can resolve to unknown.
Middleware overrides can resolve capability lookups to unknown.
Fixes and other changes 5
Speaker diarization is preserved when available or reported as unavailable, avoiding silent loss of diarization information.
The User-Agent header is now standards-compliant.
QuiverAI Arrow 2 and Arrow 2 Telos are advertised as supporting file input.
Capability declarations use confirmed model IDs, leaving unrecognized model names unknown.
Together AI FLUX.2 Pro and Flex are advertised as supporting single-image editing.
@ai-sdk/xai 43 changes
Breaking changes 1
Unsupported batch request types are now rejected.
New APIs and options 1
Image generation requests are now supported in batches.
Fixes and other changes 1
Tool schemas now preserve additionalProperties: false.