Reasoning

Reasoning passes through under each protocol's native parameters. Whether reasoning content is returned depends on the model: claude-opus-4-8 returns thinking blocks, and GPT models control effort through reasoning.effort in the Responses API.

Controlling reasoning tokens

Max tokens for reasoning

In the Anthropic format, add thinking with a budget_tokens limit; max_tokens must exceed budget_tokens:

json
{
  "model": "claude-opus-4-8",
  "max_tokens": 3000,
  "thinking": {"type": "enabled", "budget_tokens": 2000},
  "messages": [{"role": "user", "content": "Prove in three steps that the square root of 2 is irrational"}]
}

Reasoning effort level

In the OpenAI Responses API, set reasoning.effort (such as low):

json
{
  "model": "gpt-5.6-sol",
  "input": "1+1=?",
  "reasoning": {"effort": "low"}
}

Tokens spent on reasoning are reported in usage.output_tokens_details.reasoning_tokens.

Preserving reasoning

With thinking enabled in the Anthropic format, content holds a thinking block followed by a text block, and usage.output_tokens includes the thinking. When sending conversation history back in later turns, include the thinking blocks unchanged.

Ready? Three steps to startLog in to the console · top up · create an API key
DiscordGet community help instantly
Reasoning · Docs