Grok 4.7 API Guide: 500K Context, $2/$6 Pricing, and xhigh Reasoning
xAI released Grok 4.7 on September 21, 2026. The short version for developers: the model ID in the Grok 4.7 API is grok-4.7, the context window is 500K tokens, and prompts up to 200K tokens cost $2 per million input tokens and $6 per million output tokens. Above 200K, prices double. Reasoning effort defaults to high, and xhigh is available. The figures below are current as of October 2026 and come from xAI's launch page and developer release notes. Treat the official pages as authoritative for pricing.
What is Grok 4.7, and where can you use it?
xAI positions it as a model for coding and knowledge work. For the specifics of the training improvements, see the launch page.
It is available in Cursor, Grok Build, the Grok API, third-party coding tools, and through model routers and cloud platforms. The launch page lists the price as "from $2 per million input tokens and $6 per million output tokens," which matches the under-200K tier in the table below.
What are the API specs and prices?
This table comes from the developer release notes:
| Item | Details |
|---|---|
| Model ID | grok-4.7 |
| Context window | 500K tokens |
| Input | Text, images |
| Output | Text only |
| Reasoning effort | low, medium, high (default), xhigh |
| Regional endpoint | A US regional endpoint is available |
| Prompt length | Input | Cached input | Output (per million tokens) |
|---|---|---|---|
| Up to 200K | $2 | $0.50 | $6 |
| Over 200K | $4 | $1 | $12 |
There is also Grok 4.7 Fast. It outputs roughly twice as fast as the standard model and is billed at 2x the standard price (1.5x for long context). Per the official notes, it is only offered in Cursor and Grok Build, not in the public API, and it is billed through the plans of those two products. If you want the Cursor angle, see X Subscription launches: Grok, Cursor, and X Premium in one plan.
How should you read the benchmark results?
The launch page reports results measured at the xhigh reasoning level: 46.3% on CursorBench 4.0 and 37.6% on Terminal-Bench 4.0. For the comparison against Grok 4.6, check the launch page directly. These are vendor-run numbers, so use them as a rough reference only. Your own codebase and tasks are the real test; run 10 to 20 of your actual tasks before deciding.
How do you call it?
xAI's API is OpenAI-compatible. Here is an example; the endpoint and parameter names such as reasoning_effort are subject to the official documentation:
curl https://api.x.ai/v1/chat/completions \
-H "Authorization: Bearer $XAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.7",
"reasoning_effort": "medium",
"messages": [{"role": "user", "content": "解释这段报错的原因"}]
}'
(The message content in the example, "解释这段报错的原因", means "Explain the cause of this error.")
If you use the Responses API, the release notes say grok-4.7 always returns reasoning.encrypted_content, even if include doesn't request it. Make sure your response parser doesn't break on the extra field.
Which reasoning effort should you pick?
The default, high, produces a lot of reasoning output, and output costs $6 per million tokens. The table below is a suggested starting point, not an official recommendation:
| Task | Starting level |
|---|---|
| Format conversion, simple Q&A, classification | low |
| Everyday completion, explaining code, small edits | medium |
| Multi-file changes, debugging hard bugs | high (default) |
| Long-running, multi-hour agent tasks | xhigh, try on a small scale first |
The approach: run a batch of tasks at medium, note the failures, and move only those up a level. Compared with defaulting everything to high, this usually spends fewer output tokens. How much you save depends on the task, so check your own bill.
How do you avoid the price doubling past 200K?
By the official wording, prompts over 200K fall into the $4 / $1 / $12 tier. Whether the whole request is billed at the higher tier is something to confirm in the official billing documentation. As an illustration, a request with 150K input and 8K output costs about $0.35 at the standard tier; with 250K input billed entirely at the higher tier, it comes to about $1.10, roughly 3x. This is only a worked example.
Ways to stay under the line:
- Retrieve first, then include: send the model only the relevant files, not the whole repository.
- In multi-turn conversations, summarize periodically and drop early tool output.
- Put fixed system prompts and reference material at the front to help hit cached input pricing ($0.50). Caching rules are per the official docs.
- Log the input token count of every request and alert when it passes 180K.
How do you check network and stability before integrating?
Check latency and availability first:
- On the cdnping home page, test the connection latency to the xAI API to see first-connection and round-trip times. For what each metric means, see AI API latency breakdown.
- At /en/status/xai, see probe records for xAI's official API endpoint.
- At /en/models, see availability, latency, and throughput for each provider on OpenRouter. The same model can behave very differently across providers; see How much can uptime differ for the same model across OpenRouter providers.
Prices and models keep changing, so it is worth subscribing to change logs. See How to find out right away when LLM API prices change.
Sources
- xAI: Grok 4.7 launch page (September 21, 2026)
- xAI developer release notes