Introduction
What is Grok and xAI API
Grok is a family of Large Language Models (LLMs) developed by xAI.
Inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man, Grok is designed to answer almost any question with a touch of wit and humor, while also providing helpful and insightful responses. Grok utilizes next-token prediction model weights (models that predict the most likely word or symbol to follow a given text sequence) to know how to perform certain tasks.
Depending on the model specifications, a user can interact with a Grok model to find answers to questions, interpret images, and generate images.
xAI offers an API interface for developers to programmatically interact with Grok.
How is Grok trained?
Grok was pre-trained by xAI on a variety of data from publicly available sources and data sets reviewed and curated by AI Tutors who are human reviewers.
What is an API? Do I need it?
An API (Application Programming Interface) is a set of protocols and tools for building software and applications. It allows different software to communicate with each other, enabling developers to add Grok's functionalities to their own projects.
You probably won't need xAI API, if you're only interested in an AI assistant experience like the one offered at Grok on X. But to integrate Grok into your application, or to add Grok to some third-party tools that you might encouter, you would need to use xAI API.
Head to the Hitchhiker's Guide to Galaxy and you will find (almost) all you need to start using xAI API.
Grok on X vs xAI API
To illustrate more, here are some main differences between Grok on X and xAI API:
- Grok on X
- Accessible on: X or X Mobile Apps
- Programming knowledge: Not required
- Account: Managed by X
- Provides an AI assistant who helps complete tasks, like answering questions, generate images, solving problems, and brainstorming.
- xAI API
- Accessible via: xAI API Endpoint (
https://api.x.ai
) - Programming knowledge: Likely required
- Account: Managed by xAI
- API access that provides a programmatical way to interact with Grok. Developers can integrate Grok into applications to expand the capabilities of their applications.
- Accessible via: xAI API Endpoint (
This documentation is primarily focused on xAI API access.
Benefits of xAI API
- Customization: You can change inference prompt and different parameters to personalize Grok's responses.
- Automation: In some workflows, you might want to prompt the model with different prompts in sequence.