Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(model_prices): apply claude-sonnet-5 introductory pricing through 2026-08-31 (#31917)

Mateo Wang6e023f7cf2f6
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json
index b3058bb4214..b249b951b8e 100644
--- a/litellm/model_prices_and_context_window_backup.json
+++ b/litellm/model_prices_and_context_window_backup.json
@@ -1672,16 +1672,16 @@
"supports_minimal_reasoning_effort": true
},
"anthropic.claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1705,16 +1705,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"global.anthropic.claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1738,16 +1738,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"us.anthropic.claude-sonnet-5": {
- "cache_creation_input_token_cost": 4.125e-06,
- "cache_creation_input_token_cost_above_1hr": 6.6e-06,
- "cache_read_input_token_cost": 3.3e-07,
- "input_cost_per_token": 3.3e-06,
+ "cache_creation_input_token_cost": 2.75e-06,
+ "cache_creation_input_token_cost_above_1hr": 4.4e-06,
+ "cache_read_input_token_cost": 2.2e-07,
+ "input_cost_per_token": 2.2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.65e-05,
+ "output_cost_per_token": 1.1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1771,16 +1771,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"eu.anthropic.claude-sonnet-5": {
- "cache_creation_input_token_cost": 4.125e-06,
- "cache_creation_input_token_cost_above_1hr": 6.6e-06,
- "cache_read_input_token_cost": 3.3e-07,
- "input_cost_per_token": 3.3e-06,
+ "cache_creation_input_token_cost": 2.75e-06,
+ "cache_creation_input_token_cost_above_1hr": 4.4e-06,
+ "cache_read_input_token_cost": 2.2e-07,
+ "input_cost_per_token": 2.2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.65e-05,
+ "output_cost_per_token": 1.1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1804,16 +1804,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"au.anthropic.claude-sonnet-5": {
- "cache_creation_input_token_cost": 4.125e-06,
- "cache_creation_input_token_cost_above_1hr": 6.6e-06,
- "cache_read_input_token_cost": 3.3e-07,
- "input_cost_per_token": 3.3e-06,
+ "cache_creation_input_token_cost": 2.75e-06,
+ "cache_creation_input_token_cost_above_1hr": 4.4e-06,
+ "cache_read_input_token_cost": 2.2e-07,
+ "input_cost_per_token": 2.2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.65e-05,
+ "output_cost_per_token": 1.1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1837,16 +1837,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"jp.anthropic.claude-sonnet-5": {
- "cache_creation_input_token_cost": 4.125e-06,
- "cache_creation_input_token_cost_above_1hr": 6.6e-06,
- "cache_read_input_token_cost": 3.3e-07,
- "input_cost_per_token": 3.3e-06,
+ "cache_creation_input_token_cost": 2.75e-06,
+ "cache_creation_input_token_cost_above_1hr": 4.4e-06,
+ "cache_read_input_token_cost": 2.2e-07,
+ "input_cost_per_token": 2.2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.65e-05,
+ "output_cost_per_token": 1.1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -2710,16 +2710,16 @@
"supports_vision": true
},
"azure_ai/claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "azure_ai",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -10474,16 +10474,16 @@
"supports_web_search": true
},
"claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "anthropic",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -35210,16 +35210,16 @@
"supports_vision": true
},
"vertex_ai/claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "vertex_ai-anthropic_models",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -42677,16 +42677,16 @@
}
},
"vertex_ai/claude-sonnet-5@default": {
- "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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "vertex_ai-anthropic_models",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
diff --git a/litellm/proxy/dev_config.yaml b/litellm/proxy/dev_config.yaml
index 6078161c780..0dc90e658f2 100644
--- a/litellm/proxy/dev_config.yaml
+++ b/litellm/proxy/dev_config.yaml
@@ -28,6 +28,10 @@ model_list:
litellm_params:
model: anthropic/claude-opus-4-8
api_key: os.environ/ANTHROPIC_API_KEY
+ - model_name: anthropic-sonnet-5
+ litellm_params:
+ model: anthropic/claude-sonnet-5
+ api_key: os.environ/ANTHROPIC_API_KEY
# ---------- Bedrock Invoke ----------
- model_name: bedrock-invoke-haiku-4-5
diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json
index 6ab6f1bda46..9e9523193c7 100644
--- a/model_prices_and_context_window.json
+++ b/model_prices_and_context_window.json
@@ -1672,16 +1672,16 @@
"supports_minimal_reasoning_effort": true
},
"anthropic.claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1705,16 +1705,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"global.anthropic.claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1738,16 +1738,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"us.anthropic.claude-sonnet-5": {
- "cache_creation_input_token_cost": 4.125e-06,
- "cache_creation_input_token_cost_above_1hr": 6.6e-06,
- "cache_read_input_token_cost": 3.3e-07,
- "input_cost_per_token": 3.3e-06,
+ "cache_creation_input_token_cost": 2.75e-06,
+ "cache_creation_input_token_cost_above_1hr": 4.4e-06,
+ "cache_read_input_token_cost": 2.2e-07,
+ "input_cost_per_token": 2.2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.65e-05,
+ "output_cost_per_token": 1.1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1771,16 +1771,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"eu.anthropic.claude-sonnet-5": {
- "cache_creation_input_token_cost": 4.125e-06,
- "cache_creation_input_token_cost_above_1hr": 6.6e-06,
- "cache_read_input_token_cost": 3.3e-07,
- "input_cost_per_token": 3.3e-06,
+ "cache_creation_input_token_cost": 2.75e-06,
+ "cache_creation_input_token_cost_above_1hr": 4.4e-06,
+ "cache_read_input_token_cost": 2.2e-07,
+ "input_cost_per_token": 2.2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.65e-05,
+ "output_cost_per_token": 1.1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1804,16 +1804,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"au.anthropic.claude-sonnet-5": {
- "cache_creation_input_token_cost": 4.125e-06,
- "cache_creation_input_token_cost_above_1hr": 6.6e-06,
- "cache_read_input_token_cost": 3.3e-07,
- "input_cost_per_token": 3.3e-06,
+ "cache_creation_input_token_cost": 2.75e-06,
+ "cache_creation_input_token_cost_above_1hr": 4.4e-06,
+ "cache_read_input_token_cost": 2.2e-07,
+ "input_cost_per_token": 2.2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.65e-05,
+ "output_cost_per_token": 1.1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -1837,16 +1837,16 @@
"bedrock_output_config_effort_ceiling": "xhigh"
},
"jp.anthropic.claude-sonnet-5": {
- "cache_creation_input_token_cost": 4.125e-06,
- "cache_creation_input_token_cost_above_1hr": 6.6e-06,
- "cache_read_input_token_cost": 3.3e-07,
- "input_cost_per_token": 3.3e-06,
+ "cache_creation_input_token_cost": 2.75e-06,
+ "cache_creation_input_token_cost_above_1hr": 4.4e-06,
+ "cache_read_input_token_cost": 2.2e-07,
+ "input_cost_per_token": 2.2e-06,
"litellm_provider": "bedrock_converse",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.65e-05,
+ "output_cost_per_token": 1.1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -2710,16 +2710,16 @@
"supports_vision": true
},
"azure_ai/claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "azure_ai",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -10474,16 +10474,16 @@
"supports_web_search": true
},
"claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "anthropic",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -35384,16 +35384,16 @@
"supports_vision": true
},
"vertex_ai/claude-sonnet-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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "vertex_ai-anthropic_models",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
@@ -42909,16 +42909,16 @@
}
},
"vertex_ai/claude-sonnet-5@default": {
- "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,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
"litellm_provider": "vertex_ai-anthropic_models",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "chat",
- "output_cost_per_token": 1.5e-05,
+ "output_cost_per_token": 1e-05,
"search_context_cost_per_query": {
"search_context_size_high": 0.01,
"search_context_size_low": 0.01,
diff --git a/tests/test_litellm/test_claude_sonnet_5_config.py b/tests/test_litellm/test_claude_sonnet_5_config.py
index 88a06aea95f..506ffa16597 100644
--- a/tests/test_litellm/test_claude_sonnet_5_config.py
+++ b/tests/test_litellm/test_claude_sonnet_5_config.py
@@ -76,12 +76,23 @@ def test_sonnet_5_pricing_and_capabilities():
assert info["max_output_tokens"] == 128000
assert info["max_tokens"] == 128000
- # Standard Sonnet pricing: $3 / $15 per MTok, with the 1.25x cache-write
- # and 0.1x cache-read multipliers.
- assert info["input_cost_per_token"] == 3e-06
- assert info["output_cost_per_token"] == 1.5e-05
- assert info["cache_creation_input_token_cost"] == 3.75e-06
- assert info["cache_read_input_token_cost"] == 3e-07
+ # Introductory Sonnet 5 pricing through 2026-08-31: $2 / $10 per MTok,
+ # with the 1.25x cache-write and 0.1x cache-read multipliers. On
+ # 2026-09-01 flip these five fields back to the sticker rate, here and
+ # in both cost-map JSON files (all ten claude-sonnet-5 entries):
+ # input_cost_per_token: 3e-06
+ # output_cost_per_token: 1.5e-05
+ # cache_creation_input_token_cost: 3.75e-06
+ # cache_creation_input_token_cost_above_1hr: 6e-06
+ # cache_read_input_token_cost: 3e-07
+ # Regional Bedrock profiles (us./eu./au./jp.) stay at 1.1x those values:
+ # 3.3e-06 / 1.65e-05 / 4.125e-06 / 6.6e-06 / 3.3e-07 (see
+ # test_sonnet_5_bedrock_regional_pricing below).
+ assert info["input_cost_per_token"] == 2e-06
+ assert info["output_cost_per_token"] == 1e-05
+ assert info["cache_creation_input_token_cost"] == 2.5e-06
+ assert info["cache_creation_input_token_cost_above_1hr"] == 4e-06
+ assert info["cache_read_input_token_cost"] == 2e-07
# gen-5 adaptive-thinking profile: effort-driven, no sampling params, no
# assistant prefill.
@@ -102,16 +113,18 @@ def test_sonnet_5_bedrock_regional_pricing():
model_data = _load_root_cost_map()
base_pricing = {
- "input_cost_per_token": 3e-06,
- "output_cost_per_token": 1.5e-05,
- "cache_creation_input_token_cost": 3.75e-06,
- "cache_read_input_token_cost": 3e-07,
+ "input_cost_per_token": 2e-06,
+ "output_cost_per_token": 1e-05,
+ "cache_creation_input_token_cost": 2.5e-06,
+ "cache_creation_input_token_cost_above_1hr": 4e-06,
+ "cache_read_input_token_cost": 2e-07,
}
regional_pricing = {
- "input_cost_per_token": 3.3e-06,
- "output_cost_per_token": 1.65e-05,
- "cache_creation_input_token_cost": 4.125e-06,
- "cache_read_input_token_cost": 3.3e-07,
+ "input_cost_per_token": 2.2e-06,
+ "output_cost_per_token": 1.1e-05,
+ "cache_creation_input_token_cost": 2.75e-06,
+ "cache_creation_input_token_cost_above_1hr": 4.4e-06,
+ "cache_read_input_token_cost": 2.2e-07,
}
expected = {