unstale

npm / @ai-sdk/xai

@ai-sdk/xai

What changed in @ai-sdk/xai 3 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.

3 breaking2 security26 new APIs and options4 behavior and defaults10 fixes and other

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

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

@ai-sdk/xai 521 changes

Breaking changes 2

  • Together AI Gemini image inputs are marked unsupported by the current single-image request mapping.

    5.0.11release notes

  • The Chat Completions API was removed.

    5.0.0release notes

Security 1

  • @ai-sdk/provider-utils has an Uncontrolled Resource Consumption issue

    5.0.1security advisory

New APIs and options 9

Behavior and default changes 4

  • The xSearch tool now allows up to 20 allowedXHandles.

    5.0.18release notes

  • The xSearch tool now allows up to 20 excludedXHandles.

    5.0.18release notes

  • Asynchronous capability lookups can resolve to unknown.

    5.0.11release notes

  • Middleware overrides can resolve capability lookups to unknown.

    5.0.11release notes

Fixes and other changes 5

  • Speaker diarization is preserved when available or reported as unavailable, avoiding silent loss of diarization information.

    5.0.16release notes

  • The User-Agent header is now standards-compliant.

    5.0.12release notes

  • QuiverAI Arrow 2 and Arrow 2 Telos are advertised as supporting file input.

    5.0.11release notes

  • Capability declarations use confirmed model IDs, leaving unrecognized model names unknown.

    5.0.11release notes

  • Together AI FLUX.2 Pro and Flex are advertised as supporting single-image editing.

    5.0.11release notes

@ai-sdk/xai 421 changes

Breaking changes 1

  • Unsupported batch request types are now rejected.

    4.0.58release notes

Security 1

  • Blank and dot-segment file IDs are rejected or encoded so they cannot retarget request paths.

    4.0.52release notes

New APIs and options 17

  • Image generation requests are now supported in batches.

    4.0.58release notes

  • Adds batch cancellation and listing capabilities.

    4.0.57release notes

  • Batch requests can now use per-request models.

    4.0.55release notes

  • The xAI batch input file upload accepts an inputFileExpiresAfter provider option.

    4.0.54release notes

  • Batch start results now expose the uploaded input file's expiration time in provider metadata.

    4.0.54release notes

  • Batch start results now expose the ID of the uploaded input file in provider metadata.

    4.0.54release notes

  • File operations now accept abortSignal.

    4.0.52release notes

  • Adds deleteFile to the xAI files interface.

    4.0.52release notes

  • Adds streaming downloadFile to the xAI files interface.

    4.0.52release notes

  • Adds getFileMetadata to the xAI files interface.

    4.0.52release notes

  • File operations now accept headers.

    4.0.52release notes

  • Upload results now expose byteSize.

    4.0.52release notes

  • Upload results now expose createdAt.

    4.0.52release notes

  • Supports streaming uploads using data with type set to stream.

    4.0.52release notes

  • Supports upload TTLs through expiresAfter, an integer from 3600 to 2592000 seconds, emitted before the file part as xAI requires.

    4.0.52release notes

  • Upload results now expose expiresAt.

    4.0.52release notes

  • Batch now supports tool calling.

    4.0.51release notes

Fixes and other changes 2

@ai-sdk/xai 33 changes

Fixes and other changes 3

  • Generated and streamed results now preserve complete xAI Chat Completions usage objects.

    3.0.127release notes

  • Raw usage metadata now preserves complete xAI Responses usage objects.

    3.0.127release notes

  • Image moderation blocks are reported as content policy errors.

    3.0.125release notes