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
- 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
2 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)
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.
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.
Capabilities
Benchmark peer barsfor Coding
Benchmark scores(4)
| Benchmark | Score | Version | Source |
|---|---|---|---|
| Aider Polyglot | 79.6 | 2026-04 (high) | 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/ |
Migration checks
No linked migration route is available for this model yet.
API versions
grok-4-0709grok-4Comparison and alternatives
Browse all comparisons →Show all 69 popular comparisonssorted by 7-day search impressions
Cheapest of 4 routes · OpenRouter