anthropic-sdk-python icon indicating copy to clipboard operation
anthropic-sdk-python copied to clipboard

[Feature] Better thinking usage information

Open jplu opened this issue 4 months ago • 1 comments

Describe the feature

It would be very useful to have more details on the usage if the thinking is enabled. For now, we have no clue how many tokens have been used in the thinking part of the answer.

Use Case

This feature is useful for us in order to measure how much of a budget goes to the thinking part in order to better estimate the ratio cost / thinking budget.

Proposed Solution

Like the OpenAI and Gemini APIs, having a thinking_tokens attribute in the usage object of the response body that will correspond to the number of token used for generating the "thinking" part of the response.

SDK version used

0.64.0

Environment details (OS name and version, etc.)

Ubuntu 25.04

jplu avatar Aug 18 '25 11:08 jplu

+1

bharathc346 avatar Oct 22 '25 20:10 bharathc346