Grok 4.7 Text generation API

xai / grok-4.7

An xAI reasoning model for coding, agentic tasks, and long-context text-and-image analysis.

Use xai/grok-4.7 through the sjolt LLM API.

Model IDxai/grok-4.7
Input
TextImage
Output
Text
Pricing

Token rates

Input
$0.6 / 1M tokens
Cache read
$0.15 / 1M tokens
Output
$1.8 / 1M tokens
Grok 4.7xai/grok-4.7

Start a conversation

Write a message below to begin.

Model overview

Grok 4.7 for coding, reasoning, and knowledge work

Connect code, documents, and visual context in a reasoning workflow. The artwork on this page illustrates these capabilities; it is not image output from Grok 4.7.

Grok 4.7 text generation model cover
01 · Text generation

Build and refine with tools

Describe the goal, provide relevant code and constraints, and use function calls to connect your application tools. Return tool results to continue the reasoning loop.

  • Send one required user prompt with optional system instructions.
  • Review the exact non-streaming OpenAI Chat request before running it.
  • Inspect assistant text, finish reason, response ID, and token usage together.
Grok 4.7 long-context text generation model cover
02 · Input and output

Connect a large working context

Bring text and images into a 500,000-token context window. Supply the relevant source material and specify the desired response structure for focused analysis.

Input
TextImage
Output
Text
Grok 4.7 API compatibility model cover
03 · API integration

Choose the reasoning depth

Select low, medium, high, xhigh reasoning effort. The Playground defaults to high; use a lighter level for simpler work or xhigh for deeper analysis.

  • Compare enabled DeepSeek text models in one place.
  • Copy the request preview to keep application requests aligned with the Playground.
  • Handle assistant responses and provider availability states in the same workflow.

Model characteristics

Better for creative validation than isolated one-off generation.

01

Workflow focus

Coding, agentic tasks, and knowledge work with text and image inputs.

02

Context window

Up to 500,000 context tokens.

03

Output

Text output with no separately specified output-token ceiling; the context window and upstream constraints still apply.

04

Reasoning control

low, medium, high, xhigh; high is the default in the Playground.

FAQ

These are the first questions to answer when evaluating this model.

What is Grok 4.7 suited to?

Use it for software engineering, multi-step reasoning, document analysis, and workflows that call your application tools. State the goal, constraints, and expected output clearly.

Can I include images?

Yes. Send text and image content through Chat Completions or Responses, or attach images in the Playground. Image fields pass through unchanged for upstream validation; responses are text.

How do I choose a reasoning level?

Use low, medium, high, xhigh. The Playground defaults to high.

How much context and output can I use?

The context window is 500,000 tokens. No separate fixed text-output ceiling is specified; caller-selected token limits are forwarded to the upstream.

Which API formats are available?

Use model xai/grok-4.7 with OpenAI-compatible Chat Completions or Responses through the sjolt LLM API. Both streaming and non-streaming requests use the same model route.

How do I continue a Responses conversation?

Include the prior response items in the next request input, preserving any reasoning.encrypted_content unchanged alongside the relevant conversation and tool results.