xAI Grok API
The Grok API lets developers integrate xAI’s Grok LLMs into applications.
xAI’s Grok is the LLM developed by Elon Musk’s AI company, trained on X (Twitter) data and offering unique real-time web search capabilities. Grok-3 is the flagship model, competitive with top-tier models on reasoning and scientific tasks. The API is OpenAI-compatible, making it easy to switch. A particularly differentiating feature is its integration with X/Twitter data streams, making it ideal for social media analytics and real-time information tasks. The $25 monthly free credit makes it one of the most generous free tiers available.
API Details
Categories
Frequently Asked Questions
Grok is built by Elon Musk's xAI and trained on X (Twitter) data, giving it unique capabilities for social media analysis and real-time information. Grok-3 is the flagship model and competitive with GPT-4o. The API includes a live search tool that can access real-time web and X data, which most other models lack natively.
Grok-3 costs $3 per million input tokens and $15 per million output tokens. Grok-3 Mini is more affordable at $0.30/$0.50 per million tokens. New accounts receive $25 in free credits monthly u2014 one of the most generous free tiers available. There is also a free tier at reduced rate limits.
Yes. The Grok API uses an OpenAI-compatible interface at api.x.ai. You can use the OpenAI Python or Node.js SDK by changing the base URL and API key. Model names like grok-3 replace gpt-4o in your requests. This makes switching or A/B testing between Grok and OpenAI straightforward.
Yes. Grok has built-in web search capability and access to real-time X (Twitter) data. You can enable live search via the API by including the search tool in your request. This distinguishes it from most other models that have a fixed knowledge cutoff and cannot access current events natively.
