How to Get a Free Grok (xAI) API Key (2026)

2 free models available — credit card may be required. Get your Grok (xAI) API key → Test free models →

Grok (xAI) FreeLLM Score

🔹 48/100 Niche Provider — Consider for stable service How we score →
🎁 Generosity 65 🌍 Access 25 📚 Breadth 25 ⚡ Reliability 100 🔌 Compat 65 🧠 Quality 5

All Free Grok (xAI) Models — Context Windows & Rate Limits

Model Context Max Output Modality Rate Limit Released Status
Grok-2 Mini 131K 0 text $25/month free credits, resets monthly Online
Grok-2 131K 0 text $25/month free credits, resets monthly Dec 12, 2024 Online

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)

How to Get a Grok (xAI) API Key

  1. 1
    Sign up at console.x.ai Credit card required. $25/month free credits, resets monthly.
  2. 2
    Go to API Keys
  3. 3
    Generate an API key
  4. 4
    Choose a model Grok-2 for chat + reasoning. Grok-2 Mini for lighter tasks.
  5. 5
    Configure OpenAI client Base URL: https://api.x.ai/v1

Grok (xAI) Free Tier Limits & Pricing

Credit Card Required
Free Tier $25/mo credits
Context Range 131K
Total Models 2 free
Rate Limits $25/month free credits, resets monthly
API Compatibility OpenAI SDK-compatible (Chat Completions)

Grok (xAI) API Setup Tutorial & Tools

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 →

Use Cases

What Grok (xAI)'s free models are best for, based on aggregated model capabilities:

Chat 2 models Reasoning 1 model

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)

Frequently Asked Questions

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).

See our FAQ for common questions about free LLM APIs