Skip to content

Grok 4.7

grok-4.7

Grok 4.7 is SpaceXAI's flagship model for coding, agentic workflows, and professional knowledge work, succeeding Grok 4.6. It is particularly strong at long-running software engineering, self-verification, and long-context execution, while improving capabilities in document drafting, presentations, and other professional tasks. Trained with extended reinforcement learning focused on multi-hour problems, Grok 4.7 is optimized for sustained, complex task execution and natively supports the Grok Bot harness for conversational workflows. It also introduces an enhanced safeguard stack designed to combine strong jailbreak resistance with low refusal rates for legitimate technical work. Reported benchmark results use xhigh reasoning effort.

Context
500K tokens
Endpoint

Get API KeyCompare

Pricing

Input$1.60 / 1M
Output$4.80 / 1M
Cache Write (5m)$1.60 / 1M
Cache Write (1h)$1.60 / 1M
Cache Read$1.60 / 1M
Web Search$0 / 1M

Quick Start

Select an endpoint and copy a working example for this model.

Endpoint
python
from openai import OpenAI client = OpenAI(    api_key="YOUR_API_KEY",    base_url="https://api.apertis.ai/v1") response = client.chat.completions.create(    model="grok-4.7",    messages=[        {"role": "user", "content": "Hello!"}    ],    max_tokens=1024,    temperature=0.7) print(response.choices[0].message.content) # Optional: Enable context compression to reduce token usage# response = client.chat.completions.create(#     model="grok-4.7",#     messages=[{"role": "user", "content": "Hello!"}],#     extra_body={"compression": {"enabled": True, "model": "gpt-4.1-mini"}}# )

Supported Parameters

API docs
Common7 params
modelmessagesmax_tokenstemperaturetop_pstreamtools
Extended4 params
reasoning_effortstream_optionsthinkingextra_body

Cursor IDE Model IDs

Use these namespaced identifiers in Cursor IDE to avoid conflicts with built-in models.

grok-4.7