Grok 4

by xAI

Grok 4 is xAI's flagship model from its July 2025 release, bringing improved reasoning depth and tool use compared to Grok 3. It accepts both text and image input across a 256k token context window, with native integration for web search and external tool invocation, making it strong for agentic systems that need grounding in current data. The model treats tool use as a first-class feature, letting developers build multi-step agents that invoke APIs, run code, and access external data sources. It handles complex reasoning, multimodal analysis, and tasks that need both accuracy and live context. Grok 4 was trained with reinforcement learning at scale on xAI's Colossus cluster. It balances reasoning power with practical performance, positioning it for production agentic applications where reliability matters alongside capability.

Key info

Input
Output
Features
Context window
256K
Max output
16K
Input price
$3.00 /1M
Output price
$15.00 /1M
  • EU residency available
  • US residency available
  • Zero data retention via Enterprise
  • No training by default
  • GDPR DPA available

Available routes

Grok 4 runs on 2 different routes through the Opper gateway. Compare residency, ZDR, and training posture at a glance โ€” full data-handling detail per route below.

ProviderRegionZero data retentionTrainingInputOutput
xAIUSEnterpriseNo$3.00$15.00
xAIEUEnterpriseNo$3.00$15.00

Training posture across routes: No training on prompts by default.

Data handling per route

Each route hosting Grok 4 has its own privacy posture, residency, and GDPR terms. Postures are maintained by Opper with a last-verification timestamp.

xAI โ€” United States๐Ÿ‡บ๐Ÿ‡ธ

Zero data retention is available via Opper Enterprise contract. No training on customer data. US; SCCs; DPA available.

Zero data retention
Available via Opper Enterprise contract.
Training
No training on customer data.
Logging
Abuse monitoring (30-day retention)
Third-party access
None disclosed
GDPR DPA
DPA available
Transfer mechanism
SCCs

xAI โ€” Ireland๐Ÿ‡ฎ๐Ÿ‡ช

Zero data retention is available via Opper Enterprise contract. No training on customer data. EU; DPA available.

Zero data retention
Available via Opper Enterprise contract.
Training
No training on customer data.
Logging
Abuse monitoring (30-day retention)
Third-party access
None disclosed
GDPR DPA
DPA available
Transfer mechanism
Not applicable โ€” data stays in EU

Benchmarks

Independent benchmark scores โ€” composite indices for reasoning, coding, and math, plus individual eval scores where available.

Global rank#78 of 531 LLMs
TierStrong
Output speed0 tok/s
First token0.00s
Intelligence Index33.3
Coding Index40.5
Math Index92.7
Reasoning & knowledge
MMLU-Pro
87%
GPQA Diamond
88%
Humanity's Last Exam
24%
Long-context reasoning
68%
Coding
LiveCodeBench
82%
SciCode
46%
Agentic & tool use
Terminal-Bench Hard
38%
ฯ„ยฒ-Bench Telecom
75%
Math & instruction following
AIME 2025
93%
IFBench
54%

Get started

Call Grok 4 through the Opper gateway with one API key. Let your coding agent set it up, or call it directly โ€” Opper is drop-in compatible with the OpenAI, Anthropic, and Google AI SDKs.

Set it up with your agent

Copy this and paste it into your coding agent โ€” Claude Code, Cursor, Codex, and more โ€” and it'll wire up Opper for you.

Or call it directly

import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.OPPER_API_KEY,
baseURL: "https://api.opper.ai/v3/compat",
});
const completion = await client.chat.completions.create({
model: "xai/grok-4",
messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);

Compare Grok 4 withโ€ฆ

Side-by-side on privacy, EU hosting, pricing, and benchmarks.

Other models from xAI

Start building with 300+ models

One API key. Every major provider. Up and running in minutes.

Get startedView Documentation
Grok 4 by xAI โ€” pricing, benchmarks, EU/US hosting | Opper AI