Skip to content

Commit 299d9c5

Browse files
mattgodboltclaude
andcommitted
Add support for Claude Haiku 4.5
Adds Claude Haiku 4.5 model with pricing of $1.00 per million input tokens and $5.00 per million output tokens, following the October 15, 2025 release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f9e0777 commit 299d9c5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

app/model_costs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ class ModelCost(NamedTuple):
1919

2020

2121
# Model family costs in USD per million tokens
22-
# Updated: 2025-09-16 based on https://claude.com/pricing
22+
# Updated: 2025-10-15 based on https://claude.com/pricing
2323
MODEL_FAMILIES = {
2424
"opus-4.1": ModelCost(15.0, 75.0),
2525
"opus-4": ModelCost(15.0, 75.0),
2626
"sonnet-4": ModelCost(3.0, 15.0),
2727
"sonnet-3.7": ModelCost(3.0, 15.0),
2828
"sonnet-3.5": ModelCost(3.0, 15.0),
29+
"haiku-4.5": ModelCost(1.0, 5.0),
2930
"haiku-3.5": ModelCost(0.80, 4.0),
3031
"opus-3": ModelCost(15.0, 75.0),
3132
"haiku-3": ModelCost(0.25, 1.25),

app/test_model_costs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def test_claude_family_version_pattern(self):
2323
assert normalize_model_name("claude-sonnet-4-0") == "sonnet-4"
2424
assert normalize_model_name("claude-opus-4-0") == "opus-4"
2525
assert normalize_model_name("claude-sonnet-3-7") == "sonnet-3.7"
26+
assert normalize_model_name("claude-haiku-4-5") == "haiku-4.5"
2627

2728
def test_claude_family_major_pattern(self):
2829
"""Test claude-family-X pattern."""
@@ -58,6 +59,12 @@ def test_fallback_pattern_specificity(self):
5859
class TestGetModelCost:
5960
"""Test model cost lookup."""
6061

62+
def test_haiku_4_5_cost(self):
63+
"""Test Claude 4.5 Haiku costs."""
64+
input_cost, output_cost = get_model_cost("claude-haiku-4-5")
65+
assert input_cost == 1.0 / 1_000_000 # $1.00 per million
66+
assert output_cost == 5.0 / 1_000_000 # $5.00 per million
67+
6168
def test_haiku_3_5_cost(self):
6269
"""Test Claude 3.5 Haiku costs."""
6370
input_cost, output_cost = get_model_cost("claude-3-5-haiku-20241022")

0 commit comments

Comments
 (0)