Skip to content

Commit d51c1f1

Browse files
jgravelleclaude
andcommitted
Update pricing to Claude Opus 4.6 ($5/1M) and GPT-5 latest ($1.75/1M)
Also renames _PRICING to PRICING (public) and fixes cost_avoided() to reference the updated dict name and model keys. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 896fe1f commit d51c1f1

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/jcodemunch_mcp/storage/token_tracker.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
_BYTES_PER_TOKEN = 4 # ~4 bytes per token (rough but consistent)
1818

1919
# Input token pricing ($ per token). Update as models reprice.
20-
_PRICING = {
21-
"claude_opus": 15.00 / 1_000_000, # Claude Opus — $15/1M input tokens
22-
"gpt4o": 2.50 / 1_000_000, # GPT-4o — $2.50/1M input tokens
20+
PRICING = {
21+
"claude_opus": 5.00 / 1_000_000, # Claude Opus 4.6 — $5.00 / 1M input tokens
22+
"gpt5_latest": 1.75 / 1_000_000, # GPT-5.2 (latest flagship GPT) — $1.75 / 1M input tokens
2323
}
2424

2525

@@ -66,18 +66,18 @@ def cost_avoided(tokens_saved: int, total_tokens_saved: int) -> dict:
6666
"""Return cost avoided estimates for this call and the running total.
6767
6868
Returns a dict ready to be merged into a _meta envelope:
69-
cost_avoided: {claude_opus: float, gpt4o: float}
70-
total_cost_avoided: {claude_opus: float, gpt4o: float}
69+
cost_avoided: {claude_opus: float, gpt5_latest: float}
70+
total_cost_avoided: {claude_opus: float, gpt5_latest: float}
7171
7272
Values are in USD, rounded to 4 decimal places.
7373
"""
7474
return {
7575
"cost_avoided": {
7676
model: round(tokens_saved * rate, 4)
77-
for model, rate in _PRICING.items()
77+
for model, rate in PRICING.items()
7878
},
7979
"total_cost_avoided": {
8080
model: round(total_tokens_saved * rate, 4)
81-
for model, rate in _PRICING.items()
81+
for model, rate in PRICING.items()
8282
},
8383
}

0 commit comments

Comments
 (0)