Model capabilities

Reasoning

Key features

  • Think Before Responding: Reasoning models think through problems step-by-step before delivering an answer.
  • Math & Quantitative Strength: Excels at numerical challenges, logic puzzles, and complex analytical tasks.
  • Reasoning Trace: Usage metrics expose reasoning_tokens. Some models can also return encrypted reasoning via include: ["reasoning.encrypted_content"] (see below).

Encrypted reasoning content

The reasoning content is encrypted by us and can be returned if you pass include: ["reasoning.encrypted_content"] to the Responses API. You can send the encrypted content back to provide more context to a previous conversation. See Adding encrypted thinking content for more details on how to use the content, and Troubleshooting Reasoning to check that your multi-turn and tool-calling requests carry it.

Always returned for grok-4.7

On the Responses API, grok-4.7 returns reasoning.encrypted_content on every response, whether or not include lists it, together with the encrypted outputs of any server-side tools. Reasoning items in the output carry an encrypted_content field; pass them back unchanged in the next request's input so the model keeps its reasoning across turns even when you manage conversation history yourself. Unlike an explicit include, this default does not stop SpaceXSI from storing the thinking trace server-side for rehydration, so clients that ignore the field keep working as before; whether the response itself is stored for previous_response_id is governed by store, not by this setting. Chat Completions is unaffected; it has no field for the ciphertext.

When using the Vercel AI SDK, encrypted reasoning content is automatically included under the hood as long as store: false is not specified. No additional configuration is needed.

When encrypted reasoning is dropped

Encrypted reasoning is scoped to the team that created it. If a request sends back encrypted_content from another team, the API may ignore that reasoning. The request still returns 200, with no response field listing what was ignored, and the model continues without it. Altered or truncated ciphertext still fails with 400 (Could not decrypt the provided encrypted_content).

Keep each conversation on one team's API keys. See Troubleshooting Reasoning.


The reasoning_effort parameter

grok-4.7, grok-4.6, grok-4.5, and grok-4.3 support the reasoning_effort parameter, which controls how much effort the model spends thinking before responding.

If not specified, reasoning_effort uses the model's default: "high" on grok-4.7, grok-4.6, and grok-4.5, and "low" on grok-4.3. Only grok-4.3 accepts "none", which turns reasoning off. On the other models reasoning cannot be disabled, and a request with "none" returns a 400 error.

presence_penalty and frequency_penalty are not supported by current Grok models, and stop is not supported by reasoning models. On the Chat Completions API, a request that sets one of them returns a 400 error. The Responses API accepts all three but ignores them.

Effort levels

SettingDescriptionBest For
"none"No reasoning. Available only on grok-4.3Simple prompts where latency and cost matter most.
"low"Uses some reasoning tokens, but still fastLatency-sensitive agentic use and simple tool calling.
"medium"More thinking for less-latency sensitive applicationsComplex data analysis and long-context reasoning.
"high"Uses more reasoning tokens for deeper thinking. Available on grok-4.5 and later and on grok-4.20-multi-agentVery challenging problems, complex math, multi-step logic, competition-level tasks
"xhigh"Maximum reasoning depth, with correspondingly higher latencyThe hardest problems, where answer quality matters more than response time

"xhigh" is available on grok-4.6 and later. On grok-4.5, requests with "xhigh" are treated as "high".

Setting reasoning effort

The following example sets reasoning_effort to "high" for a challenging math proof. You can substitute "low", "medium", or (on supported models) "xhigh" as needed.

import { xai } from '@ai-sdk/xai';
import { generateText } from 'ai';

const result = await generateText({
  model: xai.responses('grok-4.7'),
  system: 'You are a highly intelligent AI assistant.',
  prompt: 'Find all prime numbers p such that p^2 + 2 is also prime. Prove your answer.',
  providerOptions: {
    xai: { reasoningEffort: 'high' },
  },
});

console.log('Final Response:', result.text);

Multi-agent model

For grok-4.20-multi-agent, the reasoning.effort parameter controls how many agents collaborate on a request rather than reasoning depth. See the Multi Agent documentation for details.

Summary table

Modelreasoning parameterBehavior
grok-4.7reasoning.effort: "low" / "medium" / "high" (default) / "xhigh"Controls reasoning depth (cannot be disabled)
grok-4.6reasoning.effort: "low" / "medium" / "high" (default) / "xhigh"Controls reasoning depth (cannot be disabled)
grok-4.5reasoning.effort: "low" / "medium" / "high" (default)Controls reasoning depth (cannot be disabled)
grok-4.3reasoning.effort: "none" / "low" (default) / "medium"Controls reasoning depth; "none" turns reasoning off
grok-4.20-multi-agentreasoning.effort: "low" / "medium" / "high" / "xhigh"Controls agent count (4 or 16)

Summarized reasoning content

For grok-4.7, we expose summarizations of the model's internal reasoning. Here's an example of how to stream the reasoning summary deltas alongside the final response:

import { xai } from '@ai-sdk/xai';
import { streamText } from 'ai';

const result = streamText({
  model: xai.responses('grok-4.7'),
  system: 'You are a highly intelligent AI assistant.',
  prompt: 'A projectile is launched at 30 m/s at 37° above horizontal from a 45 m cliff. Find its speed on impact. (g=10 m/s²)'
});

console.log("\n\n--------- Reasoning ---------")

for await (const part of result.fullStream) {
  if (part.type === 'reasoning-delta') {
    process.stdout.write(part.text);
  } 
}

Sample output

Output

--------- Reasoning ---------
The problem is: A projectile is launched at 30 m/s at 37° above horizontal from a 45 m cliff. Find its speed on impact. (g=10 m/s²)
I need to find the speed when the projectile hits the ground. It's launched at 30 m/s at 37° from a 45 m cliff, with g=10 m/s².

Conservation of energy is a good approach. The initial kinetic energy is (1/2)mv² with v=30 m/s, and initial potential energy is mgh with h=45 m, taking ground as zero.

At impact, potential energy is zero, so initial KE + initial PE = final KE.

Thus, (1/2)m(30)² + mg(45) = (1/2)m v_f²

v_f² = 900 + 2*10*45 = 900 + 900 = 1800

v_f = sqrt(1800) = 30√2 m/s ≈ 42.4 m/s

The angle doesn't affect the final speed because the initial kinetic energy and potential energy change are the same regardless of direction, as long as the speed and height are the same.

Yes, that makes sense. The final speed is sqrt(v0² + 2gh), independent of the launch angle.

When you use a reasoning model, the reasoning tokens are billed as part of your total consumption.


Last updated: November 26, 2026