[BUG] AWS Cloudwatch Output token count is too high for Claude 4.5 Sonnet
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I have opened a case with AWS with regards to Claude 4.5 Sonnet output token counts reported in CloudWatch are much higher (factor of x5) than expected and measured output files sizes. CASE 177695638006582] Bedrock Claude 4.5 Sonnet output token count is greater than what it should be by factor of 5.
I was referred to support which asked me to report this as a bug.
Regards, Siamack
Hi AI
The output token count reported in AWS CloudWatch is five times what it should be. I have no problem with the input token count. So, your references [1], [2], [5] are not relevant.
The 4 reasons you give below do not explain why the output token count is five times higher than it should be. I address them one at a time:
- Output tokens may not match the exact visible content, but the difference cannot be five times. A factor of five can not be explained by this.
- As you say, “differ by small amount”, not five times. What is added is also to do with input tokens.
- I am not using tools, so your references [3] [4] are not relevant.
- Again, you are talking about input token count. I am talking about output token count which is five times more expensive and dominates the cost.
Can you please refer this case to a human subject matter expert.
Hi Siamack,
Thanks for the detailed write-up, Siamack. What you're seeing can happen because token counts are not a 1:1 reflection of the visible text or file size you measure. [[1]](https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplatform.claude.com%2Fdocs%2Fen%2Fapi%2Fcli%2Fmessages%2Fcreate&data=05%7C02%7C%7Cde2c4bea911f4b8b369108dea1f9f469%7Ce95f1b23abaf45ee821db7ab251ab3bf%7C0%7C0%7C639126292082080048%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Fc3Wg5nbi75LkDRAYMns8pmcHTeoQQexUGyRqXfmSGA%3D&reserved=0)
A few key reasons output token counts can look much higher than expected:
• The API transforms requests into an internal format, and the model output goes through a parsing stage before becoming the API response, so output_tokens will not match the exact visible content.
• Token counts are estimates and can differ by a small amount; they may also include tokens added automatically for system optimizations (you are not billed for system-added tokens). [[2]](https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplatform.claude.com%2Fdocs%2Fen%2Fbuild-with-claude%2Ftoken-counting&data=05%7C02%7C%7Cde2c4bea911f4b8b369108dea1f9f469%7Ce95f1b23abaf45ee821db7ab251ab3bf%7C0%7C0%7C639126292082103832%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=py2qBIZYcZ92X0EankZcE9hogsm5LKX5AbcCvtuNRUk%3D&reserved=0)
• If you are using tools, tool use adds system prompt overhead and additional token consumption (for example, computer use adds 466 to 499 tokens to the system prompt, plus additional costs for tool definitions and returned results). [[3]](https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplatform.claude.com%2Fdocs%2Fen%2Fabout-claude%2Fpricing&data=05%7C02%7C%7Cde2c4bea911f4b8b369108dea1f9f469%7Ce95f1b23abaf45ee821db7ab251ab3bf%7C0%7C0%7C639126292082122001%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=YGbt%2BGQYb0emazUQxU8vNW1HcRgza9I6AKN9oZp9tSs%3D&reserved=0) [[4]](https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplatform.claude.com%2Fdocs%2Fen%2Fagents-and-tools%2Ftool-use%2Foverview&data=05%7C02%7C%7Cde2c4bea911f4b8b369108dea1f9f469%7Ce95f1b23abaf45ee821db7ab251ab3bf%7C0%7C0%7C639126292082141853%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=F3ZVq0jaPuTWzbiDbqY9Lut90XuqyhPudQJf6N1BjUw%3D&reserved=0)
• In some server-side tool scenarios, token usage can be miscalculated because cache_read_input_tokens can accumulate across multiple internal calls, making totals look inflated. [[5]](https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplatform.claude.com%2Fdocs%2Fen%2Fbuild-with-claude%2Fcontext-editing&data=05%7C02%7C%7Cde2c4bea911f4b8b369108dea1f9f469%7Ce95f1b23abaf45ee821db7ab251ab3bf%7C0%7C0%7C639126292082160344%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=lDj%2B2vagqIdH9ScAJGUxnzGd7o8ASTkXQ2acW0lX8%2Fg%3D&reserved=0)
Please let me know if this helps or if you have any further questions.
What Should Happen?
The AWS CloudWatch Output Token count should be lower by a factor of 5 and is likely being multiplied by a factor of 5 in anticipation of charging 5 times more for an output token vs. an input token.
Error Messages/Logs
NA
Steps to Reproduce
I have screenshots of the AWS CloudWatch which I can share. Don't know if it was uploaded.
AWS-Billing-Ticket-20260423.docx
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
4.5
Platform
AWS Bedrock
Operating System
Windows
Terminal/Shell
Other
Additional Information
I am using AWS Bedrock API model invoke in Gov cloud region.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗