From fd423c18fb84c71fc76147f5d2f92646aa765779 Mon Sep 17 00:00:00 2001 From: engkimo Date: Tue, 19 May 2026 09:51:23 +0900 Subject: [PATCH] fix(pricing): update Claude Haiku 4.5 to actual Anthropic public pricing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both cost tables had Haiku 4.5 at Haiku 3.5-era prices ($0.25/$1.25 per 1M tokens). Actual Anthropic 4.5 pricing is $1.00/$5.00. This made every Haiku-tier cost projection (incl. the planner cost simulation) understate real spend by 4×. - application/use_cases/cost_estimator.py: input $0.25 → $1.00 - domain/services/engine_cost_calculator.py: ($0.25, $1.25) → ($1.00, $5.00) - All 3,235 unit tests still pass (haiku < sonnet invariant intact: $1 < $3) Co-Authored-By: Claude Opus 4.7 --- application/use_cases/cost_estimator.py | 2 +- domain/services/engine_cost_calculator.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/use_cases/cost_estimator.py b/application/use_cases/cost_estimator.py index a60b7dd..32706da 100644 --- a/application/use_cases/cost_estimator.py +++ b/application/use_cases/cost_estimator.py @@ -24,7 +24,7 @@ class CostEstimate: "ollama/llama3.2:3b": 0.0, "ollama/phi4:14b": 0.0, # Low tier - "claude-haiku-4-5-20251001": 0.25, + "claude-haiku-4-5-20251001": 1.00, "gemini/gemini-3-flash-preview": 0.10, # Medium tier "claude-sonnet-4-6": 3.00, diff --git a/domain/services/engine_cost_calculator.py b/domain/services/engine_cost_calculator.py index 8db1de1..f93cebd 100644 --- a/domain/services/engine_cost_calculator.py +++ b/domain/services/engine_cost_calculator.py @@ -10,12 +10,12 @@ from dataclasses import dataclass # Pricing per 1 million tokens (input, output). -# Updated 2026-03 — verify periodically against provider pricing pages. +# Updated 2026-05-19 — verify periodically against provider pricing pages. _MODEL_PRICING: dict[str, tuple[float, float]] = { # Anthropic "claude-sonnet-4-6": (3.00, 15.00), "claude-opus-4-6": (15.00, 75.00), - "claude-haiku-4-5-20251001": (0.25, 1.25), + "claude-haiku-4-5-20251001": (1.00, 5.00), # OpenAI "o4-mini": (1.10, 4.40), "gpt-4o": (2.50, 10.00),