Grok 4
Grok 4 is a legacy integration reference; evaluate Grok 4.3 before starting new work.
Use it for
- Teams maintaining an existing integration
- Workloads that can use a 256k context window
- Buyers comparing 3 tracked provider routes
Do not use it for
- New production launches
- Family
- Grok 4
- Released
- 2025-07-09
- Context
- 256k
- Architecture
- Decoder Only
- Specialization
- general
- Openness
- Proprietary
- License
- ProprietaryCommercial use: conditional
- Weights
- Not released
- Code
- Unknown
- Training
- Pretrained
Cheapest of 4 routes · OpenRouter
This model is deprecated. xAI recommends switching to Grok 4.3.
About
Original Grok 4 API model (grok-4-0709) with 256K context, reasoning, text and image input, function calling, structured outputs, live browsing, and code execution support. xAI lists May 15, 2026 as the API retirement date for this model; new integrations should use Grok 4.3.
Grok 4 is a proprietary model. The structured metadata tracks a 256k-token context window, multimodal input, reasoning, function calling, tool use, structured outputs, and code execution. This page tracks provider routes through Microsoft Foundry, OpenRouter, Replicate API, and 1 more, with the cheapest tracked route listed at $1.25 input and $2.5 output per 1M tokens. Headline tracked benchmarks include Aider Polyglot 79.6, MMLU PRO 87.0, and SWE-bench Verified 76.7.
Top use-case fit: coding, agents, and build tasks
Coding
3 relevant benchmarks in the decision map.
RAG
Included by capability and metadata signals in the decision map.
Agents
2 relevant benchmarks in the decision map.
Provider price ladder
Compare all 4Compare API pricing across 3 providers for input and output tokens, batch, and cached reads when available.
| Provider | Input / 1M | Output / 1M | Route |
|---|---|---|---|
| OpenRouter | $3.00 | $15.00 | Serverless |
| Replicate API | $7.20 | $36.00 | Serverless |
| Microsoft Foundry | - | - | ServerlessProvisionedPartial |
Available via routers & gateways(6)
LiteLLM
GatewayOpen-source Python SDK and proxy server that unifies 100+ LLM APIs behind a single OpenAI-compatible interface, with load balancing, cost tracking, and configurable failover.
OpenRouter
HybridUnified hybrid gateway to 400+ models from 60+ providers via a single OpenAI-compatible API, with optional auto-routing that selects the best model per prompt.
Portkey
GatewayProduction AI gateway routing to 1,600+ LLMs with failover, load balancing, semantic caching, and guardrails; Apache 2.0 core is fully self-hostable with the complete feature set.
Azure AI Foundry Model Router
RouterMicrosoft Azure AI Foundry's native model router that uses a trained ML model to route each prompt in real time to the optimal Azure-hosted model, with Balanced/Cost/Quality mode selection and automatic failover.
Helicone
GatewayObservability-first AI gateway with routing, caching, rate limiting, and request tracing; Apache 2.0 open-source core with a managed hosted tier for logging and analytics.
Kong AI Gateway
GatewayMulti-LLM AI gateway built on Kong Gateway 3.x, adding semantic routing, load balancing, guardrails, and MCP traffic analytics as plugins over Kong's existing API management platform.
Capabilities
Benchmark peer barsfor Coding
Benchmark scores(9)
| Benchmark | Score | Version | Source |
|---|---|---|---|
| Aider Polyglot | 79.6 | Aider polyglot, high reasoning, 225 tests | https://aider.chat/docs/leaderboards/ |
| MMLU PRO | 87.0 | — | https://huggingface.co/spaces/TIGER-Lab/MMLU-Pro |
| SWE-bench Verified | 76.7 | SWE-bench Verified | https://www.swebench.com/verified.html |
| τ-bench | 78.9 | τ-bench | https://taubench.com/ |
| Google-Proof Q&A | 87.5 | GPQA Diamond pass@1, base Grok 4 | https://x.ai/news/grok-4-fast |
| AIME 2025 | 91.7 | AIME 2025 no tools, pass@1, base Grok 4 | https://x.ai/news/grok-4-fast |
| Humanity's Last Exam | 25.4 | Humanity's Last Exam no tools, pass@1, base Grok 4 | https://x.ai/news/grok-4-fast |
| LiveCodeBench | 79.0 | LiveCodeBench Jan-May, pass@1, base Grok 4 | https://x.ai/news/grok-4-fast |
| ARC-AGI-2 | 15.9 | ARC-AGI-2 / ARC-AGI V2, base Grok 4 | https://x.ai/news/grok-4 |
Migration checks
No linked migration route is available for this model yet.
API versions
grok-4-0709grok-4Compare Grok 4 with other models
Comparison and alternatives
Browse all comparisons →Show all 69 popular comparisonssorted by 7-day search impressions
Frequently asked questions
What is the context window of Grok 4?
Grok 4 has a context window of 256k tokens.
How much does Grok 4 cost?
Grok 4 pricing ranges from $1.25/1M to $7.2/1M input tokens depending on the provider.
When was Grok 4 released?
Grok 4 was released on 2025-07-09.
Which providers offer Grok 4?
Grok 4 is available from 4 providers: Microsoft Foundry, OpenRouter, Replicate API, xAI Console.
What benchmarks has Grok 4 been tested on?
Grok 4 has been evaluated on 9 benchmarks, including Aider Polyglot, MMLU PRO, SWE-bench Verified, τ-bench, Google-Proof Q&A.
Cheapest of 4 routes · OpenRouter