unstale

pypi / xai-sdk

xai-sdk

What changed in xai-sdk 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-15.

3 breaking1 security1 deprecations67 new APIs and options1 performance11 behavior and defaults1 tooling7 fixes and other

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

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

xai-sdk 192 changes

Breaking changes 3

Security 1

  • Sensitive attributes can be excluded from traces.

    1.4.0release notes

Deprecations 1

  • Deprecates BaseImageResponse.prompt following removal of up_sampled_prompt from the proto.

    1.7.0release notes

New APIs and options 67

  • Adds guidelines to chat.create.

    1.21.0release notes

  • Adds safety_identifier to chat.create.

    1.21.0release notes

  • Video generation adds support for a last frame and keyframes.

    1.20.0release notes

  • An image_generation server-side tool is added.

    1.19.0release notes

  • Image generation gains a quality parameter.

    1.19.0release notes

  • Video generation gains generate_audio.

    1.19.0release notes

  • Video generation gains reference_audios.

    1.19.0release notes

  • Video generation adds 1080p.

    1.19.0release notes

  • Adds grok-4.6 to ChatModel.

    1.18.0release notes

  • Accepts xhigh as a reasoning_effort value.

    1.18.0release notes

  • Adds service_tier support for priority processing.

    1.17.0release notes

  • Image and video generation now accept file-ID inputs.

    1.16.0release notes

  • Adds Imagine file storage for developers working with image and video generation.

    1.16.0release notes

  • Adds list filtering to the files client.

    1.16.0release notes

  • Adds public file URLs to the files client.

    1.16.0release notes

  • Adds support for context compaction.

    1.15.0release notes

  • Adds grok-build-0.1 to ChatModel, making it available for use as a chat model.

    1.15.0release notes

  • Adds SERVER_SIDE_TOOL_IMAGE_SEARCH to the enum.

    1.14.0release notes

  • Adds enable_image_search to web_search.

    1.14.0release notes

  • Adds prepare_extension() for batch video extension.

    1.13.0release notes

  • Adds none and medium reasoning effort levels.

    1.12.2release notes

  • Adds grok-4.3 as a ChatModel option.

    1.12.1release notes

  • Bytes chunking was added.

    1.12.0release notes

  • Collection descriptions were added.

    1.12.0release notes

  • Image and video responses now expose cost_usd tracking.

    1.12.0release notes

  • File uploads now support expires_after.

    1.12.0release notes

  • Adds URL support for FileContent.

    1.11.0release notes

  • Adds support for inline file attachments.

    1.11.0release notes

  • Adds support for reference_image_urls.

    1.10.0release notes

  • Adds a video extension API to the xAI Python SDK.

    1.10.0release notes

  • Adds batch support for image and video operations.

    1.9.0release notes

  • Adds input_file_id support.

    1.9.0release notes

  • Added the agent_count parameter to the chat API for multi-agent models.

    1.8.0release notes

  • Added grok-4.20 experimental beta and multi-agent model variants to ChatModel.

    1.8.0release notes

  • Added grok-imagine-image-pro as an ImageGenerationModel.

    1.8.0release notes

  • Adds support for 2K image resolution.

    1.7.0release notes

  • Adds the image_urls parameter to support multi-reference image editing.

    1.7.0release notes

  • Adds support for the Imagine image/video API.

    1.6.1release notes

  • Adds support for the batch API.

    1.6.0release notes

  • Adds the developer role.

    1.6.0release notes

  • Adds a tool_call_id field.

    1.6.0release notes

  • Web-search tools support user-location information.

    1.6.0release notes

  • The Chunk class gains inline citations support.

    1.5.0release notes

  • Adds new features to the Collections API client.

    1.5.0release notes

  • Adds end_index to document search tools.

    1.5.0release notes

  • Adds the verbose_streaming include option.

    1.5.0release notes

  • The Response class gains inline citations support.

    1.5.0release notes

  • Adds utility functions to retrieve server-side tool outputs.

    1.5.0release notes

  • The SDK supports including inline citations.

    1.4.1release notes

  • Chat creation accepts a max_turns parameter for agentic conversations.

    1.4.1release notes

  • Request metadata now also includes the language.

    1.4.1release notes

  • Tool calls gain a status field in the proto definitions.

    1.4.1release notes

  • The SDK supports including tool output.

    1.4.1release notes

  • Clients gain context manager support and proper channel cleanup.

    1.4.0release notes

  • Proto changes and a utility function add collections-search support.

    1.4.0release notes

  • Chat responses support debug output.

    1.4.0release notes

  • Chat responses support encrypted content.

    1.4.0release notes

  • The SDK adds client support for the Files API.

    1.4.0release notes

  • Clients can be configured to use an insecure gRPC channel.

    1.4.0release notes

  • A remote MCP tool is added.

    1.4.0release notes

  • ToolCall supports ToolCallType.

    1.4.0release notes

  • The usage enum adds SERVER_SIDE_TOOL_MCP and SERVER_SIDE_TOOL_COLLECTIONS_SEARCH.

    1.4.0release notes

  • The SDK version is added to request metadata.

    1.4.0release notes

  • The chat service supports multiple outputs in chunks and responses.

    1.3.1release notes

  • Added convenience functions for using new server-side tools.

    1.3.0release notes

  • Added proto support for server-side tools.

    1.3.0release notes

  • Adds support for new X source parameters for live search.

    1.0.0release notes

Performance 1

  • Lazy buffering reduces memory usage for streaming chat responses.

    1.4.0release notes

Behavior and default changes 11

  • Allows protobuf 7.

    1.21.0release notes

  • The default gRPC User-Agent is now XaiSdk/{version}.

    1.19.0release notes

  • Updated grok-4.20 and multi-agent model variants in ChatModel, changing the model variants developers can use.

    1.9.1release notes

  • Updates the grok-4.20 beta and multi-agent model variants available in ChatModel.

    1.8.1release notes

  • Reduces the default PollTimer poll interval.

    1.7.0release notes

  • Introduces default video polling settings.

    1.7.0release notes

  • Adds instrumentation to Collections methods.

    1.6.0release notes

  • Adds instrumentation to File methods.

    1.6.0release notes

  • All output entries are appended for agentic responses.

    1.4.0release notes

  • chat.create accepts a Pydantic BaseModel directly as response_format.

    1.4.0release notes

  • Chat automatically detects implicit server-side tool additions.

    1.4.0release notes

Tooling 1

  • Adds Grok Imagine models to types/model.py for editor autocomplete.

    1.16.0release notes

Fixes and other changes 7

  • Replaying tool outputs via chat.append(response) now sets tool_call_id.

    1.19.0release notes

  • Field definitions were updated.

    1.12.0release notes

  • Fixes handling of unknown statuses in polling loops.

    1.9.0release notes

  • Handles a video generation failure case.

    1.8.2release notes

  • Emitted chat spans are updated to comply with changes to the OTEL gen_ai specification.

    1.6.0release notes

  • The literals for the chat API were restructured.

    1.4.1release notes

  • The parse method now sets the index correctly.

    1.4.0release notes