For developers

One API.
Every modality.

Text, code, voice, images, and video — all through a single unified API. Start building in seconds.

1M+
API calls per day
<200ms
Median latency
5+
Model families
import osfrom xai_sdk import Clientfrom xai_sdk.chat import userclient = Client(    api_key=os.getenv("XAI_API_KEY"))chat = client.chat.create(model="grok-4.5")chat.append(user("Explain quantum computing"))response = chat.sample()print(response.content)

Choose how to get started

Build on your own

Launch your AI-powered product with:


  • Access to all Grok models
  • Usage-based pricing
  • Automatically increasing rate limits
  • Comprehensive documentation and guides

Get extra support

Custom rate limits and hands-on support for your team.


  • Dedicated onboarding support
  • Custom rate limits
  • Billing via monthly invoices
  • Single sign-on and audit logging
  • Data residency options