x-ai/grok-4.6

SpaceXAI: Grok 4.6

Context length
500K
Input / 1M tokens
$2.00
Output / 1M tokens
$6.00
Released
2026-08-12
Modality
text+image+file->text

About SpaceXAI: Grok 4.6

Grok 4.6 is a model from SpaceXAI with frontier performance on coding, knowledge work, and STEM. It is succeeded by [Grok 4.7](/x-ai/grok-4.7).

Call SpaceXAI: Grok 4.6

Via OpenRouter: one base URL for every provider.

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "x-ai/grok-4.6",
    "messages": [{"role": "user", "content": "Say hello"}]
  }'

Direct on xAI (Grok):

curl https://api.x.ai/v1/chat/completions \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.6",
    "messages": [{"role": "user", "content": "Say hello"}]
  }'

xAI (Grok) keys

OpenRouter keys

OpenRouter keys work for x-ai/grok-4.6 regardless of the upstream provider.