← Back to API models

Grok 4

by xAI · premium reasoning model

xAI's heavy-reasoning model. Real-time X integration, distinctive voice, premium price.

Input $3 / 1M
Output $15 / 1M
Context 256K tokens
Live data X timeline
xAI Console ↗ Updated May 20, 2026
§ API pricing

Per-token rates.

Input
$3/1M tokens
Prompt tokens
  • Matches Claude Sonnet 4.6 on input
  • 20% above GPT-5.4 ($2.50)
  • Vision inputs billed as tokens
Output
$15/1M tokens
Completion tokens
  • Identical to Sonnet 4.6 and GPT-5.4
  • Half of GPT-5.5 output
  • Includes reasoning tokens
Context
256Ktokens
Window
  • Above the 200K Claude line
  • Below the 272K GPT-5.4 line
  • Grok 4.1 Fast pushes to 2M
Newer flagship
$2/$6 per 1M
Grok 4.20
  • xAI's 2026 flagship release
  • Cheaper than Grok 4 across the board
  • Powers SuperGrok / X Premium+

Grok 4 in context

Grok 4 was xAI's first serious push into the frontier reasoning tier. It's still on the price list at $3 input and $15 output per 1M tokens with a 256K window — the same shape as Claude Sonnet 4.6 and GPT-5.4 — but the spotlight has moved to Grok 4.20, the 2026 flagship that ships at $2 input and $6 output. Grok 4 remains worth choosing when you want xAI's specific reasoning style at premium output quality.

What you really pay for with the Grok family is real-time access to the X (Twitter) timeline and a model voice that's noticeably less filtered than the OpenAI and Anthropic equivalents. For some workloads that's a feature; for compliance-bound enterprises, it's a liability.

Capabilities

Grok 4 is a strong reasoner, particularly on math and structured logic, and a competent generalist on writing and code. The Deep Search tool surfaces live web and X content during a request, which makes Grok the easiest way to ask "what happened on X in the last hour" without writing your own scraping layer. Vision and image editing are supported; image generation is delegated to other xAI products.

Weaknesses: tool-use ergonomics lag the OpenAI Responses API, and the model's safety tuning is opinionated in ways your end users may or may not appreciate. Pick deliberately.

Typical use cases

  • Real-time monitoring of X conversations and trending topics
  • Premium reasoning where you want a non-OpenAI alternative
  • Research assistants that need Deep Search on the live web
  • Less-filtered chat for adult or political workloads
  • Vision and image-editing prototypes

Sibling and rival comparison

ModelInput / 1MOutput / 1MContext
Grok 4$3$15256K
Grok 4.20$2$6256K
Grok 4.1 Fast$0.20$0.502M
Claude Sonnet 4.6$3$15200K (1M β)

If you don't specifically need Grok 4, the newer Grok 4.20 is cheaper and faster. Versus Sonnet 4.6 — the closest cross-family rival on price — Grok 4 trades writing polish for real-time X data and a different model voice.

← See all xAI / Grok plans