Grok 4.7 · configuration
The model name on the public xAI API is grok-4.7. The reasoning levels listed in the documentation are Low, medium, high (default), or xhigh, with an input price of $2.00 / 1M tokens and an output price of $6.00 / 1M tokens. Grok 4.7 Fast is written as a faster deployment of the same model, billed at twice the standard token price, and it appears only in Cursor and Grok Build.
When calling Grok 4.7, pin {{MODEL_ID}}, {{REASONING_EFFORT}}, and {{API_BASE}}. The task is {{TASK}}; use only {{TOOL_ALLOWLIST}} and accept the output with {{ACCEPTANCE}}.
Replace every variable before running and write the actual values into the acceptance record.Replace before running: {{MODEL_ID}}, {{REASONING_EFFORT}}, {{API_BASE}}, {{TASK}}, {{TOOL_ALLOWLIST}}, {{ACCEPTANCE}}
When calling Grok 4.7, pin {{MODEL_ID}}, {{REASONING_EFFORT}}, and {{API_BASE}}. The task is {{TASK}}; use only {{TOOL_ALLOWLIST}} and accept the output with {{ACCEPTANCE}}.
The model name on the public xAI API is grok-4.7. The reasoning levels listed in the documentation are Low, medium, high (default), or xhigh, with an input price of $2.00 / 1M tokens and an output price of $6.00 / 1M tokens. Grok 4.7 Fast is written as a faster deployment of the same model, billed at twice the standard token price, and it appears only in Cursor and Grok Build.
Suitable tasks: The page positions Grok 4.7 for coding, agentic tasks, and knowledge work. The official example is to find and fix a bug in a median function, then explain why. The modalities are text and image input, and text output. The listed tools are function calling, web search, X search, and code execution.
Unsuitable tasks: This page limits Grok 4.7 Fast to Cursor and Grok Build, and states that it is not available on the public xAI API and is not included in Grok Build's free quota. The modality description on this page covers only text and image input and text output. It does not give a grok-4.7 request for image generation, video, or speech. This page has no model name or parameters for grok-4.6.
Applicable model versions: grok-4.7. On this page, Grok 4.7 Fast is described as the same model on faster infrastructure. This page does not give a separate Fast model ID. grok-4.6 does not appear on this page.
Applicable clients, agents, or APIs: the xAI API's Responses API and Chat Completions; the US regional endpoint https://us.api.x.ai/v1; Grok Build (the default model for the coding agent); Cursor (all plans); and the model gateways OpenRouter, Vercel, and Cloudflare. The example clients are the xAI Python SDK, the Vercel AI SDK's xai.responses('grok-4.7'), the OpenAI SDK (baseURL set to https://api.x.ai/v1), and curl.
Recommended reasoning levels and parameters: The Reasoning text in the at-a-glance table is Low, medium, high (default), or xhigh. The Learn more text at the end of the page is controlling reasoning_effort, including "xhigh". The default level is high. None of the four request examples on this page include a reasoning_effort field. For multi-turn conversations, the Responses API recommends setting prompt_cache_key, and Chat Completions uses the request header x-grok-conv-id.
What this page publishes is integration configuration and four call examples. It does not separately provide a reusable complete prompt template. The user input in the examples is the same sentence:
Find and fix the bug, then explain it: function median(a){a.sort();return a[a.length/2]}Python (xAI SDK):
import os
from xai_sdk import Client
from xai_sdk.chat import user
client = Client(api_key=os.getenv("XAI_API_KEY"))
chat = client.chat.create(model="grok-4.7")
chat.append(user("Find and fix the bug, then explain it: function median(a){a.sort();return a[a.length/2]}"))
response = chat.sample()
print(response.content)JavaScript (Vercel AI SDK):
import { xai } from '@ai-sdk/xai';
import { generateText } from 'ai';
const { text } = await generateText({
model: xai.responses('grok-4.7'),
prompt:
'Find and fix the bug, then explain it: function median(a){a.sort();return a[a.length/2]}',
});
console.log(text);JavaScript (OpenAI SDK):
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.XAI_API_KEY,
baseURL: 'https://api.x.ai/v1',
});
const response = await client.responses.create({
model: 'grok-4.7',
input: [
{
role: 'user',
content:
'Find and fix the bug, then explain it: function median(a){a.sort();return a[a.length/2]}',
},
],
});
console.log(response.output_text);Bash:
curl https://api.x.ai/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{
"model": "grok-4.7",
"input": "Find and fix the bug, then explain it: function median(a){a.sort();return a[a.length/2]}"
}'The page also names two cache-related fields, but it does not give a complete request body that includes them: prompt_cache_key on the Responses API, and the request header x-grok-conv-id on Chat Completions. On the Responses API, POST /v1/responses for grok-4.7 returns reasoning.encrypted_content even when include does not list it. On the next turn, reasoning items must be placed back into input unchanged. This page does not show the field structure of those items.
This page does not publish a step-by-step workflow. The configuration actions the page states explicitly are:
When an API key is already available, set the model name to grok-4.7.
For a new account, follow the Quickstart the page points to, create an account, and send the first request.
For multi-turn conversations, set prompt_cache_key on the Responses API. Chat Completions uses x-grok-conv-id so that requests in the same conversation land on the same server.
When using the Responses API for multiple turns, place the returned reasoning items into the next request's input unchanged.
For long Agent loops, also consult the context compaction the page points to. For tool-heavy tasks, consult function calling. On this page those two items are links only, with no parameter examples.
Collected page: https://docs.x.ai/developers/grok-4-7. "View as Markdown" on the same page points to https://docs.x.ai/developers/grok-4-7.md. The body matches the four code blocks on the page. Footer: Last updated: September 21, 2026. The page has no bylined author and no separate first-publication date.
At a glance table:
| 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 |
| Input price | $2.00 / 1M tokens |
| Output price | $6.00 / 1M tokens |
| Reasoning | Low, medium, high (default), or xhigh |
| APIs | Responses API, Chat Completions |
| Tools | Function calling, web search, X search, code execution |
The page states that the team's rate limits and live pricing are on the model detail page and the Pricing page. This page does not expand on them.
Version distinctions, all from the original text on this page:
grok-4.7: the model name used in the four examples and the at-a-glance table. Input is $2.00 / 1M tokens, and output is $6.00 / 1M tokens.
Grok 4.7 Fast: the original wording is "the same model served on faster infrastructure, billed at twice the standard token rates". It is available only in Cursor and Grok Build, is not included in Grok Build's free quota, and is not available on the public xAI API. This page does not print a Fast model ID, and it does not print the doubled dollar unit prices. Specific rates point to an anchor on the Pricing page.
grok-4.6: this model name and its corresponding parameters do not appear anywhere in the full text of this page.
Other prices and endpoints stated on this page:
US regional endpoint https://us.api.x.ai/v1. Inference stays in the United States, and token usage is marked up by 10%. This page does not write the marked-up unit prices as dollar figures.
When prompt_cache_key / x-grok-conv-id is not set, the original text says requests often land on a cache-cold server and are billed at the full input price. This page does not give a figure for the cache-hit discount.
Grok Build uses this model as the default model for the coding agent. For Cursor, the page writes available on all plans. The listed gateways are OpenRouter, Vercel, and Cloudflare.
This page has no sample size, benchmark scores, tool-toggle examples, or independent test results. The knowledge cutoff "May 2026" is a model property, not an evaluation conclusion.
Evidence covers only the page https://docs.x.ai/developers/grok-4-7. Pricing, model detail, the Reasoning parameter notes, context compaction, and function calling are all external links. This note does not treat the content of those pages as collected evidence.
The name reasoning_effort and "xhigh" appear only in the Learn more link description. The list of levels appears in the at-a-glance table. This page does not show a request field for setting that parameter, so the copyable requests above stay exactly as they appear on the page.
The "twice" for Grok 4.7 Fast is a multiplier relative to the standard token price. This page has no Fast model ID and no Fast price list.
The 10% regional markup is likewise given only as a ratio. Multiplying $2.00 or $6.00 into a new unit price is not a number printed on this page.
The configuration on this page corresponds to grok-4.7. The availability of Grok 4.7 Fast is Cursor and Grok Build. grok-4.6 is outside the scope of this page.
The example requests have no tool parameters, image input, prompt_cache_key, or reasoning item. The complete form of those fields cannot be inferred from these four code blocks.
The author is not stated. The only date is the footer Last updated: September 21, 2026.
On 2026-09-22, Tabbit was used to open https://docs.x.ai/developers/grok-4-7. The page title was "Grok 4.7 | SpaceXAI Docs", and the main heading was "Grok 4.7". The code area has four tabs: Python, JavaScript, JavaScript (OpenAI), and Bash. All four pre elements are in the page DOM. The Markdown URL on the same page, https://docs.x.ai/developers/grok-4-7.md, returned 200, with content-type text/markdown, and the body matched the visible page. The footer text was "Last updated: September 21, 2026". At collection time the page could be read directly, with no login wall or captcha.
xAI developer documentation (docs.x.ai; the page title is SpaceXAI Docs) · Source date: Not disclosed · Edited: 2026-09-22
Read the original sourceGrok 4.7
Run this guide in the environment listed above. Downloading does not transfer the template or establish model availability for your account.