All models

xAI: Grok 4

by xAI

Grok 4 is xAI's latest reasoning model with a 256k context window. It supports parallel tool calling, structured outputs, and both image and text inputs. Note that reasoning is not exposed, reasoning cannot be disabled, and the reasoning effort cannot be specified. Pricing increases once the total tokens in a given request is greater than 128k tokens. See more details on the [xAI docs](https://docs.x.ai/docs/models/grok-4-0709)

Avg Score

82.5%

231 answers

Avg Latency

24.3s

14 runs

Pricing

$3.00

input

/

$15.00

output

per 1M tokens

Context

256K

tokens

Alternatives

Models with similar or better quality but different tradeoffs

Same Quality, Cheaper

Models with similar or better performance at a lower cost per token.

Same Quality, Faster

Models with similar or better performance but lower latency.

Same Cost, Better

Models at a similar price point with higher benchmark scores.

Other Models from xAI

Compare performance with other models from the same creator

ModelScoreLatencyCost/1M
xAI: Grok 4.1 Fast79.4%7.8s$0.35
xAI: Grok 4 Fast$0.35
xAI: Grok Code Fast 1$0.85
xAI: Grok 3 Mini$0.40
xAI: Grok 3$9.00
xAI: Grok 3 Mini Beta$0.40
xAI: Grok 3 Beta$9.00

Benchmark Performance

How this model performs across different benchmarks

Price vs Performance

Compare cost efficiency across all models

Current model
Other models
X-axis uses log scale for better visualization of price range

Score Over Time

Performance trends across all benchmark runs

Benchmark Activity

Number of benchmark runs over time

Quickstart

Get started with this model using OpenRouter

View on OpenRouter
import { OpenRouter } from "@openrouter/sdk";

const openrouter = new OpenRouter({
  apiKey: "<OPENROUTER_API_KEY>"
});

const completion = await openrouter.chat.completions.create({
  model: "x-ai/grok-4",
  messages: [
    {
      role: "user",
      content: "Hello!"
    }
  ]
});

console.log(completion.choices[0].message.content);

Get your API key at openrouter.ai/keys