diff --git a/generative/config.py b/generative/config.py index a13f5a9..99505a9 100644 --- a/generative/config.py +++ b/generative/config.py @@ -288,7 +288,7 @@ def is_maintainer() -> bool: # cache_write = 1,25x Input-Preis (bei 1h-TTL wären es 2x — hier nicht der Fall, #240). MODEL_PRICING: dict[str, dict[str, float]] = { # Claude (Anthropic API) — https://anthropic.com/pricing - "claude-opus-4-7": {"input": 15.0, "output": 75.0, "cache_read": 1.50, "cache_write": 18.75}, + "claude-opus-4-7": {"input": 5.0, "output": 25.0, "cache_read": 0.50, "cache_write": 6.25}, "claude-sonnet-4-6": {"input": 3.0, "output": 15.0, "cache_read": 0.30, "cache_write": 3.75}, "claude-haiku-4-5": {"input": 0.80, "output": 4.0, "cache_read": 0.03, "cache_write": 1.0}, # Gemini (Google API) — https://ai.google.dev/pricing diff --git a/generative/tests/test_cost.py b/generative/tests/test_cost.py index ed60f4f..b582320 100644 --- a/generative/tests/test_cost.py +++ b/generative/tests/test_cost.py @@ -10,7 +10,7 @@ def test_opus_cost(): cost = compute_cost_per_call( model="claude-opus-4-7", input_tokens=1_000_000, output_tokens=1_000_000, cache_read_tokens=0 ) - assert abs(cost - 90.0) < 0.01 # $15 input + $75 output per M + assert abs(cost - 30.0) < 0.01 # $5 input + $25 output per M def test_opus_cost_with_prefix(): @@ -18,7 +18,7 @@ def test_opus_cost_with_prefix(): cost = compute_cost_per_call( model="anthropic/claude-opus-4-7", input_tokens=1_000_000, output_tokens=1_000_000, cache_read_tokens=0 ) - assert abs(cost - 90.0) < 0.01 # provider-Prefix wird gestrippt + assert abs(cost - 30.0) < 0.01 # provider-Prefix wird gestrippt def test_haiku_cache_read():