Grok (xAI) logo

Free Grok (xAI) API Key, Base URL & Rate Limits

API Provider

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.

OpenAI CompatibleFree Tier

How to get a free 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

Provider Snapshot

P Provider Type API Provider
O OpenAI Compatible Yes
U Base URL https://api.x.ai/v1
F Free Tier 2 free models online
P Phone Required Unknown
S Streaming Varies
T Function Calling Varies
V Vision Varies
L Last Updated 2026-06-27

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

K Save API Key Securely store and reuse your API keys. T Test API Key Test your API key and check quota.

Grok (xAI) FreeLLM Score free API access score

How we score →
48 /100
🔹 Niche Provider — Consider for stable service
Generosity Free limits and access terms
65
Access Signup and key availability
25
Model Breadth Free model coverage
25
Reliability Status and stability signals
100
Compatibility SDK and endpoint support
65
Quality Model capability signals
5

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

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

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:

Chat 2 models Reasoning 1 model

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