Models
Grok Models: Grok 4.7 Specs, Prices and Agents
Checked 2026-10-31
Loading poll...
Grok's current flagship is Grok 4.7: a 500,000-token context window, text and image input, text output, and API prices of $2.00 per million input tokens and $6.00 per million output tokens for prompts under 200K tokens. It is closed-weight. Only older Grok models have public weights. xAI also ships a terminal coding agent, Grok Build. Checked on 31 October 2026.
The lineup
xAI's docs describe the maker as SpaceXSI in the page titles and still serve the API from api.x.ai. We say xAI where the weights and licences use that name, and SpaceXSI where the docs do.
The pricing page lists these text models. Context is as printed there.
Model | Context | Input per Mtok | Cached input | Output per Mtok | Notes |
|---|---|---|---|---|---|
grok-4.7 | 500K | $2.00 | $0.50 | $6.00 | Flagship, Sept 2026 |
grok-4.6 | 500K | $2.00 | $0.50 | $6.00 | Same price as 4.7 |
grok-4.5 | 500K | $2.00 | $0.30 | $6.00 | Cheaper cache read |
grok-4.3 | 1M | $1.25 | $0.20 | $2.50 | Larger window, lower price |
grok-4.20-0309-reasoning | 1M | $1.25 | $0.20 | $2.50 | Reasoning variant |
grok-4.20-0309-non-reasoning | 1M | $1.25 | $0.20 | $2.50 | No reasoning |
grok-4.20-multi-agent-0309 | 1M | $1.25 | $0.20 | $2.50 | Multi-agent variant |
grok-build-0.1 | 256K | $1.00 | $0.20 | $2.00 | Coding model |
Each row has a second rate for prompts of 200K tokens or more. For grok-4.7 it is $4.00 input, $1.00 cached and $12.00 output. The pricing page says that once a prompt reaches the threshold, all tokens in that request are billed at the higher rate, not only the ones above it.
xAI's models page sends most people to one model: "For everything else, including code, use Grok 4.7." It lists separate models for images (Grok Imagine Image 2.0), video (Grok Imagine Video 1.5) and voice (the Grok Voice API). We cover only the text models here.
Grok 4.7 in detail
Property | Value |
|---|---|
Model name | grok-4.7 |
Context window | 500,000 tokens |
Knowledge cutoff | May 2026 |
Modalities | Text and image input, text output |
Output limit | No text output limit stated |
Reasoning effort | Low, medium, high (default), xhigh |
Structured outputs and function calling | Yes |
Server-side tools | Web search, X search, code execution |
Batch API | Supported, at a 20 percent discount |
Rate limits | 150 requests per second, 50,000,000 tokens per minute |
Regions | us-east-1, us-west-2, us-central-1 |
Images can be up to 20 MiB each, in jpg or png, with no limit on how many you send. The model has no live knowledge unless you switch on the search tools, and xAI says so plainly on its models page.
Two behaviours are worth knowing before you build. On the Responses API, grok-4.7 always returns encrypted reasoning content, even when you do not ask for it, so a multi-turn conversation keeps the model's reasoning if you pass those items back unchanged. And xAI strongly recommends setting a prompt cache key, so a conversation's requests route to the same server and cache hits become reliable. Without it, the docs warn, you often pay full input price on a cold server.
Grok 4.7 Fast
Grok 4.7 Fast is the same model on faster infrastructure. It costs twice the standard token rates, or 1.5 times for long-context requests. xAI says it is only available in Cursor and Grok Build, billed through your plan there, and not on the public API. It is also not included in Grok Build's free tier.
What it costs in practice
Take a job of 10 million input tokens and 2 million output tokens, with every prompt under 200K tokens. These sums use list prices only.
Scenario | Input | Output | Total |
|---|---|---|---|
grok-4.7, no caching | 10M x $2.00 = $20.00 | 2M x $6.00 = $12.00 | $32.00 |
grok-4.7, 80 percent of input cached | 2M x $2.00 + 8M x $0.50 = $8.00 | $12.00 | $20.00 |
grok-4.7 via Batch, 20 percent off, no caching | $16.00 | $9.60 | $25.60 |
grok-4.3, no caching | $12.50 | $5.00 | $17.50 |
grok-4.7, prompts of 200K or more | 10M x $4.00 = $40.00 | 2M x $12.00 = $24.00 | $64.00 |
The last row is the trap. A coding agent that stuffs 300K tokens of repository into every request pays double on every token. Keep prompts under 200K where you can, and use the cache.
Server-side tools carry their own fee on top of tokens. xAI lists $5 per 1,000 calls for web search and for code execution, and $5 per 1,000 posts for X search. If the agent decides to search often, the tool bill can rival the token bill. The pricing page says cost scales with query complexity because the agent chooses how many tools to call.
Setting up the API
Getting started takes four steps, all from xAI's quickstart and Grok 4.7 pages.
- Create an account and an API key in the xAI console.
- Point an OpenAI-style client at https://api.x.ai/v1, or use xAI's own SDK or the AI SDK package.
- Set the model name to grok-4.7 and call the Responses API, which is the API the Grok 4.7 page lists.
- Add a prompt cache key and a safety identifier before you send real traffic.
curl https://api.x.ai/v1/responses \
-H "Authorization: Bearer $XAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "grok-4.7", "input": "Explain this stack trace."}'The docs list other features for long agent loops: context compaction, deferred completions, async requests, a WebSocket mode, priority processing, regional endpoints, mutual TLS and cost tracking. We have not tested any of them, and the details sit in xAI's Advanced API Usage section. For a long-running coding loop, context compaction and the prompt cache are the two worth reading first, because they bear directly on the 200K price step.
Choosing a reasoning effort
Grok 4.7 accepts low, medium, high and xhigh, with high as the default. The pricing page does not give a separate rate per level, so reasoning tokens are billed as output at $6.00 per million like any other output token. In practice that means effort is a cost dial.
Effort | Use it for | Cost watch |
|---|---|---|
Low | Short edits, lookups, classification | Fewest reasoning tokens |
Medium | Everyday coding tasks | A sensible starting point |
High (default) | Debugging and multi-file changes | Output bill grows with each step |
Xhigh | Hard problems you would otherwise escalate | Highest output spend; cap it |
xAI's Grok 4.7 page does not give typical token counts per effort level. The sensible habit is to log reasoning tokens per request for a week and set the default to the lowest level that still passes your tests.
Moving from an older Grok
If your code names grok-4.3 or grok-4.20, you have more context (1M) and a lower price today, so the move to 4.7 is a quality decision, not a savings one. Check three things: the window drops from 1M to 500K, the input price rises from $1.25 to $2.00, and the output price rises from $2.50 to $6.00. Then compare passes on your own tasks. xAI's model aliases help here: a bare model name points at the latest stable version, a name with a latest suffix points at the newest, and a dated name pins one release. Pin a dated version in production so a quiet alias change cannot alter your results.
Maker, licence and open weights
The flagship is closed-weight. You cannot download Grok 4.7, and it carries no model licence. Two older releases are public on Hugging Face under xai-org.
Model | Licence | Notes |
|---|---|---|
Grok 1 | Apache-2.0 | Released March 2024 |
Grok 2 | xAI Community License Agreement (last updated 4 Nov 2025) | Weights of a model xAI says it trained and used in 2024 |
The Grok 2 licence permits non-commercial and research use, and commercial use if you follow xAI's Acceptable Use Policy. It forbids using the model, derivatives or outputs to train or improve any foundation or general-purpose AI model, other than permitted fine-tuning of the xAI materials themselves. It also asks you to include a notice and display "Powered by xAI" if you distribute products that use it.
The Grok 2 card says the checkpoint is about 500 GB in 42 files, is set up for tensor parallelism of 8, and needs 8 GPUs with more than 40 GB of memory each to serve with SGLang. That is a data-centre job, and the model is two years old. It is a curiosity for most teams, not a coding option. For the models you would really self-host, see the open source LLM overview and best open source LLM for coding.
Where it is served
Route | What xAI says |
|---|---|
xAI API | Direct, get a key from the console |
US regional endpoint | us.api.x.ai keeps inference in the United States, priced at a 10 percent premium |
Grok Build | The default model of xAI's coding agent |
Cursor | Grok 4.7 available on all plans |
Model gateways | OpenRouter, Vercel and Cloudflare |
Cloud platforms | The docs list Google Cloud Vertex AI and Microsoft Foundry under Platforms |
The hosts under /hosting/ on this site sell GPU time for downloadable models, so Runpod and Modal do not serve Grok 4.7. xAI names Cloudflare among its model gateways, which may mean the Cloudflare AI Gateway rather than Cloudflare Workers AI. We did not check the Workers AI catalogue. For a comparison of gateways, see OpenRouter alternatives.
Coding agents that can use Grok
- Grok Build. xAI's own coding agent. It runs as a terminal UI, headlessly with a prompt flag, or through the Agent Client Protocol in other apps. It installs with a shell script from x.ai, reads a user-level config file, and lets you add any custom model by base URL. Its docs say Grok 4.7 is its default.
- Cursor. Grok 4.7 is available on all plans, per xAI. Cursor's own pages cover how it is billed. See Cursor pricing and the Cursor entry.
- Anything with a custom endpoint. The API follows the Responses and Chat Completions shapes, and xAI documents use through the OpenAI SDK with a changed base URL. We did not check each project's provider list for Grok 4.7. See Cline and OpenCode.
- Claude Code and Codex. Both are built around their vendors' own models. We have not seen a documented path to Grok in either, and xAI's Grok 4.7 page lists Grok Build, Cursor, OpenRouter, Vercel and Cloudflare as places it runs, not Claude Code or Codex.
Compare tools on choose an AI coding agent.
Benchmarks
xAI's models and release pages we fetched describe Grok 4.7 as built for coding, agentic tasks and knowledge work, and do not print benchmark scores. The announcement at x.ai/news/grok-4-7 does carry a comparison table. At xhigh effort it lists Terminal-Bench 4.0 at 37.6% and CursorBench 4.0 at 46.3%, and it lists DeepSWE v1.1 at 71.0% at high effort. These are vendor-reported, and we saw no SWE-bench Verified score. We did not copy any numbers from third-party sites.
Privacy and data handling
xAI's security FAQ says SpaceXSI never trains on your API inputs or outputs without explicit permission. By default, requests and responses are stored encrypted for 30 days for abuse auditing, then deleted, and not used for training. A Zero Data Retention option exists, but the FAQ does not recommend it for most customers because it disables features that rely on stored data, such as the stateful Responses API and file features. Send a safety identifier per end user if you run a gateway, so an abuse report points at one user rather than your whole key.
The consumer Grok apps and Grok on X are covered by separate terms from the API, and we did not read them, so check xAI's privacy policy before you use them for private code.
Limits and gotchas
- 200K cliff. At 200K prompt tokens or more, all tokens in that request cost double.
- Cache hits are not automatic. Set a prompt cache key.
- Fast is not on the API. Grok 4.7 Fast lives in Cursor and Grok Build.
- Tool fees add up. Search and code execution are charged per call on top of tokens.
- Region. US-only inference costs 10 percent more, through a separate endpoint.
- Model churn. The docs include a model retirement migration guide dated 15 May 2026, so expect older IDs to move.
- Logprobs are ignored on grok-4.20 and newer.
Our take
Grok 4.7 is priced like a mid-tier premium model, not a flagship: $2 and $6 beats Sonnet's $2 and $10 on output and sits well under the Opus and Astra prices on the Claude models page and the GPT models page. The 500K window is half of what most rivals list. The 200K price step is the detail that can undo the savings for repository-scale prompts.
The main reason to pick it is the combination of Grok Build and Cursor access with a clear data policy, plus the cheaper 1M-window older models if you need a bigger window at a lower price. The reason to hold back is evidence: we have no vendor score table to check, so run your own tasks before you commit.
Who should pick what
You are | Pick |
|---|---|
A developer who wants xAI's own agent | Grok Build with grok-4.7 |
A Cursor user who wants a cheap strong option | Grok 4.7 inside Cursor |
Running very long prompts | grok-4.3 at 1M context and $1.25 / $2.50, after a quality test |
Needing weights | Grok 2 only, and only if you can host 8 large GPUs; otherwise other open models |
Comparing vendors |
Related pages
- Claude models, GPT models and Gemini models for the other closed families
- LLM API prices for a cross-vendor table
- Compare AI models side by side for the interactive table
Questions
What is the latest Grok model?
Grok 4.7 (grok-4.7), released in September 2026 on the xAI API. It has a 500,000-token context window, takes text and image input and returns text.
How much does the Grok API cost?
Grok 4.7 is $2.00 per million input tokens, $0.50 per million cached input tokens and $6.00 per million output tokens for prompts under 200K tokens. At 200K or more it is $4.00, $1.00 and $12.00.
Is Grok open source?
Only older models. Grok 1 weights are Apache-2.0 and Grok 2 weights are under the xAI Community License. Grok 4.7 is closed and served through xAI's API.
Does xAI train on my API data?
Its security FAQ says SpaceXSI never trains on API inputs or outputs without explicit permission. Requests are stored for 30 days for abuse auditing by default.
Which coding agents use Grok?
Grok Build is xAI's own coding agent and defaults to Grok 4.7. Cursor lists Grok 4.7 on all plans, and the API works with agents that accept a custom endpoint.
Loading poll...