Skip to content
Docs ·Reasoning

Reasoning

Set reasoning effort

How deeply one will think about it…

It’s determined by reasoning_effort or reasoning.effort. You can use low, medium, and high. Depending on the model, none and xhigh may also be used.

client.chat.completions.create(
    model="anthropic/claude-opus-5.5",
    messages=[{"role": "user", "content": "Find the error in this proof"}],
    reasoning_effort="high",
    # To get the answer without reasoning text
    extra_body={"reasoning": {"exclude": True}},
)
  • The model that returns the reasoning text is sent along with the response in the message.reasoning section. If the reasoning.exclude is enabled, it will be excluded from the response.
  • The tokens used in the reasoning process are incorporated into the output tokens. They can also be seen separately at usage.completion_tokens_details.reasoning_tokens.
  • For models that are not subject to reasoning, just send them without that option.

For the task of passing along Claude’s thought blocks, i.e., the process of repeatedly calling the tool while keeping the thought alive, please use Messages API.