Text generation
Production-grade intelligence with low latency, unified billing and a developer-first interface.
Frontier models for reasoning, voice, vision, and more. One unified API, every modality, production-ready in minutes.
from xai_sdk import Client
from xai_sdk.chat import user
client = Client(api_key=os.getenv("XAI_API_KEY"))
chat = client.chat.create(model="grok-4.5")
chat.append(user("Explain quantum computing"))
print(chat.sample().content)Production-grade intelligence with low latency, unified billing and a developer-first interface.
Production-grade intelligence with low latency, unified billing and a developer-first interface.
Production-grade intelligence with low latency, unified billing and a developer-first interface.
Production-grade intelligence with low latency, unified billing and a developer-first interface.
Production-grade intelligence with low latency, unified billing and a developer-first interface.
Production-grade intelligence with low latency, unified billing and a developer-first interface.