flagship

Grok 4 vs Grok 3

Side-by-side pricing, context window, features, and per-use-case verdict. Data sourced from LiteLLM, updated regularly.

Specifications

Feature Grok 4 Grok 3
Provider xai xai
Model ID xai/grok-4 xai/grok-3
Input / 1M tokens $3.00 $3.00
Output / 1M tokens $15.00 $15.00
Cached input / 1M $0.75
Context window 256kk tokens 131kk tokens
Max output 256kk tokens 131kk tokens
Vision
Function calling
Prompt caching
Web search
JSON schema

Monthly cost comparison

No cache discount applied — pure token costs at three usage scales.

Scale Grok 4 Grok 3 Winner
Small
1M in / 0.2M out
$6.00 $6.00 Grok 4
Medium
10M in / 2M out
$60.00 $60.00 Grok 4
Large
100M in / 20M out
$600 $600 Grok 4

Category winners

Cheapest input
Grok 4
$3.00/M
Cheapest output
Grok 4
$15.00/M
Larger context
Grok 4
256kk tokens · 95% larger window
More features
Grok 4
3 / 5 capabilities (tied)

Better for…

High-volume RAG & repeated context
$0.75/M cached input — prompt caching makes repeated context retrieval significantly cheaper
Grok 3
Short interactions & high-throughput APIs
$15.00/M output — 0% cheaper on output at scale
Grok 4
Long-document processing & large codebases
256k context window vs 131k — 95% larger context
Grok 4

Deep-dive on each model

Pricing data sourced from LiteLLM and refreshed regularly. Always verify with each provider's official pricing page before making business decisions.