BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News xAI Unveils a New API Service for Grok Models

xAI Unveils a New API Service for Grok Models

Elon Musk’s xAI has launched a public beta for its API service, enabling developers to integrate xAI's large language models (LLMs) into their applications.

Musk announced the service's availability on X, stating:

The @xAI API is now live!

The xAI API, similar to those offered by OpenAI and Anthropic, provides access to xAI's Grok models via the xAI Console. Currently, only the Grok-beta model is available, while Grok-2 and Grok-2 mini are expected to be accessible soon. Grok models can generate and understand text, code, and images.

The xAI Console serves as a centralized hub for developers, offering tools for API key creation, team management, billing, model comparison, usage tracking, and access to API documentation. Notably, xAI's inference servers support multiple regions, and the backend system is developed in Rust. However, during the beta phase, the service is limited to the us-east region.

In terms of pricing, the xAI API differs from OpenAI's models. According to the API portal, Grok-2 and Grok-2 mini are priced higher than OpenAI's GPT-4o and GPT-4o mini. The Grok-beta can handle 131,072 tokens for both input and output, while OpenAI's GPT-4o supports 1 million tokens. Grok-beta costs $5 for 131,072 input tokens, compared to GPT-4o's $2.50 for 1 million. For output, Grok-beta charges $15 for its limited token count, while GPT-4o costs $10 for 1 million tokens. Additionally, OpenAI provides Batch API pricing that is at least 50% cheaper than standard API requests.

Developer Ofer Mendelevitch expressed their enthusiasm on the X platform:

Congrats on the @xai API being live. Grok-beta shows a 4.6% hallucination rate on @vectara hallucination leaderboard

While software developer Aleksandr Vasilenko, shared in Reddit:

xAI API is expensive and the console is very slow. Also there is no playground on the console, you need to interact with the API directly by making API calls yourself.

Other notable features of the xAI API include the ability to integrate with OpenAI and Anthropic SDKs using JavaScript and Python. Developers can also implement xAI APIs in their applications via REST, gRPC, or the xAI Python SDK, as detailed in the documentation.

About the Author

Rate this Article

Adoption
Style

BT