Skip to main content

How to Set the Effort Level of Claude in the API

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

Claude's newest models decide for themselves how long to think before answering. The effort setting tells them how much care a task deserves: less effort means fewer tokens, lower cost and a faster reply; more effort means deeper thinking. This guide asks the same question at two levels, with real output from Claude Opus 5.5 and anthropic 2.14.0.

Syntax​

Syntax
message = client.messages.create(
model="<model ID>",
max_tokens=<limit>,
output_config={"effort": "<level>"},
messages=[...],
)
PartWhat it means
output_config={"effort": ...}Sets the effort for this request
"<level>"low, medium, high, xhigh or max, from the cheapest to the most thorough

Anthropic's effort documentation: "Most Claude models default to high effort, spending as many tokens as needed for excellent results; Claude Opus 5.5 and Claude Haiku 5.5 default to medium." Effort "affects all tokens in the response", thinking included, and "Effort is a behavioral signal, not a strict token budget."

What It Costs​

The Claude API is paid. Claude Opus 5.5 costs $4 per million input tokens and $20 per million output tokens, and thinking tokens are billed as output. This guide's two calls produced 96 output tokens in total, $0.0019 at that price, plus a few dozen input tokens each.

Prerequisites​

  • A Claude API key, in a .env file as ANTHROPIC_API_KEY=....
  • The Anthropic Python SDK in a uv project. This guide uses anthropic 2.14.0, added with uv add anthropic, on Python 3.15.2.

Step 1: Write the Script​

effort.py
import anthropic

client = anthropic.Anthropic()
question = "A train leaves at 9:40 and the trip takes 2 hours 35 minutes. When does it arrive? Answer in one short sentence."

for effort in ["low", "high"]:
message = client.messages.create(
model="claude-opus-5-5",
max_tokens=4096,
output_config={"effort": effort},
messages=[{"role": "user", "content": question}],
)
thinking = message.usage.output_tokens_details.thinking_tokens
print(f"{effort}: {message.usage.output_tokens} output tokens, {thinking} of them thinking")
print(message.content[-1].text)

The effort.py script in a macOS-style code window: the same train question is sent to claude-opus-5-5 twice, with output_config effort low and then high, printing the output tokens, the thinking tokens and the answer.

usage.output_tokens_details.thinking_tokens reports how many of the output tokens were spent thinking. The answer is the last content block.

Step 2: Run It​

Terminal
uv run --env-file .env effort.py
Output
low: 29 output tokens, 0 of them thinking
9:40 + 2:35 = 12:15. The train arrives at 12:15.
high: 67 output tokens, 53 of them thinking
The train arrives at **12:15**.

The output in a terminal: low effort used 29 output tokens with 0 thinking and answered 12:15, high effort used 67 output tokens with 53 thinking and answered 12:15.

Both answers are right. At low, Claude answered without thinking at all; at high, it spent 53 tokens thinking first and produced more than twice as many output tokens. For an easy question, low effort is enough; save higher effort for problems that need it.

Common Mistakes​

MistakeWhat happensDo this instead
Expecting effort to be a hard token limitIt's a signal; Claude still thinks on hard problems at low effortUse max_tokens for a hard limit
Leaving it out and assuming highOn Claude Opus 5.5 the default is mediumSet the level you want explicitly

Troubleshooting​

SymptomLikely causeFix
Replies are slow and expensive for simple tasksEffort is higher than the task needsTry low or medium and compare the answers

FAQ​

Does setting "medium" change anything on Claude Opus 5.5?​

No. Anthropic's documentation says that setting effort to the model's default "produces exactly the same behavior as omitting the effort parameter entirely". Setting it still documents your choice.

Can I turn thinking off on Claude Opus 5.5?​

No. Anthropic's thinking documentation says these models reject thinking: {type: "disabled"}: "Thinking can't be turned off on these models." Effort is how you control it, and at medium Claude "Might skip thinking for simple queries", as it did here at low.

Conclusion​

output_config={"effort": "low"} answered the train question in 29 output tokens without thinking, and "high" used 67, 53 of them thinking, for the same correct answer.

Additional Resources​

  • Effort — the levels, defaults and what they affect.
  • Create a Message — output_config and the usage fields.