xAI opens Grok’s AI API in public beta
xAI is launching a public API that lets developers integrate Grok into their applications. The beta offers $25 in free credits per month and includes a model with 128,000 context tokens, advanced features, and a future version capable of analyzing images.

xAI now lets developers build applications with Grok models through a public API. The beta will remain active until the end of 2024 and will offer $25 in free credits per month to test the service.
To get started, you need to create an account at console.x.ai and generate an API key. Developers can then connect Grok to their own applications, automations, and services without having to use the X interface.
A model with a large context window
The beta begins with grok-beta, a model still in the final stages of development. Its main capability is handling up to 128,000 context tokens, meaning a large amount of text in a single conversation or request.
In practice, this lets you work with lengthy documents, analyze long histories, or maintain detailed instructions without splitting the content into many parts. The model also supports two important features:
- Function calling, which lets the AI request specific actions from an application, such as querying a database or making a reservation.
- System prompts, instructions that define the model’s behavior before a conversation begins.
xAI also announced a multimodal version capable of analyzing images. It is expected to arrive the week after the initial launch, although the company has not yet detailed all of its features.
Migrating from other APIs will be easier
The xAI API is compatible with the formats used by OpenAI and Anthropic. This means that a project already using, for example, OpenAI’s Python SDK can start testing Grok by changing the base URL to https://api.x.ai/v1 and using a key created in the xAI console.
That detail reduces the technical work for teams that want to compare models or add Grok to an existing application. They do not need to rebuild the entire integration from scratch.
During the beta, each user will receive $25 in free credit each month until the end of the year. Anyone who had already purchased prepaid credits will also receive an equivalent amount each month during November and December.
For example, someone who had purchased $50 will receive $25 in free credit plus an additional $50 in each of those two months, according to xAI’s announcement.
For you, this means Grok is no longer limited to a chat experience and can now be integrated directly into products and services. What remains to be seen is how the model will perform outside the preview and what pricing, limits, and capabilities it will retain when the beta ends.