From ad3178e2fecbec1c63e86a5376b2b6cac4525ab7 Mon Sep 17 00:00:00 2001 From: Mustafa Date: Mon, 11 May 2026 09:53:59 +0400 Subject: [PATCH] fix(pricing): add web_search pricing for claude-haiku-4-5 Anthropic charges $0.01 per web_search_requests across the Claude 4 family (see https://www.anthropic.com/news/web-search-api). Every other Claude 4 entry in this file carries the search_context_cost_per_query and supports_web_search fields; the haiku-4-5 entries are missing them, so cost_calculator.completion_cost paths through get_cost_for_anthropic_web_search and finds None, returning 0.0 for the tool_usage_cost portion of the cost breakdown. Effect: Anthropic claude-haiku-4-5 web_search requests are silently billed at $0 even though usage.server_tool_use.web_search_requests reports the underlying call. Adds the same pricing block already present on claude-sonnet-4-6, claude-opus-4-5, claude-3-7-sonnet, etc. --- model_prices_and_context_window.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index e66ad8e0cf6..300afab7111 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -8996,6 +8996,11 @@ "max_tokens": 64000, "mode": "chat", "output_cost_per_token": 5e-06, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, "supports_assistant_prefill": true, "supports_function_calling": true, "supports_computer_use": true, @@ -9004,7 +9009,8 @@ "supports_reasoning": true, "supports_response_schema": true, "supports_tool_choice": true, - "supports_vision": true + "supports_vision": true, + "supports_web_search": true }, "claude-haiku-4-5": { "cache_creation_input_token_cost": 1.25e-06, @@ -9017,6 +9023,11 @@ "max_tokens": 64000, "mode": "chat", "output_cost_per_token": 5e-06, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, "supports_assistant_prefill": true, "supports_function_calling": true, "supports_computer_use": true, @@ -9025,7 +9036,8 @@ "supports_reasoning": true, "supports_response_schema": true, "supports_tool_choice": true, - "supports_vision": true + "supports_vision": true, + "supports_web_search": true }, "claude-3-7-sonnet-20250219": { "cache_creation_input_token_cost": 3.75e-06,