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 initxai-sdk 192 changes
Breaking changes 3
The File model no longer includes team_id.
The document search tools are renamed.
Response handling now uses outputs instead of choices.
Security 1
Sensitive attributes can be excluded from traces.
Deprecations 1
Deprecates BaseImageResponse.prompt following removal of up_sampled_prompt from the proto.
New APIs and options 67
Adds guidelines to chat.create.
Adds safety_identifier to chat.create.
Video generation adds support for a last frame and keyframes.
An image_generation server-side tool is added.
Image generation gains a quality parameter.
Video generation gains generate_audio.
Video generation gains reference_audios.
Video generation adds 1080p.
Adds grok-4.6 to ChatModel.
Accepts xhigh as a reasoning_effort value.
Adds service_tier support for priority processing.
Image and video generation now accept file-ID inputs.
Adds Imagine file storage for developers working with image and video generation.
Adds list filtering to the files client.
Adds public file URLs to the files client.
Adds support for context compaction.
Adds grok-build-0.1 to ChatModel, making it available for use as a chat model.
Adds SERVER_SIDE_TOOL_IMAGE_SEARCH to the enum.
Adds enable_image_search to web_search.
Adds prepare_extension() for batch video extension.
Adds none and medium reasoning effort levels.
Adds grok-4.3 as a ChatModel option.
Bytes chunking was added.
Collection descriptions were added.
Image and video responses now expose cost_usd tracking.
File uploads now support expires_after.
Adds URL support for FileContent.
Adds support for inline file attachments.
Adds support for reference_image_urls.
Adds a video extension API to the xAI Python SDK.
Adds batch support for image and video operations.
Adds input_file_id support.
Added the agent_count parameter to the chat API for multi-agent models.
Added grok-4.20 experimental beta and multi-agent model variants to ChatModel.
Added grok-imagine-image-pro as an ImageGenerationModel.
Adds support for 2K image resolution.
Adds the image_urls parameter to support multi-reference image editing.
Adds support for the Imagine image/video API.
Adds support for the batch API.
Adds the developer role.
Adds a tool_call_id field.
Web-search tools support user-location information.
The Chunk class gains inline citations support.
Adds new features to the Collections API client.
Adds end_index to document search tools.
Adds the verbose_streaming include option.
The Response class gains inline citations support.
Adds utility functions to retrieve server-side tool outputs.
The SDK supports including inline citations.
Chat creation accepts a max_turns parameter for agentic conversations.
Request metadata now also includes the language.
Tool calls gain a status field in the proto definitions.
The SDK supports including tool output.
Clients gain context manager support and proper channel cleanup.
Proto changes and a utility function add collections-search support.
Chat responses support debug output.
Chat responses support encrypted content.
The SDK adds client support for the Files API.
Clients can be configured to use an insecure gRPC channel.
A remote MCP tool is added.
ToolCall supports ToolCallType.
The usage enum adds SERVER_SIDE_TOOL_MCP and SERVER_SIDE_TOOL_COLLECTIONS_SEARCH.
The SDK version is added to request metadata.
The chat service supports multiple outputs in chunks and responses.
Added convenience functions for using new server-side tools.
Added proto support for server-side tools.
Adds support for new X source parameters for live search.
Performance 1
Lazy buffering reduces memory usage for streaming chat responses.
Behavior and default changes 11
Allows protobuf 7.
The default gRPC User-Agent is now XaiSdk/{version}.
Updated grok-4.20 and multi-agent model variants in ChatModel, changing the model variants developers can use.
Updates the grok-4.20 beta and multi-agent model variants available in ChatModel.
Reduces the default PollTimer poll interval.
Introduces default video polling settings.
Adds instrumentation to Collections methods.
Adds instrumentation to File methods.
All output entries are appended for agentic responses.
chat.create accepts a Pydantic BaseModel directly as response_format.
Chat automatically detects implicit server-side tool additions.
Tooling 1
Adds Grok Imagine models to types/model.py for editor autocomplete.
Fixes and other changes 7
Replaying tool outputs via chat.append(response) now sets tool_call_id.
Field definitions were updated.
Fixes handling of unknown statuses in polling loops.
Handles a video generation failure case.
Emitted chat spans are updated to comply with changes to the OTEL gen_ai specification.
The literals for the chat API were restructured.
The parse method now sets the index correctly.