Reasoning tokens: what model reasoning costs and how to keep it in check
A short answer, yet thousands of output tokens in your stats — that's model reasoning. Where it comes from, what it costs, and how to control it in OpenAI and Anthropic format.
6 min · · models · экономия
You asked a model a short question, got a three-line answer, and your stats show several thousand output tokens. Most often those are reasoning tokens: the model "thought" before answering, and that thinking costs money too. Below: what these tokens are, how vendors bill them, which parameters limit them, and where to track your spending.
What reasoning tokens are
Reasoning models generate an internal chain of reasoning before the final answer: they break the task down, weigh options, check themselves. That chain is made of ordinary tokens, but you usually don't see it in full in the response.
What the vendors' official docs say:
- OpenAI: reasoning tokens take up space in the model's context window and are billed as output tokens. Depending on the task's complexity there can be anywhere from a few hundred to tens of thousands of them.
- Anthropic: Claude's reasoning comes back in blocks of type
thinking. On newer models the text of those blocks isn't returned by default, but, as the docs put it, the reasoning happens and is billed the same under every display setting.
The key practical takeaway: the cost of a response depends not only on the length of the visible text but on how much the model thought.
Reasoning tokens: cost by example
The formula is the same as for any request — there are just more output tokens than meet the eye:
cost = input × input_price / 1,000,000
+ (visible_answer + reasoning) × output_price / 1,000,000
An example for claude-opus-5-5 (prices as of October 6, 2026: $0.4 per 1M input and $2 per 1M output tokens). The request is 3,000 input tokens, the visible answer 500 tokens, reasoning 4,000 tokens (illustrative numbers):
- Input: 3,000 × $0.4 / 1M = $0.0012
- Output: (500 + 4,000) × $2 / 1M = 4,500 × $2 / 1M = $0.009
- Total: $0.0102
Without reasoning, the same request would cost 3,000 × $0.4 / 1M + 500 × $2 / 1M = $0.0012 + $0.001 = $0.0022. Over 10,000 such requests a month, that's $102 versus $22. So for tasks that don't need deep reasoning, it's worth limiting it.
For most models output tokens cost noticeably more than input tokens; that's standard vendor practice. For the current list and prices, see GET https://api.zukko.pro/v1/models or the Models page in your dashboard.
Where to see reasoning tokens in a response
In the vendors' official formats, the reasoning token count comes in a separate field:
| Format | Where to look |
|---|---|
| OpenAI Chat Completions | usage.completion_tokens_details.reasoning_tokens (already included in completion_tokens) |
| OpenAI Responses | usage.output_tokens_details.reasoning_tokens |
| Anthropic Messages | reasoning is included in usage.output_tokens |
Which detail fields come through the gateway for a given model is something to check with a test request. A reliable signal either way: compare output tokens from usage with the length of the visible answer — if output is several times longer than the text, the model was reasoning.
The reasoning_effort parameter in OpenAI format
In Chat Completions, reasoning depth is set by reasoning_effort. The official OpenAI SDK lists the values none, minimal, low, medium, high, xhigh and max, but as OpenAI points out, not every model supports every value. The lower the level, the fewer tokens go to reasoning and the faster the response.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.zukko.pro/v1",
api_key=os.environ["ZUKKO_API_KEY"],
)
response = client.chat.completions.create(
model="gpt-6.1-sol",
reasoning_effort="low",
max_completion_tokens=4000,
messages=[{"role": "user", "content": "Classify this review: 'Fast delivery, but the box was dented'"}],
)
usage = response.usage
details = usage.completion_tokens_details
print(response.choices[0].message.content)
print("total output:", usage.completion_tokens)
print("of which reasoning:", details.reasoning_tokens if details else "no data")The Zukko API reference lists reasoning_effort among the optional chat/completions parameters; how a model responds to a specific value is up to its provider.
Watch max_completion_tokens: per OpenAI's docs it caps the visible answer and reasoning together. Set it too low and the model may spend the whole limit on reasoning and return an empty answer — while the input and the reasoning tokens spent are still billed. OpenAI recommends leaving headroom while you experiment.
In the Responses API, the reasoning object does the same job:
response = client.responses.create(
model="gpt-6.1-sol",
reasoning={"effort": "low"},
input="Write a subject line for an email telling a client the meeting is moved",
)
print(response.output_text)
print(response.usage)The thinking parameter in Anthropic format
Claude's reasoning settings work differently, and they've changed over the past year. According to Anthropic's current docs:
- Newer models use adaptive reasoning:
thinking: {"type": "adaptive"}— the model decides whether and how much to think. - Depth is set by
effortinsideoutput_config:low,medium,high,xhigh,max. This is the recommended lever for controlling spend. - The old
thinking: {"type": "enabled", "budget_tokens": N}form is deprecated: it still works on the 4.6 family, while newer models reject it with a 400 error. - On Claude Opus 5.5, reasoning can't be turned off and
effortdefaults tomedium; the only way to cut spend is thelowlevel.
import os
import anthropic
client = anthropic.Anthropic(
base_url="https://api.zukko.pro",
api_key=os.environ["ZUKKO_API_KEY"],
)
response = client.messages.create(
model="claude-sonnet-5",
max_tokens=16000,
thinking={"type": "adaptive"},
output_config={"effort": "low"},
messages=[{"role": "user", "content": "Suggest three names for a flower delivery service"}],
)
for block in response.content:
if block.type == "text":
print(block.text)
print("output tokens:", response.usage.output_tokens)If your SDK version doesn't know output_config, update the anthropic package. Make a few test requests with different effort values and compare output_tokens: that checks both that the parameter is accepted through the gateway and its real effect on spend. When reasoning is actually worth it is covered in the article on extended thinking.
How to track spending
- The dashboard. The Usage section shows your spending history. If spend went up after you switched on a new model or parameter, start looking here.
- The API. Balance and spending history can be pulled programmatically — see the /v1/usage reference. Handy for a daily report in your team chat.
- Logging
usage. For every request, log the model, input and output tokens, and reasoning tokens where available. After a week you'll see which tasks "think" the most expensively. - Separate keys. Give a reasoning-heavy service its own key with a daily dollar limit: overruns won't affect other services. How to set this up is covered in the article on spending limits for agents.
- A cap on the response.
max_tokensormax_completion_tokenslimits the worst case, but leave headroom so reasoning doesn't eat the entire limit.
How to choose a reasoning level
Classification, field extraction and short chat answers usually don't need deep reasoning — start at a low level. Multi-step tasks with code, calculations and planning may benefit from a high one. Test on your own data: take 20 typical tasks, run them at two levels, compare quality and output tokens. Count the cost of a solved task, not of a request: a cheap answer you have to re-ask ends up costing more.
You can create a key for experiments on the API keys page — give it a small daily limit and compare levels without worry.
FAQ
Why is completion_tokens much larger than the answer text?
It includes reasoning tokens. Check completion_tokens_details.reasoning_tokens if the response has it, or lower reasoning_effort and compare.
At what price is reasoning billed?
At OpenAI and Anthropic, reasoning tokens are billed as output. Check the actual charges for your own requests in the dashboard's Usage section.
Can reasoning be turned off completely?
It depends on the model. In OpenAI format, some models accept reasoning_effort="none". According to Anthropic's docs, Claude Sonnet 5 accepts thinking: {"type": "disabled"}, while on Claude Opus 5.5 reasoning can't be turned off — effort: "low" is what's left.
Can I read the reasoning itself?
Vendors don't return the full chain. Anthropic and OpenAI can return a summary of the reasoning via a separate parameter, but check whether the gateway supports it for a given model with a test request.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- Grok API price: cost of Grok 4.7, 4.6 and 4.5 with examplesWe price requests to Grok 4.7, 4.6 and 4.5 in Zukko on three scenarios and compare with official xAI prices. Formulas are shown and the arithmetic can be checked.
- DeepSeek API for free: is there a free tier and what is the minimum costWe do not promise free access, but the minimum is very low. A formula-based count of how many requests fit into one dollar.
- DeepSeek API price: cost of V4 Pro and V4.1 Flash worked throughWhat requests to three DeepSeek models cost: the formula, three typical scenarios at 10,000 requests, the role of the cache and a usage-based cost script.
- opencode agents: setting up roles, models and toolsA custom agent in opencode is a role, a model and a set of permissions. A working config where a cheap model handles routine work and a stronger one edits code.