cd /news/large-language-models/reasoning-tokens-vs-visible-tokens-h… · home › topics › large-language-models › article
[ARTICLE · art-178259] src=dev.to ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Reasoning tokens vs visible tokens: how to measure the split

A developer measured LLM API usage and found that billed `completion_tokens` can vastly exceed the visible answer length, with one model reporting 1,837 completion tokens for a 137-token response on a short prompt. The writeup proposes a provider-agnostic trick — re-feeding the visible response to the same model and reading `prompt_tokens` — to isolate hidden reasoning tokens, and recommends logging `finish_reason` alongside token counts to distinguish four call outcomes.

recommendation

Re-prompt the same model with each visible response and read `prompt_tokens` to separate hidden reasoning from written output, and log `finish_reason` beside the counts.

more in playbook: Controlling LLM cost
by read3 min views2 publishedNov 29, 2026

I spent a week measuring what an LLM request costs, and the number that broke my measurement was not a price. It was that usage.completion_tokens is not the length of the answer.

On a short prompt — 47 tokens, "list exactly three differences between TCP and UDP" — with max_tokens set to 600, one model reported 1,837 completion tokens. The visible answer was 137 tokens.

The other 1,700 tokens were billed and never shown to me.

If you treat completion_tokens as output length, three things go wrong at once:

Cost estimates are wrong in the direction that hurts. You budget from a number that understates, and the gap is not a percentage. In my sample it was an order of magnitude.

Benchmarks plot the wrong x-axis. A test-time-compute curve is usually drawn against tokens spent. If the tokens include invisible reasoning, the curve mixes "how much the model thought" with "how much it wrote", and those have very different slopes.

"Output length variance" measures the wrong thing. I published a post last week claiming output length is unstable with a 4.7x spread between models. That claim survives, but the interpretation was wrong: the visible answers were nearly identical across runs. The variance was in the thinking, not the writing.

Some providers expose reasoning tokens in a separate field. Most do not. When they do not, there is a trick that works everywhere:

Feed the visible response back in as a prompt to the same model and read prompt_tokens. That is the token count of what was actually written, in the same tokenizer. The difference against completion_tokens is the hidden part.

r = call(model, prompt)
visible = r["choices"][0]["message"]["content"]
billed = r["usage"]["completion_tokens"]

r2 = call(model, visible, max_tokens=1, temperature=0)
visible_tokens = r2["usage"]["prompt_tokens"]

print(billed, visible_tokens, billed - visible_tokens)

It costs one extra request per measurement and needs no provider support.

doubao-seed-2.1-turbo, max_tokens 600, one short prompt, three runs:

run billed completion_tokens visible text hidden
1 1,837 137 1,700
2 2,640 125 2,515
3 1,861 153 1,708

The visible answer never came close to the cap. The cap bounded what I could see and did not bound what I was billed for. If you budget from max_tokens, the number you are budgeting against is not the number you are charged.

deepseek-v4-flash, same setup, five runs:

run billed visible text
1 268 73
2 271 85
3 116 74
4 139 76
5 184 72

Billed tokens spanned 2.3x. Visible tokens spanned 1.2x. The answer was stable; the thinking was not.

Once you separate the two, a call stops being "ok / not ok" and becomes four states:

finish_reason: stop, content present, count sane. finish_reason: length. The fourth is the one that costs debugging time. It passes every "did the call succeed" check, parses as far as most parsers care, and returns an answer that stops before the part that mattered.

Log finish_reason next to the token counts, not instead of them. Then one boolean does not have to carry four meanings.

I have not separated why some models reason before answering and others do not. I tested one endpoint on two days. The split may differ by provider, by time of day, and by routing.

And the split is not a bug. Reasoning is the feature. The problem is only that the number on the invoice does not say which half it is paying for.

completion_tokens is not output length.finish_reason beside the counts. The number on your invoice is honest. It is your label for it that was wrong.

── more in #large-language-models 4 stories · sorted by recency
── more on @doubao-seed-2.1-turbo 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/reasoning-tokens-vs-…] indexed:0 read:3min 2026-11-29 · —