Grok 4 API

Grok 4 is designed for advanced reasoning and complex tool‑use workflows. Built on the Grok 3 architecture with 10× more reinforcement learning compute, it sets state‑of‑the‑art scores on tasks like ARC-AGI‑2, AIME25, and Humanity’s Last Exam (HLE).
Output

How to use Grok 4 API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to .

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Grok 4 API Pricing

TypePrice
Input
Output

Grok 4 Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
Intelligence
22.5
Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026
Math
92.7
Composite score across standardised mathematics evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026

Grok 4 vs other models

ModelInputOutputContextBest for
Grok 4
This page
$6.5 / 1M tokens
$39 / 1M tokens
1.05M tokens
Reasoning + agents
$2.6 / 1M tokens
$13 / 1M tokens
1M tokens
Balanced coding + agents
$3.9 / 1M tokens
$19.5 / 1M tokens
1M tokens
Long-context, multimodal & agentic workflows
$0.65 / 1M tokens
$3.9 / 1M tokens
1.05M tokens
Reasoning + agents

Frequently asked questions

Yes, Grok 4 can stream responses as they are generated.

Yes, Grok 4 supports function calling.

Grok 4 was built by xAI .

Yes, Grok 4 supports reasoning as one of its listed capabilities.

Start building with Grok 4

Get API Key
1000+ models, one API.