Grok 4

Grok 4 is a text model from xAI with a context window of 256K tokens and max output of 256K tokens. Pricing starts at 3.00 per million input tokens and 15.00 per million output tokens (cheapest at Azure AI).

Capabilities

Vision Function Calling Reasoning JSON Schema System Messages Web Search Prompt Caching Audio Input Audio Output

Specifications

Model Keyxai/grok-4
ProviderxAI
Provider IDxai
ModeText
Canonical Namegrok-4
Context Window256K tokens
Max Output256K tokens

Pricing

TypePer 1K TokensPer 1M Tokens
Input Tokens0.00303.00
Output Tokens0.01515.00

Benchmarks

Intelligence Index41.5#25
Coding Index40.5#17
Math Index92.7#11
MMLU-Pro0.9#7
GPQA0.9#10
HLE0.2#20
LiveCodeBench0.8#15
AIME0.9#2
IFBench0.5#41
Time to First Token7.67s#222
SciCode0.5#15
MATH-5001.0#4
AIME 20250.9#11
LCR0.7#13
TerminalBench Hard0.4#16
TAU20.7#37

Price Comparison by Provider

Compare prices for Grok 4 across different providers. The same model may be available through multiple providers at different price points.

Provider
Model Key
Input Price, $
Output Price, $
xAIxai/grok-43.0015.00
Vercel AI Gatewayvercel_ai_gateway/xai/grok-43.0015.00
Replicatereplicate/xai/grok-47.2036.00
OpenRouteropenrouter/x-ai/grok-43.0015.00
Oracle Cloud (OCI)oci/xai.grok-43.0015.00
Azure AIazure_ai/grok-43.0015.00

All Variants

All available versions, regions, and API endpoints for Grok 4.

Model Key
Provider
Mode
Input Price, $
Output Price, $
Context
Max Output
Vision
Functions
azure_ai/grok-4Azure AIText3.0015.00131K131Knoyes
openrouter/x-ai/grok-4OpenRouterText3.0015.00256K256Knoyes
oci/xai.grok-4Oracle Cloud (OCI)Text3.0015.00128K128Knoyes
replicate/xai/grok-4ReplicateText7.2036.00N/AN/Anoyes
vercel_ai_gateway/xai/grok-4Vercel AI GatewayText3.0015.00256K256Knoyes
xai/grok-4xAIText3.0015.00256K256Knoyes
xai/grok-4-latestxAIText3.0015.00256K256Knoyes