AI for developers
Reasoning Tokens vs Output Tokens: How OpenAI, Claude and Gemini Count Hidden Thinking
In short
Reasoning tokens vs output tokens is a bookkeeping question with a practical bite: on OpenAI, Claude and Gemini the hidden thinking is billed like output and also uses up the max-token cap, so a small cap can return an empty answer you still pay for. Where the thinking count appears in usage differs on each API.
Why can a response come back empty and still cost money?
The model spends its token allowance on thinking first. OpenAI's reasoning guide says that when generation hits the context window or your max_output_tokens value, the response is marked incomplete, and that this can happen before any visible output exists, so you pay for input and reasoning without receiving an answer. Gemini describes the same trap: reach max_output_tokens during thinking and you get MAX_TOKENS with a truncated or empty reply, while the thinking tokens already generated are still billed.
Where do reasoning tokens appear in the usage numbers?
The three vendors put the same quantity in three places, and one of them keeps it outside the output counter.
| API | Field that reports the thinking | Relation to the output count |
|---|---|---|
| OpenAI | usage.output_tokens_details.reasoning_tokens | Included in output_tokens; the guide's example shows 1,024 reasoning tokens inside 1,186 output tokens |
| Claude | usage.output_tokens_details.thinking_tokens | A breakdown of the billed output tokens; when streaming it appears only on the final message_delta event |
| Gemini | usage_metadata.thoughts_token_count (thoughtsTokenCount) | A separate counter next to the candidates token count; pricing is the sum of both |
Does the token cap include the thinking?
Yes, on all three, which is why the cap is a poor cost lever for reasoning models.
OpenAI says max_output_tokens limits everything the model generates: reasoning tokens, visible output tokens and non-visible formatting tokens. It suggests reserving at least 25,000 tokens for reasoning and output when you begin experimenting.
Claude counts thinking toward max_tokens for the turn. With a manual budget, budget_tokens must be at least 1,024 and below max_tokens, so that room remains for the answer. The exception is interleaved thinking in manual mode, where the budget spans all thinking blocks in one assistant turn and may exceed max_tokens. The budget is a target rather than a hard cap, and Claude can stop earlier.
Gemini treats max_output_tokens as a hard cutoff that includes thought tokens, and advises lowering thinking_level instead of setting a small cap when the goal is cost or latency.
Which knob controls how much the model thinks?
Claude's manual mode, thinking enabled with budget_tokens, is deprecated. Claude 4.7 and later reject it with a 400 error. The replacement is adaptive thinking, where Claude decides per request whether and how deeply to think, and an effort setting in output_config shapes the depth. Changing budget_tokens between requests also invalidates cache breakpoints, because the value is rendered into the prompt.
Gemini's equivalent is thinking_level. On the Gemini 4 Neon and Hydrogen models it defaults to high and supports xhigh, and the page warns that xhigh can overthink simple extraction prompts and exhaust max_output_tokens. The older thinkingBudget is deprecated on Gemini 4 models and, if passed alone, maps to the nearest level.
The OpenAI pages I read for this comparison do not describe a token budget for thinking. The guide covers the cap and the reserve described above.
Does a summary of the thinking change what you are billed?
Not on Claude. Its docs say a thinking block is billed the same whether the summary is returned or omitted, and that omitted blocks come back with an empty thinking field. You pay for the thinking Claude did, not for the text you read.
OpenAI says reasoning tokens are not visible through the API yet still take up context window space and are billed as output tokens. Gemini offers thought summaries through a thinking_summaries setting, and a thought block may hold only a signature with no summary on simple requests, so code must tolerate an empty summary.
What should you log and set in a reasoning workload?
Record the thinking count from each vendor's own field, because the output counter alone hides it on Claude and OpenAI and excludes it on Gemini.
- Leave a generous cap at first, then lower thinking effort instead of squeezing the cap.
- Treat an empty answer with a MAX_TOKENS, incomplete or max_tokens signal as a budget problem, not a model failure.
- On Gemini, remember that input, thinking and output share one 1,048,576-token context window, and the output limit is trimmed to what remains after the input.
What else do people ask?
Are reasoning tokens always billed as output tokens?
OpenAI and Claude say so directly. Gemini says response pricing is the sum of output tokens and thinking tokens.
Can I see the reasoning text itself?
Not necessarily. OpenAI says reasoning tokens are not visible through the API, Claude may return an empty thinking field when summaries are omitted, and Gemini returns summaries only when enabled.
Sources
- OpenAI API docs, Reasoning models, fetched 2026-11-20
- Claude Platform docs, Extended thinking, fetched 2026-11-20
- Gemini API docs, Thinking, fetched 2026-11-20
- Claude Platform docs, Thinking, fetched 2026-11-20
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. This page compares the three vendors' documentation, which I read on 20 Nov 2026. I did not run requests against the APIs for it, so it reports documented accounting, not measured token counts. It leaves out prices, model-by-model defaults and benchmark scores. Found a mistake? Tell me.