Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions rust/src/core/cost_pricing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ static CLAUDE_PRICING: LazyLock<HashMap<&'static str, ClaudePricing>> = LazyLock
"claude-fable-5",
ClaudePricing::new(1e-5, 5e-5, 1.25e-5, 1e-6),
),
// Mythos is served to verified organizations only and is absent from the models.dev
// anthropic catalog. Rates: https://platform.claude.com/docs/en/about-claude/pricing
(
"claude-mythos-5",
ClaudePricing::new(1e-5, 5e-5, 1.25e-5, 1e-6),
),
(
"claude-mythos-5-1",
ClaudePricing::new(1e-5, 5e-5, 1.25e-5, 2.5e-7),
),
("claude-haiku-4-5", CLAUDE_HAIKU_4_5),
("claude-haiku-4-5-20251001", CLAUDE_HAIKU_4_5),
("claude-opus-4-6", CLAUDE_OPUS_4_5),
Expand Down
9 changes: 8 additions & 1 deletion rust/src/core/cost_pricing_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ fn prices_codex_models() {

#[test]
fn prices_claude_models() {
for (model, expected) in [("claude-opus-4-8", 0.0175), ("claude-fable-5", 0.035)] {
for (model, expected) in [
("claude-opus-4-8", 0.0175),
("claude-fable-5", 0.035),
("claude-mythos-5", 0.035),
("claude-mythos-5-1", 0.035),
] {
let cost = CostUsagePricing::claude_cost_usd(model, 1_000, 0, 0, 500).unwrap();
assert!((cost - expected).abs() < 1e-10, "{model}");
}
Expand Down Expand Up @@ -790,6 +795,8 @@ gpt-6-astra 1e-5 5e-5 1e-6 Some(1.25e-5) None Some((2e-5, 7.5e-5, 2e-6, Some(2.5
claude-fable-5 1e-5 5e-5 1.25e-5 1e-6 None None None None None
claude-haiku-4-5 1e-6 5e-6 1.25e-6 1e-7 None None None None None
claude-haiku-4-5-20251001 1e-6 5e-6 1.25e-6 1e-7 None None None None None
claude-mythos-5 1e-5 5e-5 1.25e-5 1e-6 None None None None None
claude-mythos-5-1 1e-5 5e-5 1.25e-5 2.5e-7 None None None None None
claude-opus-4-1 1.5e-5 7.5e-5 1.875e-5 1.5e-6 None None None None None
claude-opus-4-20250514 1.5e-5 7.5e-5 1.875e-5 1.5e-6 None None None None None
claude-opus-4-5 5e-6 2.5e-5 6.25e-6 5e-7 None None None None None
Expand Down
15 changes: 15 additions & 0 deletions rust/src/cost_scanner/tests/claude_rates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,21 @@ fn claude_fable_5_prices_five_minute_and_one_hour_cache_writes() {
}
}

#[test]
fn claude_mythos_models_price_from_the_builtin_table() {
// (model, cache read price per million): Mythos 5.1 bills cache reads at $0.25/M,
// Mythos 5 at $1/M. Both bill $10 in, $12.50 cache write, $50 out per million.
for (model, cache_read_per_million) in [("claude-mythos-5", 1.00), ("claude-mythos-5-1", 0.25)]
{
let cost = ClaudePricing::cost_usd_with_cache_ttl(model, 100, 10, 0, 20, 5);
let expected = (100.0 / 1_000_000.0) * 10.00
+ (10.0 / 1_000_000.0) * 12.50
+ (20.0 / 1_000_000.0) * cache_read_per_million
+ (5.0 / 1_000_000.0) * 50.00;
assert!((cost - expected).abs() < 1e-12, "{model}");
}
}

#[test]
fn claude_scan_pricing_follows_the_canonical_table() {
// Undated Sonnet 4.6 bills its full context at the standard $3/M: 240k = 0.72.
Expand Down