🟡 🏥 In Practice Published: · 3 min read ·

Anthropic: Messages API Returns usage.output_tokens_details.thinking_tokens — What It Means for Billing and Streaming

Urednička ilustracija: Messages API vraća usage.output_tokens_details.thinking_tokens — što znači za fakturiranje i st

The Anthropic Messages API now includes the output_tokens_details.thinking_tokens field in the usage object of every response that uses Extended Thinking. Developers measuring inference costs need to know that all generated thinking tokens are billed — not the summarized view returned in the response. The difference can be 20x or more.

🤖

This article was generated using artificial intelligence from primary sources.

The Anthropic Messages API now explicitly reports internal thinking tokens through the output_tokens_details.thinking_tokens field inside the usage object. This change lets developers precisely track the cost of Extended Thinking calls — but with an important caveat that may surprise teams who have not read the documentation carefully.

What is usage.output_tokens_details.thinking_tokens and why does it matter?

The field appears in every API response that uses Extended Thinking and has the following structure:

{
  "usage": {
    "input_tokens": 1024,
    "output_tokens": 512,
    "output_tokens_details": {
      "thinking_tokens": 10000
    }
  }
}

The key distinction: Anthropic bills for all generated thinking tokens, not the summarized view returned to the user. If thinking_tokens: 10000 but the summary in the thinking block contains only 500 tokens, the billing is for 10,000. The difference between visible and billed tokens can be a factor of 20 or more, depending on task complexity and model.

How does thinking block summarization work?

Claude Sonnet 4.6, Opus 4.6, and newer models use summarization (summarized thinking) as the default display. Internal reasoning is processed by a special model that compresses conclusions into a shorter form — that summary appears in the thinking field of the block, while the full token count is recorded in thinking_tokens.

Summarization does not affect thinking quality — Claude sees the entire internal process; only the output representation is reduced for the user. The signature field in the thinking block stores an encrypted version of the full content for multi-turn conversations and must be forwarded unchanged when continuing the session.

Streaming behavior and latency

Developers who want to reduce latency to the first text token can use display: "omitted" in streaming mode:

  • The server does not emit thinking_delta events
  • Streaming of thinking content is skipped entirely
  • Result: faster time to first text token
  • Cost remains unchanged — thinking tokens are still billed

Claude Fable 5, Mythos 5, and Opus 4.8 use display: "omitted" as the default, while Sonnet 4.6 and Opus 4.6 use display: "summarized".

Budget limits and cache interaction

The budget_tokens parameter sets an upper limit on thinking tokens per request and must be smaller than max_tokens. With interleaved thinking, the budget is shared across all thinking blocks in a session. Important limitation: changing thinking parameters (enabling/disabling, changing the budget) invalidates cache breakpoints for messages — systems that aggressively use prompt caching must account for this cost.

Maximum output limits: Opus 4.8, 4.7, 4.6 and Mythos Preview support up to 128k output tokens; Sonnet 4.6 and Haiku 4.5 up to 64k. With the Batch API and the output-300k-2026-03-24 beta flag, Opus models can generate up to 300k tokens.

Frequently Asked Questions

What is output_tokens_details.thinking_tokens in an Anthropic API response?
It is a field inside the usage object that shows how many thinking tokens Claude actually generated during internal reasoning. The number can differ drastically from the tokens visible in the thinking block, because thinking may be summarized.
How are thinking tokens billed in the Anthropic API?
All generated thinking tokens (shown in the thinking_tokens field) are billed — not the summarized tokens returned to the user. If the model generated 10,000 thinking tokens but the summary contains only 500, you are billed for 10,000.
Can streaming with display: omitted reduce latency?
Yes — streaming with display: omitted skips emitting thinking_delta events, reducing latency to the first text token. The cost stays the same because all thinking tokens are still billed.

📬 AI news in your inbox

A daily digest built your way — pick topics, sources and cadence. One-click unsubscribe.