Free Grok (xAI) API Key, Base URL & Rate Limits
API ProviderxAI (Elon Musk's AI company) offers the Grok-2 and Grok-2 Mini models through a free API tier with $25/month in free credits that reset monthly.
How to get a free Grok (xAI) API key
- 1 Sign up at console.x.ai Credit card required. $25/month free credits, resets monthly.
- 2 Go to API Keys
- 3 Generate an API key
- 4 Choose a model Grok-2 for chat + reasoning. Grok-2 Mini for lighter tasks.
- 5 Configure OpenAI client Base URL: https://api.x.ai/v1
Provider Snapshot
Supported Models 2 models
View in directory →| Model ID | Developer | Context | Availability | Free Tier | Use cases |
|---|---|---|---|---|---|
| grok-2-mini Grok-2 Mini | Grok (xAI) | 131K | Online | Yes | chat |
| grok-2 Grok-2 | xAI | 131K | Online | Yes | chatreasoning |
Developer Tools
Grok (xAI) FreeLLM Score free API access score
How we score →What is Grok (xAI)?
Grok-2 and Grok-2 Mini from xAI — $25/month free credits.
xAI (Elon Musk's AI company) offers the Grok-2 and Grok-2 Mini models through a free API tier with $25/month in free credits that reset monthly. Requires a credit card to sign up. The API is fully OpenAI-compatible, making it a drop-in replacement for any OpenAI-compatible client.
- $25/month free credits
- Grok-2: chat + reasoning
- Grok-2 Mini: fast, lightweight
- OpenAI-compatible endpoint
API Compatibility: OpenAI SDK-compatible (Chat Completions)
Grok (xAI) Free Tier Limits & Pricing
Grok (xAI) API Setup Tutorials
Grok (xAI) is fully compatible with popular AI coding assistants like Cursor, Claude Code, and more. To see step-by-step API configuration instructions for your favorite tool, please visit our Global Configuration Guide →
Grok (xAI) Model Use Cases
What Grok (xAI)'s free models are best for, based on aggregated model capabilities:
Grok (xAI) Limitations & Caveats
- Credit card required — not truly free without payment method
- $25/month free credits reset monthly — unused credits do not roll over
- Limited model selection (Grok-2 and Grok-2 Mini only)
Grok (xAI) FAQ
Is xAI's $25/month free credit really free?
Technically it's a promotional credit, not a free tier. You must provide a credit card to sign up, and the $25 resets monthly. If you don't use it, you lose it — no rollover.
How does Grok-2 compare to GPT-4o or Gemini 2.5?
Grok-2 is competitive for chat and reasoning tasks, though benchmarks generally place it slightly below GPT-4o and Gemini 2.5 Pro. Grok-2 Mini is faster and lighter, suitable for simple tasks.
Can I use xAI API with Claude Code?
xAI's API is OpenAI-compatible, but Claude Code specifically requires an Anthropic-compatible endpoint. You'd need to use xAI with tools that support custom OpenAI endpoints (Cursor, Codex, OpenCode).