What's up, Developers?
First time xAI API or Large Language Model API user? Go to the Introduction for a brief background on Grok and interacting with LLM through API.
Getting started
Ready to build? Go to our Hitchhiker's Guide to Grok.
Quick reference
Featured Models
Our latest text model supporting structured outputs, with improved efficiency, speed and capabilities.
Our latest image understanding model with increased context window that can process a wide variety of visual information, including documents, diagrams, charts, screenshots, and photographs.
For previous models that are available, visit Models and Pricing. Actual availability might be different for you team. You can view models and pricing available to your team from the xAI Console Models Page.
Migrating from another LLM provider?
With just two line changes to your code, you're on Grok! Our API endpoint is designed to be compatible with OpenAI and Anthropic SDKs except capabilities not offered by the SDK.
You might want to read our guide Migration from Other Providers for more information and caveats.
OpenAI SDK
Anthropic SDK
Change the model
in your request to one of the models on xAI and you're all set!
Questions and feedback
If you have any questions or feedback, feel free to email us at support@x.ai.
Happy Grokking! 😎