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.

Why this matters more than it sounds

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.

How to measure the split, on any endpoint

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"] # Same model, same tokenizer: this counts the text we can see. 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.

What it looks like in practice

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.

The four outcomes of a model call

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

  1. Inside the cap. finish_reason: stop, content present, count sane.
  2. Over the cap. Words arrive, but the billed count exceeds what you sent. Loud — the number gives it away.
  3. Empty. 200 OK, no content, and the whole budget went to reasoning before any answer was written. Quiet, but detectable, because there is nothing to read.
  4. Truncated but non-empty. Content arrives, stops mid-object, finish_reason: length. Silent.

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.

What I have not established

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.

What to take

  1. completion_tokens is not output length. Feed a response back in as a prompt to find out what is actually visible.
  2. Log finish_reason beside the counts. Four states, not one boolean.
  3. Plot benchmarks against visible tokens if you want to isolate what the model wrote, and against billed tokens if you want cost. Do not use one for the other.
  4. Expect the gap to vary by model. In my sample it ranged from zero to 92% hidden.

The number on your invoice is honest. It is your label for it that was wrong.