Grok 4.7 is xAI's flagship large language model for text generation, coding and reasoning, with a 500,000-token context window and prompt caching support. It follows Grok 4.5 and Grok 4.6 in the same line and keeps their tiered long-context pricing.
Elon Musk described it publicly as a 2.1-trillion-parameter model, up from 1.5T in Grok 4.6, and “better than 4.6 in every way, except slightly slower to serve, albeit with even better token efficiency”. Those are the vendor's own statements; xAI has not published a parameter count or benchmark card.
A 500K context window
Long enough for whole repositories, large document sets or extended agent transcripts without chunking.
Tiered long-context pricing
Requests under 200K context bill at the standard rate; above 200K the rate doubles. Worth designing around if prompts sit near the boundary.
Prompt caching
Cached input is a quarter of the standard input rate, which matters for agent loops that re-send the same long prefix.
Reasoning tokens are billed at the output rate.
Agentic workflows
Tool calling and parallel tool calls for loops that plan, call tools and iterate.
Long-context reasoning
Analysis over large codebases and document sets inside the 500K window.
Code
xAI positions the model for code and chat applications.
Sources: https://api.aimlapi.com/v1/models · https://docs.x.ai/developers/models
Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.
import requests r = requests.post( "https://api.aimlapi.com/v1/chat/completions", headers={"Authorization": "Bearer " + AIMLAPI_KEY}, json={ "model": "x-ai/grok-4-7", "messages": [ { "role": "user", "content": "Hello!" } ] }, ) print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", { method: "POST", headers: { Authorization: `Bearer ${process.env.AIMLAPI_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "model": "x-ai/grok-4-7", "messages": [ { "role": "user", "content": "Hello!" } ] }), }); console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"x-ai/grok-4-7","messages":[{"role":"user","content":"Hello!"}]}'
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Input | |
| Output | |
| Cached input |
Tiered pricing: $2.6/$7.8 per 1M tokens up to 200K context, $5.2/$15.6 above 200K. Cached input: $0.65/1M (≤200K) or $1.3/1M (>200K).
| Benchmark | Score | What it measures | Source | Retrieved |
|---|---|---|---|---|
| Intelligence | 46.4 | Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial Analysis | Source | September 22, 2026 |
Yes. Grok 4.7 is live on AI/ML API. Call it on the OpenAI-compatible chat completions endpoint with the model id x-ai/grok-4-7; the short alias grok-4-7 also resolves to it.
Grok 4.7 has a 500,000 token context window, the same as Grok 4.5 and Grok 4.6.
Pricing is tiered by context length. Up to 200K context it is $2.6 / 1M input tokens and $7.8 / 1M output; above 200K both double, to $5.2 and $15.6. Cached input is $0.65 / 1M (≤200K) or $1.3 / 1M (>200K). Reasoning tokens are billed at the output rate.
xAI calls Grok 4.7 the most capable model it has built. Elon Musk described it as a 2.1-trillion-parameter model, up from 1.5T in Grok 4.6, and “better than 4.6 in every way, except slightly slower to serve, albeit with even better token efficiency”. Those are the vendor's own statements — xAI has not published a parameter count or a benchmark card.
Text and file input, text output. Grok 4.7 is a text model — it does not accept images, audio or video.
Requests whose context stays under 200,000 tokens bill at the standard rate. Once a prompt crosses 200K, both the input and output rates double for that request. If your prompts sit near the boundary, it is worth designing around it.
Yes. Like the rest of the Grok 4 line it supports tool calling, parallel tool calls, streaming and prompt caching.
Grok 4.7 was built by xAI as the newest flagship in the Grok 4 family, following Grok 4.5 and Grok 4.6.