Skip to content

Lesson 25 ยท Inference and Optimization

Reasoning Effort in GPT and Claude

Control how much GPT and Claude models reason: effort settings in both APIs, hidden reasoning tokens, output limits, truncation and how to tune on your tasks.

Decoding and sampling showed how a model chooses each next token. Hosted GPT and Claude models add a control that matters a lot in practice: how much work the model puts into a response. Reasoning models can spend tokens working through a problem before they write the answer.

More effort can help on hard tasks. It also tends to add delay and cost. This lesson describes the documented controls as of December 2026.

Two similar settings

In OpenAI's Responses API the setting is reasoning.effort (Chat Completions calls it reasoning_effort). In Claude's Messages API it is output_config.effort. These examples are read-only; each needs the vendor's package, a client object and an API key.

Python
# Read-only: OpenAI Responses API
response = client.responses.create(
    model="gpt-6.2-sol",
    reasoning={"effort": "low"},
    max_output_tokens=25000,
    input="Plan the order of these five dependent tasks: ...",
)
print(response.status, response.usage.output_tokens_details.reasoning_tokens)
Python
# Read-only: Claude Messages API
message = client.messages.create(
    model="claude-opus-5-5",
    max_tokens=16000,
    output_config={"effort": "low"},
    messages=[{"role": "user", "content": "Plan the order of these five dependent tasks: ..."}],
)
print(message.stop_reason, message.usage.output_tokens)

Values and defaults depend on the model

Question OpenAI Claude
Values for current flagships GPT-6.2 Astra and Sol: low to max. GPT-6.1 Terra and GPT-6 Luna also accept none low, medium, high, xhigh, max on Fable 5.2 and the 5.5 models
Default Depends on the model; check its page medium for Opus 5.5 and Haiku 5.5; high for Sonnet 5.5 and Fable 5.2 in the API
Can thinking be switched off? Only on models that support none Depends on the model: it cannot be disabled on Opus 5.5 or Fable 5.2

Set the value explicitly in production, so a model change does not silently change your depth through a different default.

For Claude, adaptive thinking lets the model decide when and how much to think. You can write thinking={"type": "adaptive"} or, on the current models in this lesson, omit it. Older code that sets a fixed budget_tokens is rejected by the 5.5 models. Anthropic also describes effort as a behavioral signal, not a strict token budget. It affects all response tokens, including visible text and tool calls.

Reasoning uses the output budget

Reasoning or thinking tokens are billed as output tokens in both APIs. They also count against the limit on generated tokens: max_output_tokens at OpenAI and max_tokens at Anthropic. If the limit is small, the model can use much of it before the visible answer is complete, or even before it starts.

OpenAI's reasoning guide suggests reserving at least 25,000 tokens for reasoning and output while you are experimenting. Then tune from measured usage.

What you can see is limited too. OpenAI does not expose raw reasoning tokens through the API but can return summaries when you ask for them. What Claude returns about its thinking depends on the model and request settings. Do not build features that depend on reading a model's full internal reasoning. Also follow each API's rules for passing reasoning or thinking items back during tool use.

Python Stand-in: why a small limit cuts off answers

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Real models can adapt how much they reason and may interleave it with other output, which this arithmetic ignores. The lesson that carries over: check for truncation. At OpenAI look for status == "incomplete" and read the reason. At Anthropic look for stop_reason == "max_tokens". You can pay for a cut-off request even when it produced little or no visible text.

Tune with a sweep

Do not guess the best effort. Run the same test set at several levels and record quality, tokens and time. Then pick a level that meets your quality and delay limits at the lowest cost. This is an effort sweep.

Python Choose an effort level from sweep results

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The code uses token count as a simple stand-in for cost within one model. When nothing passes, as in the last line, more effort may not be the cure. Check whether the model lacks information, a tool or a clear instruction. Repeat the sweep after changing models: the same level name does not mean the same amount of work on another model or vendor.

A small gain between two levels may be noise. In the invented data, high passes one point more than medium while using more than twice the tokens. With a small test set you could not trust such a gap.

In the apps

ChatGPT and Claude may offer thinking or effort choices in their interfaces. Names and availability depend on plan and model, and they do not necessarily map one-to-one to API values. A sensible habit is to use a quicker choice for simple drafting and a deeper one for multi-step problems, then check the result either way.

A long reasoning process is not proof of a correct answer. Verify calculations, run code and check sources, whatever the effort level.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. A request ends as truncated with almost no visible text. What is a likely cause?

    Reasoning counts against the generated-token limit and is billed as output.
  2. 2. What is an effort sweep?

    A sweep shows which level is sufficient for your task.
  3. 3. How should you treat the effort level in production?

    Defaults differ by model, so an explicit tested value is more predictable.

Summary

  • OpenAI uses reasoning.effort; Claude uses output_config.effort.
  • Supported values and defaults depend on the model.
  • Reasoning counts toward output limits and bills; handle truncation.
  • Sweep effort on your own tests, and still verify answers.

Next: The KV Cache

Your progress is saved in this browser. No account needed.