⌘K

Grok 4.7

grok-4.7

xAI's latest model for coding, agentic software engineering, and knowledge work. It supports text and image input, function calling, structured outputs, and configurable reasoning effort, with improved long-running task execution, self-checking, and long-context management. Use it through Vtrix Chat Completions with model ID `grok-4.7`.

Authentication

authorization string required

All APIs require authentication via Bearer Token.

Get API Key:

Visit API Key Management Page to get your API Key

Usage:

Add to request header:

Authorization: Bearer YOUR_API_KEY

Model notes

Grok 4.7 is optimized for coding and knowledge work, including tasks that run for hours. It improves self-checking, long-context management, document and presentation generation, and native understanding of the Grok Bot harness. It is available through the Grok API and compatible third-party routing and coding tools.

The model supports configurable reasoning with low, medium, high, and xhigh. The default reasoning effort is high, and reasoning cannot be disabled.

The standard API price is $2 per million input tokens and $6 per million output tokens. A fast variant doubles output speed and doubles the price.

For reasoning requests, avoid sending presence_penalty, frequency_penalty, or stop, because upstream reasoning models reject those parameters.

Parameters

model string required

Model ID to use for the request.

Value: grok-4.7


messages array required

Array of message objects representing the conversation history.

role string required

Message role.

Options: user, assistant, system, developer

content string | array required

Text string or multimodal content array. Supports text and image input.


reasoning_effort string

Controls how much reasoning the model performs before answering. Reasoning cannot be disabled for this model.

Default: high

Options: low, medium, high, xhigh


max_tokens integer

Maximum tokens to generate in the completion. The effective limit depends on the selected route and upstream response budget.


temperature number

Sampling temperature to use.

Default: 1.0

Range: 0.0 - 2.0


top_p number

Nucleus sampling parameter.

Default: 1.0

Range: 0.0 - 1.0


stream boolean

Whether to stream response incrementally.

Default: false


tools array

List of tools the model may call.

type string required

Tool type.

Options: function

function object required

Function tool definition.


tool_choice string | object

Controls how the model selects tools.

Options: none, auto, required, or an explicit function selection object


response_format object

Format that the model must output. Used for structured outputs.

type string required

Output format type.

Options: text, json_object, json_schema