xai-sdk-python
The official Python SDK for the xAI API
File Explorer
Download Latest Version (.zip)- bug_report.yml
- config.yml
- feature_request.yml
- auto-tag.yaml
- ci.yaml
- release.yaml
- validate-version-bump.yaml
- CODEOWNERS
- PULL_REQUEST_TEMPLATE.md
- auth.py
- batch_request.py
- chat.py
- collection.py
- collections_tool.py
- compaction.py
- deferred_chat.py
- files.py
- files_chat.py
- function_calling.py
- image_generation.py
- image_generation_tool.py
- image_multi_reference_editing.py
- image_understanding.py
- inline_files_chat.py
- models.py
- reasoning.py
- server_side_tools.py
- stored_chat.py
- structured_outputs.py
- telemetry.py
- tokenizer.py
- video_extension.py
- video_generation.py
- auth.py
- batch_request.py
- chat.py
- collection.py
- collections_tool.py
- compaction.py
- deferred_chat.py
- files.py
- files_chat.py
- function_calling.py
- image_generation.py
- image_generation_tool.py
- image_multi_reference_editing.py
- image_understanding.py
- inline_files_chat.py
- models.py
- reasoning.py
- server_side_tools.py
- stored_chat.py
- structured_outputs.py
- telemetry.py
- tokenizer.py
- video_extension.py
- video_generation.py
- __init__.py
- auth.py
- batch.py
- chat.py
- client.py
- collections.py
- files.py
- image.py
- models.py
- tokenizer.py
- video.py
- auth_pb2.py
- auth_pb2.pyi
- auth_pb2_grpc.py
- batch_pb2.py
- batch_pb2.pyi
- batch_pb2_grpc.py
- chat_pb2.py
- chat_pb2.pyi
- chat_pb2_grpc.py
- collections_pb2.py
- collections_pb2.pyi
- collections_pb2_grpc.py
- deferred_pb2.py
- deferred_pb2.pyi
- deferred_pb2_grpc.py
- documents_pb2.py
- documents_pb2.pyi
- documents_pb2_grpc.py
- embed_pb2.py
- embed_pb2.pyi
- embed_pb2_grpc.py
- files_pb2.py
- files_pb2.pyi
- files_pb2_grpc.py
- image_pb2.py
- image_pb2.pyi
- image_pb2_grpc.py
- models_pb2.py
- models_pb2.pyi
- models_pb2_grpc.py
- sample_pb2.py
- sample_pb2.pyi
- sample_pb2_grpc.py
- shared_pb2.py
- shared_pb2.pyi
- shared_pb2_grpc.py
- tokenize_pb2.py
- tokenize_pb2.pyi
- tokenize_pb2_grpc.py
- types_pb2.py
- types_pb2.pyi
- types_pb2_grpc.py
- usage_pb2.py
- usage_pb2.pyi
- usage_pb2_grpc.py
- video_pb2.py
- video_pb2.pyi
- video_pb2_grpc.py
- auth_pb2.py
- auth_pb2.pyi
- auth_pb2_grpc.py
- batch_pb2.py
- batch_pb2.pyi
- batch_pb2_grpc.py
- chat_pb2.py
- chat_pb2.pyi
- chat_pb2_grpc.py
- collections_pb2.py
- collections_pb2.pyi
- collections_pb2_grpc.py
- deferred_pb2.py
- deferred_pb2.pyi
- deferred_pb2_grpc.py
- documents_pb2.py
- documents_pb2.pyi
- documents_pb2_grpc.py
- embed_pb2.py
- embed_pb2.pyi
- embed_pb2_grpc.py
- files_pb2.py
- files_pb2.pyi
- files_pb2_grpc.py
- image_pb2.py
- image_pb2.pyi
- image_pb2_grpc.py
- models_pb2.py
- models_pb2.pyi
- models_pb2_grpc.py
- sample_pb2.py
- sample_pb2.pyi
- sample_pb2_grpc.py
- shared_pb2.py
- shared_pb2.pyi
- shared_pb2_grpc.py
- tokenize_pb2.py
- tokenize_pb2.pyi
- tokenize_pb2_grpc.py
- types_pb2.py
- types_pb2.pyi
- types_pb2_grpc.py
- usage_pb2.py
- usage_pb2.pyi
- usage_pb2_grpc.py
- video_pb2.py
- video_pb2.pyi
- video_pb2_grpc.py
- __init__.py
- __init__.py
- auth.py
- batch.py
- chat.py
- client.py
- collections.py
- files.py
- image.py
- models.py
- tokenizer.py
- video.py
- __init__.py
- config.py
- __init__.py
- chat.py
- common.py
- image.py
- model.py
- video.py
- __about__.py
- __init__.py
- auth.py
- batch.py
- chat.py
- client.py
- collections.py
- cost.py
- files.py
- image.py
- interceptors.py
- meta.py
- models.py
- poll_timer.py
- search.py
- service_tier.py
- tokenizer.py
- tools.py
- video.py
- __init__.py
- auth_test.py
- batch_test.py
- chat_test.py
- client_test.py
- collections_test.py
- files_test.py
- image_test.py
- models_test.py
- tokenize_test.py
- video_test.py
- __init__.py
- auth_test.py
- batch_test.py
- chat_test.py
- client_test.py
- collections_test.py
- files_test.py
- image_test.py
- models_test.py
- tokenize_test.py
- video_test.py
- __init__.py
- chat_test.py
- file_content_test.py
- server.py
- telemetry_test.py
- test.jpg
- .gitignore
- .gitleaks.toml
- .pre-commit-config.yaml
- CHANGELOG.md
- CLA.md
- CONTRIBUTING.md
- LICENSE
- pyproject.toml
- README.md
- SECURITY.md
- uv.lock
๐ Installation Guide
git clone https://github.com/xai-org/xai-sdk-python
Downloads the entire project code from GitHub to your computer.
cd xai-sdk-python
Moves into the project folder you just downloaded.
2. Official Install Script
Easy Recommended- Python 3 Python is required to use pip.
pip install xai-sdk
Installs the package published on PyPI directly โ no need to clone the source.
pip install xai-sdk[telemetry-http]
Installs the package published on PyPI directly โ no need to clone the source.
pip install xai-sdk[telemetry-grpc]
Installs the package published on PyPI directly โ no need to clone the source.
Pulled directly from this repo's README.
3. Python
Easypip install xai-sdk
Installs the package published on PyPI directly โ no need to clone the source.
pip install xai-sdk[telemetry-http]
Installs the package published on PyPI directly โ no need to clone the source.
pip install xai-sdk[telemetry-grpc]
Installs the package published on PyPI directly โ no need to clone the source.
pip show xai-sdk
Type this command into your terminal and run it.
uv pip show xai-sdk
Type this command into your terminal and run it.
Pulled directly from this repo's README.
