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
12 changes: 12 additions & 0 deletions litellm/model_prices_and_context_window_backup.json
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,9 @@
"supports_function_calling": true
},
"azure_ai/claude-haiku-4-5": {
"cache_creation_input_token_cost": 1.25e-06,
"cache_creation_input_token_cost_above_1hr": 2e-06,
"cache_read_input_token_cost": 1e-07,
"input_cost_per_token": 1e-06,
"litellm_provider": "azure_ai",
"max_input_tokens": 200000,
Expand All @@ -1330,6 +1333,9 @@
"supports_vision": true
},
"azure_ai/claude-opus-4-5": {
"cache_creation_input_token_cost": 6.25e-06,
"cache_creation_input_token_cost_above_1hr": 1e-05,
"cache_read_input_token_cost": 5e-07,
"input_cost_per_token": 5e-06,
"litellm_provider": "azure_ai",
"max_input_tokens": 200000,
Expand All @@ -1348,6 +1354,9 @@
"supports_vision": true
},
"azure_ai/claude-opus-4-1": {
"cache_creation_input_token_cost": 1.875e-05,
"cache_creation_input_token_cost_above_1hr": 3e-05,
"cache_read_input_token_cost": 1.5e-06,
"input_cost_per_token": 1.5e-05,
"litellm_provider": "azure_ai",
"max_input_tokens": 200000,
Expand All @@ -1366,6 +1375,9 @@
"supports_vision": true
},
"azure_ai/claude-sonnet-4-5": {
"cache_creation_input_token_cost": 3.75e-06,
"cache_creation_input_token_cost_above_1hr": 6e-06,
"cache_read_input_token_cost": 3e-07,
"input_cost_per_token": 3e-06,
"litellm_provider": "azure_ai",
"max_input_tokens": 200000,
Expand Down
12 changes: 12 additions & 0 deletions model_prices_and_context_window.json
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,9 @@
"supports_function_calling": true
},
"azure_ai/claude-haiku-4-5": {
"cache_creation_input_token_cost": 1.25e-06,
"cache_creation_input_token_cost_above_1hr": 2e-06,
"cache_read_input_token_cost": 1e-07,
"input_cost_per_token": 1e-06,
"litellm_provider": "azure_ai",
"max_input_tokens": 200000,
Expand All @@ -1330,6 +1333,9 @@
"supports_vision": true
},
"azure_ai/claude-opus-4-5": {
"cache_creation_input_token_cost": 6.25e-06,
"cache_creation_input_token_cost_above_1hr": 1e-05,
"cache_read_input_token_cost": 5e-07,
"input_cost_per_token": 5e-06,
"litellm_provider": "azure_ai",
"max_input_tokens": 200000,
Expand All @@ -1348,6 +1354,9 @@
"supports_vision": true
},
"azure_ai/claude-opus-4-1": {
"cache_creation_input_token_cost": 1.875e-05,
"cache_creation_input_token_cost_above_1hr": 3e-05,
"cache_read_input_token_cost": 1.5e-06,
"input_cost_per_token": 1.5e-05,
"litellm_provider": "azure_ai",
"max_input_tokens": 200000,
Expand All @@ -1366,6 +1375,9 @@
"supports_vision": true
},
"azure_ai/claude-sonnet-4-5": {
"cache_creation_input_token_cost": 3.75e-06,
"cache_creation_input_token_cost_above_1hr": 6e-06,
"cache_read_input_token_cost": 3e-07,
"input_cost_per_token": 3e-06,
"litellm_provider": "azure_ai",
"max_input_tokens": 200000,
Expand Down
42 changes: 42 additions & 0 deletions tests/test_litellm/llms/anthropic/test_azure_ai_cache_pricing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""
Test that Azure AI Anthropic models have cache pricing configured.
Verifies the fix for issue #19532.
"""

import sys
import os

sys.path.insert(0, os.path.abspath("../../../../../"))

import litellm
from litellm import get_model_info
from litellm.litellm_core_utils.get_model_cost_map import get_model_cost_map
import pytest


@pytest.fixture(autouse=True)
def reload_model_costs():
"""Reload model costs from JSON before each test."""
litellm.model_cost = get_model_cost_map(url=None)
yield


@pytest.mark.parametrize(
"model,expected_cache_creation_cost,expected_cache_read_cost",
[
("claude-haiku-4-5", 1.25e-06, 1e-07),
("claude-opus-4-5", 6.25e-06, 5e-07),
("claude-opus-4-1", 1.875e-05, 1.5e-06),
("claude-sonnet-4-5", 3.75e-06, 3e-07),
],
)
def test_azure_ai_claude_cache_pricing(
model, expected_cache_creation_cost, expected_cache_read_cost
):
"""Test that Azure AI Claude models have correct cache pricing."""
model_info = get_model_info(model=model, custom_llm_provider="azure_ai")

assert model_info.get("cache_creation_input_token_cost") is not None
assert model_info.get("cache_read_input_token_cost") is not None
assert model_info.get("cache_creation_input_token_cost") == expected_cache_creation_cost
assert model_info.get("cache_read_input_token_cost") == expected_cache_read_cost
Loading