xAI
Grok-4.7
xAI's latest flagship with a 500K context window, stronger performance on long coding tasks, self-verification, and knowledge work
Context Length500K tokens
Model TypeLarge Language Model (LLM)
MultimodalText and image input; text output
Pricing & Specs
💰 Pricing
Input$2 / M tokens
Output$6 / M tokens
Cache Hit$0.5 / M tokens
⚙️ Specs
Context Length500K tokens
Model TypeLarge Language Model (LLM)
MultimodalText and image input; text output
Output LengthNo separate text output limit
Special CapabilitiesFunction calling, Web / X search, code execution
ReasoningLow, medium, high (default), or xhigh
Long-context Pricing (≥200K)Input $4; cached input $1; output $12 / M tokens for the full request
Web Search$5 / 1K tool calls
Release DateSeptember 21, 2026
Knowledge CutoffMay 2026
API Examples
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.xairouter.com/v1",
api_key="your-api-key"
)
response = client.chat.completions.create(
model="grok-4.7",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)cURL
curl https://api.xairouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-4.7",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'Model highlights
Grok 4.7 uses a larger base model trained for longer coding, agentic, and knowledge-work tasks. It improves self-verification, long-context management, and document and presentation creation. See the official announcement.
API usage
- Use model ID
grok-4.7with the Responses API or Chat Completions. - The Responses API automatically returns
reasoning.encrypted_content, even without an explicitinclude. When managing conversation history yourself, pass reasoning items unchanged in the next request'sinput. - Once the prompt reaches 200K tokens, long-context pricing applies to the entire request. The API examples and base prices on this page use the standard model.
Grok 4.7 Fast is available only in Cursor and Grok Build, with no public xAI API access.
References: Model overview, model pricing.