Category API Services
What xAI API is
The API is described as programmatic access to Grok base models with text and image input. It offers a 128,000-token context, function calling, system prompts and compatibility with OpenAI and Anthropic APIs.
What you can do with it
- Call Grok base models from code
- Send text and image input in a multimodal version
- Use function calling and system prompts
- Keep a 128,000-token context window
Application scenarios
- Create chatbots with Grok models
- Build image recognition apps from image input
- Shape model behaviour with system prompts for business needs
Getting started
- Register an account on the xAI console
- Create an xAI API key in the console
- Change base_url when using the OpenAI Python SDK
- Read the xAI documentation for API usage
Pros & cons
✓ What we like
- Compatible with OpenAI and Anthropic APIs to ease migration
- Public beta includes 25 dollars of free API credits per user each month
! What to watch out for
- Access runs through a public beta until the end of 2024
- Migration relies on changing the base_url in the OpenAI Python SDK
FAQ
How long is the context?
The material states a 128,000-token context length.
Is there a free allowance?
During the public beta, each user gets 25 dollars of free API credits per month.
Last reviewed: 2026-11-15
More LLM API platform tools
View all →-
302.AI Aggregated cloud platform that hosts hundreds of large models behind one API Developer tools API integration Multi model platform Model deployment LLM API platform -
360智脑开放平台 360 model API platform API integration Multi model platform Knowledge base Q&A Enterprise automation LLM API platform -
4o Image API Image generation API gateway Free tools Freemium tools Developer tools API integration LLM API platform -
AI-Flow No-code multi-model workflows Workflow automation Developer tools API integration Knowledge base Q&A LLM API platform -
AI/ML API Single gateway to many models Developer tools API integration Multimodal Multi model platform LLM API platform -
Amazon Bedrock AWS code suggestions with security scans Free tools Code assistant IDE App builder LLM API platform