# xAI Python SDK — card for AI agents

Official Python SDK for xAI's Grok models.

Category: Model SDKs · PyPI package `xai-sdk` · latest version 1.21.0 (checked 2026-11-01)
Install: `pip install xai-sdk`
License: Apache-2.0 (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Numbers (AgentGid data)
- Gid Score: 34.4 (#3731 of all tools, 68 of 92 in its category)
- Used in 1 public projects set up for AI coding agents (0.0%)
- Downloads last week: 864,994 (as of 2026-11-24), -17.3% over 4 weeks
- GitHub stars: 623 (as of 2026-11-24)
- Last push: 2026-10-30

## Often used with
python-dotenv 100.0%, aiohttp 84.2%, Google GenAI Python SDK 84.2%, OpenAI Python Library 84.2%, Requests 84.2%, cryptography 78.9%

## Links
- AgentGid page: https://agentgid.com/tools/xai-sdk/
- Homepage: https://github.com/xai-org/xai-sdk-python
- Repository: https://github.com/xai-org/xai-sdk-python

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
