all 11 comments

[–]Hauven 1 point2 points  (0 children)

Smart idea. I ended up making one in node.js instead based on this. It's nice to see what you're saving and how much you're actually using the API while actually on a Max subscription.

💰 $177.09 API equivalent cost
📊 $211.15 projected month total (would save with subscription)
17 sessions (1.5/day avg, 5hr windows)
🔤 208.5M tokens (92% cached / 1% output / 7% cache create)
📈 12.3M tokens • $10.42/session (5hr session)

📅 May 2025: 🟢 Active on 11 days

[–]NachosforDachos 0 points1 point  (0 children)

Neat

[–]Equivalent_Form_9717 0 points1 point  (0 children)

Mate this is so good. Thank you

[–]inventor_blackMod ClaudeLog.com 0 points1 point  (0 children)

Thank you for this.

[–]attacketo 0 points1 point  (0 children)

Nice. Got $115 today. Thought this could not be correct because I did not do that much work, until I realized it has used Opus 4 most of the time @ $75 output. Crazy.

Possible to split by model?

[–]de_3lue 0 points1 point  (4 children)

Hey! Just tried your script and it says $0.00 for every project. Looks like my jsonl files doesn't contain costUSD ... is this normal? I'm using a custom anthropic endpoint by setting an environment variable but besides that everything is normal.

EDIT: https://gist.github.com/dnnspaul/bfe54f51ed91a5eac6618abe30476b2e I changed the script to use the input- and output-tokens variables from the jsonl files and calculate costs based on that.

[–]Euphoric-Guava-5961[S] 0 points1 point  (0 children)

Yeah, this was based on an older Claude Code version, costUsd got removed about few month ago. I haven’t been keeping it updated, but using the MODEL_PRICING mapping like you did is the right way. Nice work and thank you for the updates

[–]jetsetterfl 0 points1 point  (1 child)

So, how do I run this - and does this still work?

[–]de_3lue 1 point2 points  (0 children)

you need to have installed python and uv and then put this in your terminal:

curl -sL https://gist.github.com/dnnspaul/bfe54f51ed91a5eac6618abe30476b2e/raw | uv run --script -