Comparison · 2026-06-29
GPT-5 vs Grok 4
Side-by-side comparison of pricing, context window and capabilities for GPT-5 (OpenAI) and Grok 4 (xAI). Focus: flagship.
| GPT-5 | Grok 4 | |
|---|---|---|
| Vendor | OpenAI | xAI |
| Input price / 1M tokens | $1.25 | $3.00 |
| Output price / 1M tokens | $10.00 | $15.00 |
| Total per 1M (in + out) | $11.25 | $18.00 |
| Context window | 400K | 256K |
| Max output tokens | 128K | 64K |
| Tool calling | ✓ Yes | ✓ Yes |
| Structured output | ✓ Yes | Unknown |
| Reasoning | ✓ Yes | ✓ Yes |
| Vision input | ✓ Yes | ✓ Yes |
| Open weights | ✗ No | ✗ No |
| Provider availability | 25 providers | 6 providers |
| Release date | 2025-08-07 | 2025-07-09 |
| Knowledge cutoff | 2024-09-30 | 2025-01 |
Quick takeaway
- GPT-5 is 1.6× cheaper per 1M tokens (input + output combined).
- GPT-5 has a larger context window (400K vs 256K).
- Only GPT-5 supports structured output / JSON mode.
- GPT-5 is more widely available across providers (25 vs 6).
How to read this comparison
This page compares GPT-5 and Grok 4 on the dimensions that matter most for production LLM selection: per-token cost, context window, declared capabilities (tool calling, structured output, reasoning, vision), and provider availability.
Green highlights in the table indicate which model leads on a given row. "Leads" means lower price or higher context/capability — not necessarily "better for your use case". A model that costs 3× more may still be the right choice if it unlocks a capability you need.
What this comparison does NOT tell you
- Quality / accuracy — we have no benchmark data. Declared capabilities ≠ measured performance.
- Latency — time-to-first-token varies by provider, region and load. Test with your actual traffic.
- Prompt caching savings — if you reuse system prompts, the cheaper model on headline rate may not be cheapest in practice.
- Fine-tuning availability — not all models can be fine-tuned, even if they are open-weight.
Data is refreshed daily. If a model's capabilities or pricing change, this page updates automatically on the next build cycle.
Frequently asked questions
Is GPT-5 cheaper than Grok 4?
GPT-5 costs $1.25/1M tokens input + $10.00/1M tokens output, while Grok 4 costs $3.00/1M tokens input + $15.00/1M tokens output. GPT-5 is cheaper per combined 1M tokens.
Which model has a longer context window, GPT-5 or Grok 4?
GPT-5 supports a longer context window — 400,000 tokens vs 256,000 tokens.
Where can I run GPT-5 and Grok 4?
GPT-5 is available on 25 providers; Grok 4 is available on 6 providers. See each model's detail page for the full provider list.
Explore more
Model details
By vendor
Last updated:
Prices in USD per 1M tokens. Unknown means the provider does not publish per-token pricing.
Pricing and capabilities are refreshed daily and reconciled against each provider's official documentation. Always verify critical production decisions with the provider directly.