ccusage: Claude Code 1.0.9 no longer reports the costUSD field
It appears that Claude Code 1.0.9 no longer includes the costUSD field that ccusage is using to track the costs in the session log files:
{
"parentUuid": "9194323f-ea9c-486a-be20-599e666df380",
"isSidechain": false,
"userType": "external",
"cwd": "/Users/nnamon/projects/mcp/playwright-mcp",
"sessionId": "0a9a8045-53e9-44b1-83fb-aafc6e1f4f0b",
"version": "1.0.9",
"message": {
"id": "msg_018vkDifij3YKNQ5gzjtvbXz",
"type": "message",
"role": "assistant",
"model": "claude-opus-4-20250514",
"content": [
{
"type": "tool_use",
"id": "toolu_01S3mjJhHAtzk1uuAU1cn85r",
"name": "Bash",
"input": {
"command": "docker build -f Dockerfile.dev -t playwright-mcp-dev:latest . --no-cache",
"description": "Rebuild Docker image with the fix"
}
}
],
"stop_reason": "tool_use",
"stop_sequence": null,
"usage": {
"input_tokens": 3,
"cache_creation_input_tokens": 161,
"cache_read_input_tokens": 89356,
"output_tokens": 97,
"service_tier": "standard"
},
"ttftMs": 3382
},
"requestId": "req_011CPkCWc21qrE6dGwSHMcw1",
"type": "assistant",
"uuid": "03a7a350-a7db-4fcb-8844-aded9b69e7a8",
"timestamp": "2025-06-02T22:40:37.397Z"
}
The model and token counts are still included, however. This probably means that the costs could be calculated for these by multiplying them with their listed prices?
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 28 (16 by maintainers)
THANK YOU GUYS. JUST PUBLISHED!!!
GIVE ME FIVE!!!
Hi! I pushed the new script. Check it out!!
Hi nnamon! Yes, I think we can integrate with https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json file. This is my inital thought by the way. I’ll work on it tomorrow(maybe Claude Code can write code for my while I’m sleeping!)
Thank you for letting me know!
verify-pricing-new.txt , using Max Plan 5x
I tried it myself, but I haven’t used it much, so I don’t know if it will be of any help. I ran it on the claude v1.0.3 and the v1.0.9.
log file: https://gist.github.com/mimikun/f10f44ac8417d52904fd96c42d8e2d5e
In my case, there was no difference in the numbers. I haven’t used claude cli yet after updating.
Here are my logs in case they help you with the investigation. I run your scripts using ts-node because I don’t have bun installed. I always restarted claude code as soon as I saw the message “Update installed. Restart to apply”
verify-pricing.txt
I’ve attached the output from my box.
verify_pricing.txt
Looks like it’s mostly matching with 3% discrepancy. Awesome work! 😃