Sub topic 5
Setting an effort level
This chapter assumes you have called an LLM API from Python, know what tokens and max output tokens are, and have read the earlier chapters on reasoning models and reasoning tokens. Here you will set an effort level in a request and check what it changed.
What an effort level is
An effort level is a coarse setting that tells a reasoning model how much thinking to do before it answers. You do not pick a number of tokens. You pick a label, and the model decides how many reasoning tokens to spend within that guidance.
OpenAI's reasoning models take three common values:
| Effort | Typical behavior | Typical use |
|---|---|---|
| `low` | Short internal reasoning, fast and cheap | Simple extraction, arithmetic, routine classification |
| `medium` | Balanced, usually the default | General questions, light multi-step tasks |
| `high` | Long internal reasoning, slower and costlier | Hard math, tricky code, multi-constraint planning |
Some newer models accept additional values, such as a minimal level below low. Check the documentation for your exact model, because the accepted set differs between models.
Effort is a hint, not a guarantee. A low request on a hard problem can still use many reasoning tokens, and a high request on a trivial question may use few.
Setting effort in the Responses API
In the OpenAI Responses API, effort goes in the reasoning parameter.
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="o4-mini",
reasoning={"effort": "low"},
input="A train leaves at 14:10 and arrives at 17:45. How long is the trip?",
)
print(response.output_text)
print("reasoning tokens:", response.usage.output_tokens_details.reasoning_tokens)
print("total output tokens:", response.usage.output_tokens)The last two lines show how much of the output was spent on thinking. Reasoning tokens are counted inside output_tokens and billed at the output rate, even though you never see them. The difference between the two numbers is the length of the visible answer.
The older Chat Completions API uses a flat parameter instead: reasoning_effort="low". The nesting differs, but the meaning is the same.
Reading the result
Run the same prompt at low and high and compare the two token counts. For the train question, expect a small reasoning count at both levels, because the problem is easy. For a harder problem, the gap grows. That gap is the cost you pay for the extra thinking, and it also shows up as added latency, since the model generates those tokens before the answer starts.
Choosing a level
Start low and move up only when measurements justify it. Starting at high and never testing lower is the most common way to overspend.
Common errors
- Setting effort on a model that does not support it. Standard chat models reject the parameter or ignore it. Confirm the model is a reasoning model.
- Expecting a fixed token count. Effort does not set a number. If you need a hard cap on thinking, use a budget (covered in the next chapter) or a maximum output limit.
- Leaving no room for the answer. Reasoning tokens count against the output limit. At
higheffort with a smallmax_output_tokens, the model can spend everything on thinking and return an empty or cut-off answer. Check the response status for an incomplete result. - Judging by one prompt. Reasoning length varies between runs. Compare levels over a set of cases, not a single try.
Exercise
You run a support-ticket classifier on medium effort. Accuracy is 96%, and average latency is 6 seconds. You test low and get 95% accuracy with 2 seconds of latency. What should you do next, and why?
Show answer
Test low on a larger and harder sample, including the cases the classifier currently gets wrong. If accuracy stays within your tolerance, switch to low. It cuts latency by two thirds and reduces reasoning tokens billed at the output rate, at a cost of about one point of accuracy. A single small comparison is not enough to confirm the difference is real, so verify before committing.