xAI 4 min read

Grok Not Working?

xAI API 401 (wrong base URL — use api.x.ai/v1, not api.openai.com), model not found (grok-3-beta, not grok), Grok chat on X needs Premium subscription, or 503 outage? Fix it fast.

xAI Grok live status

xAI Grok — live status

Updated every 5 minutes. Full history at prismix.dev/service/xai.

Full status →

What's wrong? Diagnose fast

🔑

API 401 — wrong base URL

Most common mistake: using OpenAI's URL with Grok. The correct xAI base URL is https://api.x.ai/v1 (NOT https://api.openai.com/v1). Key starts with "xai-", generated at console.x.ai. Auth: Authorization: Bearer xai-YOUR_KEY. OpenAI SDK: set base_url="https://api.x.ai/v1".

💬

Model not found — wrong IDs

Exact model IDs: grok-3-beta (most capable, 131k ctx), grok-3-mini-beta (fast, cheap), grok-2-vision-1212 (vision), grok-2-1212 (stable). NOT valid: "grok", "grok-1", "grok-3", "grok-beta". Get current list: GET https://api.x.ai/v1/models.

Rate limit 429

Free tier (early access): 25 requests/hour, 60,000 tokens/hour. On 429: check x-ratelimit-remaining and x-ratelimit-reset headers, implement exponential backoff (5s start). Paid tier available at console.x.ai for higher limits.

🐦

Grok chat on X not responding

Grok on X (Twitter) requires X Premium or Premium+ subscription ($8-16/mo). Verify at x.com/i/premium. Grok image generation needs Premium+. Alternative: use grok.com directly (works the same, sometimes faster). Check status.x.ai for platform-wide outages.

📏

Context limit exceeded

Grok-3-beta and grok-3-mini-beta: 131,072 token context (prompt + completion combined). Grok-2-1212: 131,072 tokens. For conversations over 100k tokens: summarize history, truncate old messages. If you hit context limits with the default models, this is the maximum — no larger context variant available.

🖼

Vision not working

Vision requires grok-2-vision-1212 model specifically. Pass image as base64 or URL in messages array: {"type": "image_url", "image_url": {"url": "https://..."}}. Grok-3-beta does NOT support vision as of 2025 — use grok-2-vision-1212 for image input.

xAI Grok API quick reference

OpenAI SDK (drop-in — just change base_url)

from openai import OpenAI

client = OpenAI(
    base_url="https://api.x.ai/v1",   # NOT api.openai.com
    api_key="xai-YOUR_KEY",            # key starts with xai-
)

response = client.chat.completions.create(
    model="grok-3-beta",               # NOT "grok" or "grok-3"
    messages=[{"role": "user", "content": "What is 2+2?"}],
    max_tokens=1024,
)
print(response.choices[0].message.content)

Vision (image understanding)

response = client.chat.completions.create(
    model="grok-2-vision-1212",   # use THIS model for vision, not grok-3-beta
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "What's in this image?"},
            {"type": "image_url", "image_url": {"url": "https://example.com/img.jpg"}}
        ]
    }],
)

curl — verify authentication

curl https://api.x.ai/v1/chat/completions \
  -H "Authorization: Bearer xai-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-3-mini-beta",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

# List available models:
curl https://api.x.ai/v1/models -H "Authorization: Bearer xai-YOUR_KEY"

Grok models quick reference

Model ID Context Capabilities
grok-3-beta 131,072 tokens Best quality, text only
grok-3-mini-beta 131,072 tokens Fast + cheap, text only, reasoning
grok-2-vision-1212 131,072 tokens Text + image understanding
grok-2-1212 131,072 tokens Stable release, GPT-4-level quality

Step-by-step fix

  1. 1

    Check live xAI status

    Visit prismix.dev/service/xai. Also status.x.ai. xAI API and grok.com have independent uptime from the X (Twitter) platform.

  2. 2

    Fix API 401 — correct base URL

    Base URL: https://api.x.ai/v1 (NOT api.openai.com). Key: xai-YOUR_KEY. Auth: Authorization: Bearer xai-YOUR_KEY. Generate at console.x.ai.

  3. 3

    Fix model not found

    Use grok-3-beta or grok-3-mini-beta. For vision: grok-2-vision-1212. List all: GET /v1/models.

  4. 4

    Fix rate limit 429

    Free tier: 25 req/hr. Check x-ratelimit-reset header for when it resets. Exponential backoff: start at 5s. Upgrade at console.x.ai for higher limits.

  5. 5

    Fix Grok on X (chat)

    Requires X Premium or Premium+ subscription. Verify at x.com/i/premium. Alternatively use grok.com directly — same features, independent uptime from X app.

🔔

Get alerted when xAI Grok goes down

Star xAI on Prismix and get emailed the moment status changes. Free, no credit card.

Frequently asked questions

Why is Grok not working?

Grok issues: (1) API 401 — wrong base URL (use api.x.ai/v1 not api.openai.com); (2) model 404 — use grok-3-beta or grok-3-mini-beta (not "grok" or "grok-3"); (3) 429 rate limit — 25 req/hr free; (4) Grok on X chat — requires X Premium subscription; (5) outage — prismix.dev/service/xai.

Is Grok down right now?

Check prismix.dev/service/xai for live status. Also status.x.ai. xAI API and grok.com are independent from the X (Twitter) platform outages.

xAI Grok API 401 — what is the correct base URL?

xAI API base URL: https://api.x.ai/v1 (NOT https://api.openai.com/v1 — this is the #1 mistake when copying OpenAI code). OpenAI SDK: OpenAI(base_url="https://api.x.ai/v1", api_key="xai-YOUR_KEY"). Generate key at console.x.ai. Standard Bearer auth.

What model IDs does xAI Grok support?

Valid model IDs: grok-3-beta, grok-3-mini-beta, grok-2-vision-1212, grok-2-1212. Invalid: "grok", "grok-1", "grok-3", "grok-beta". Get current list: GET https://api.x.ai/v1/models with auth header. grok-3-mini-beta is the cheapest; grok-3-beta is the most capable.

Is xAI Grok free to use?

Grok on X (grok.com, X app): free for a limited number of messages, unlimited for X Premium ($8/mo) and Premium+ ($16/mo) subscribers. Grok image generation: Premium+ only. xAI API (api.x.ai/v1): requires a separate API key from console.x.ai, pay-as-you-go pricing. Early access program may offer free credits.

Related LLM APIs