Grok 4

by xAI

Released 141 days after Grok 3 Mini · All xAI releases

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
Released
  • EU residency available
  • US residency available
  • 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
USNot by defaultNo$3.00$15.00
EUNot by defaultNo$3.00$15.00

Uptime and availability

Grok 4 runs on a single route through the Opper gateway today, so its availability is that provider's availability.

98.52%route uptime, last 30 days
Single route, no failover target within this model.

Name a second model in the same request and the gateway tries it on retriable errors, so a busy hour never has to reach your users. Set up a fallback chain.

Measured over the last 30 days from each provider's official status feed via StatusGator. Refreshed hourly. See uptime for every provider Opper monitors.

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 not on by default — abuse monitoring, 30-day retention. No training on customer data. US; SCCs; DPA available.

Zero data retention
Not by default — abuse monitoring, 30-day retention. Derived from the logging and moderation facts.
Training
No training on customer data.
Logging
Abuse monitoring (30-day retention)
Moderation
Not established
Caching
Not established
Subprocessor access
Not established
GDPR DPA
DPA available
Transfer mechanism
SCCs

xAI Ireland🇮🇪

Zero data retention is not on by default — abuse monitoring, 30-day retention. No training on customer data. EU; DPA available.

Zero data retention
Not by default — abuse monitoring, 30-day retention. Derived from the logging and moderation facts.
Training
No training on customer data.
Logging
Abuse monitoring (30-day retention)
Moderation
Not established
Caching
Not established
Subprocessor access
Not established
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.

Intelligence Index26.5
Math Index92.7
Reasoning & knowledge
MMLU-Pro
87%
GPQA Diamond
88%
Humanity's Last Exam
27%
Long-context reasoning
68%
Coding
LiveCodeBench
82%
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 a coding agent like Claude Code, Cursor or Codex 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 700+ models

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

Get startedView Documentation