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]

feat(bedrock): route token counts from model metadata (#47441)

Mateo Wang7b82b2a3c38c
diff --git a/litellm/llms/bedrock/count_tokens/bedrock_token_counter.py b/litellm/llms/bedrock/count_tokens/bedrock_token_counter.py
index 97f28b9fbc5..068cf4f2e67 100644
--- a/litellm/llms/bedrock/count_tokens/bedrock_token_counter.py
+++ b/litellm/llms/bedrock/count_tokens/bedrock_token_counter.py
@@ -59,8 +59,7 @@ def _runtime_rejected_claude_model(outcome: CountTokensOutcome, resolved_model:
class BedrockTokenCounter(BaseTokenCounter):
- """Token counter for AWS Bedrock: bedrock-runtime CountTokens first, and Anthropic's count_tokens
- on bedrock-mantle for Claude models bedrock-runtime answers 400 or 404 for"""
+ """Counts on the configured Bedrock endpoint, with Mantle retry when Runtime rejects a Claude model"""
def __init__(
self,
@@ -127,17 +126,22 @@ class BedrockTokenCounter(BaseTokenCounter):
**({"tools": tools} if tools else {}),
**({"system": system} if system else {}),
}
- resolved_model: Final = get_bedrock_base_model(model_to_use)
-
- runtime: Final = await self._count_with(
- self._runtime_handler, RUNTIME_TOKENIZER_TYPE, request_data, litellm_params, resolved_model
+ use_mantle: Final = model_to_use.startswith("bedrock_mantle/")
+ resolved_model: Final = get_bedrock_base_model(model_to_use.removeprefix("bedrock_mantle/"))
+
+ primary: Final = await self._count_with(
+ self._mantle_handler if use_mantle else self._runtime_handler,
+ MANTLE_TOKENIZER_TYPE if use_mantle else RUNTIME_TOKENIZER_TYPE,
+ request_data,
+ litellm_params,
+ resolved_model,
)
outcome: Final = (
await self._count_with(
self._mantle_handler, MANTLE_TOKENIZER_TYPE, request_data, litellm_params, resolved_model
)
- if _runtime_rejected_claude_model(runtime, resolved_model)
- else runtime
+ if not use_mantle and _runtime_rejected_claude_model(primary, resolved_model)
+ else primary
)
match outcome:
case CountedTokens():
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json
index 95285d50f26..7f8a2c2ae93 100644
--- a/litellm/model_prices_and_context_window_backup.json
+++ b/litellm/model_prices_and_context_window_backup.json
@@ -922,7 +922,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5e-07,
- "output_cost_per_token_batches": 2.5e-06
+ "output_cost_per_token_batches": 2.5e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-haiku-4-5@20251001": {
"cache_creation_input_token_cost": 1.25e-06,
@@ -1076,7 +1080,11 @@
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
- "prompt_cache_min_tokens": 1024
+ "prompt_cache_min_tokens": 1024,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-1-20250805-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-opus-4-20250514-v1:0": {
"cache_creation_input_token_cost": 1.875e-05,
@@ -1135,7 +1143,11 @@
"bedrock_output_config_effort_ceiling": "high",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-5-20251101-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1171,7 +1183,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1207,7 +1223,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1243,7 +1263,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1279,7 +1303,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"au.anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1315,7 +1343,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -1353,7 +1385,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"anthropic.claude-mythos-preview": {
"cache_creation_input_token_cost": 3.4375e-05,
@@ -1411,7 +1448,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -1449,7 +1491,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"eu.anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -1487,7 +1534,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "eu-west-1"
+ }
},
"au.anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -1525,7 +1577,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.25e-05,
@@ -1563,7 +1620,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-fable-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.25e-05,
@@ -1640,7 +1702,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-fable-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.25e-05,
@@ -1717,7 +1784,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-fable-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.375e-05,
@@ -1870,7 +1942,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -1910,7 +1987,12 @@
"prompt_cache_min_tokens": 512,
"source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
"thinking_always_on": true,
- "supports_forced_tool_use": false
+ "supports_forced_tool_use": false,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -1948,7 +2030,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -1988,7 +2075,12 @@
"prompt_cache_min_tokens": 512,
"source": "https://aws.amazon.com/bedrock/pricing/",
"thinking_always_on": true,
- "supports_forced_tool_use": false
+ "supports_forced_tool_use": false,
+ "token_count_model": {
+ "model": "global.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2026,7 +2118,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2066,7 +2163,12 @@
"prompt_cache_min_tokens": 512,
"source": "https://aws.amazon.com/bedrock/pricing/",
"thinking_always_on": true,
- "supports_forced_tool_use": false
+ "supports_forced_tool_use": false,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"eu.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2104,7 +2206,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "eu-west-1"
+ }
},
"eu.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2182,7 +2289,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"au.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2222,7 +2334,12 @@
"prompt_cache_min_tokens": 512,
"thinking_always_on": true,
"supports_forced_tool_use": false,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"jp.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2340,7 +2457,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2380,7 +2502,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2420,7 +2547,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"eu.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2460,7 +2592,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "eu-west-1"
+ }
},
"au.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2500,7 +2637,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"jp.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2540,7 +2682,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-northeast-1"
+ }
},
"jp.anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -2577,7 +2724,12 @@
"supports_minimal_reasoning_effort": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-northeast-1"
+ }
},
"anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2617,7 +2769,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2657,7 +2814,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2697,7 +2859,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"eu.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2737,7 +2904,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "eu-west-1"
+ }
},
"au.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2777,7 +2949,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"jp.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2852,7 +3029,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -2887,7 +3068,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -2922,7 +3107,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -2957,7 +3146,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"au.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -2992,7 +3185,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"jp.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -3027,7 +3224,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-sonnet-4-20250514-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -3060,7 +3261,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -3099,7 +3304,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.5e-06,
"output_cost_per_token_batches": 7.5e-06,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-v1": {
"input_cost_per_token": 8e-06,
@@ -3312,7 +3521,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
- "output_cost_per_token_batches": 2.75e-06
+ "output_cost_per_token_batches": 2.75e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"apac.anthropic.claude-sonnet-4-20250514-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -3345,7 +3558,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"assemblyai/best": {
"input_cost_per_second": 3.333e-05,
@@ -3396,7 +3613,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.65e-06,
"output_cost_per_token_batches": 8.25e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"azure/ada": {
"deprecation_date": "2028-02-09",
@@ -14651,7 +14872,11 @@
"supports_vision": true,
"supports_native_structured_output": true,
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 1024
+ "prompt_cache_min_tokens": 1024,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"bedrock/us-gov-east-1/claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.5e-06,
@@ -14828,7 +15053,11 @@
"supports_vision": true,
"supports_native_structured_output": true,
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 1024
+ "prompt_cache_min_tokens": 1024,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"bedrock/us-gov-west-1/claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.5e-06,
@@ -24589,7 +24818,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
- "output_cost_per_token_batches": 2.75e-06
+ "output_cost_per_token_batches": 2.75e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-3-5-sonnet-20240620-v1:0": {
"input_cost_per_token": 3e-06,
@@ -24686,7 +24919,11 @@
"supports_tool_choice": true,
"supports_vision": true,
"prompt_cache_min_tokens": 1024,
- "deprecation_date": "2027-01-08"
+ "deprecation_date": "2027-01-08",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-1-20250805-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-opus-4-20250514-v1:0": {
"cache_creation_input_token_cost": 1.875e-05,
@@ -24745,7 +24982,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.125e-06,
@@ -24784,7 +25025,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.65e-06,
"output_cost_per_token_batches": 8.25e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.meta.llama3-2-1b-instruct-v1:0": {
"deprecation_date": "2026-07-07",
@@ -33929,7 +34174,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.5e-06,
"output_cost_per_token_batches": 7.5e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-sonnet-4-20250514-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -33962,7 +34211,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-haiku-4-5-20251001-v1:0": {
"cache_creation_input_token_cost": 1.25e-06,
@@ -33990,7 +34243,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5e-07,
- "output_cost_per_token_batches": 2.5e-06
+ "output_cost_per_token_batches": 2.5e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"global.amazon.nova-2-lite-v1:0": {
"cache_read_input_token_cost": 7.5e-08,
@@ -39238,7 +39495,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.65e-06,
"output_cost_per_token_batches": 8.25e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"jp.anthropic.claude-haiku-4-5-20251001-v1:0": {
"cache_creation_input_token_cost": 1.375e-06,
@@ -39266,7 +39527,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
- "output_cost_per_token_batches": 2.75e-06
+ "output_cost_per_token_batches": 2.75e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"crusoe/deepseek-ai/DeepSeek-R1-0528": {
"input_cost_per_token": 3e-06,
@@ -48338,7 +48603,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
- "output_cost_per_token_batches": 2.75e-06
+ "output_cost_per_token_batches": 2.75e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-3-5-sonnet-20240620-v1:0": {
"input_cost_per_token": 3e-06,
@@ -48436,7 +48705,11 @@
"supports_tool_choice": true,
"supports_vision": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-1-20250805-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.125e-06,
@@ -48475,7 +48748,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.65e-06,
"output_cost_per_token_batches": 8.25e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us-gov.anthropic.claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.5e-06,
@@ -48506,7 +48783,11 @@
"supports_native_structured_output": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us-gov.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -48541,7 +48822,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -48576,7 +48862,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -48609,7 +48900,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -48644,7 +48940,12 @@
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"thinking_always_on": true,
- "supports_forced_tool_use": false
+ "supports_forced_tool_use": false,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.5e-05,
@@ -48678,7 +48979,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-fable-5-1",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.nvidia.nemotron-nano-3-30b": {
"input_cost_per_token": 7.2e-08,
@@ -48831,7 +49137,11 @@
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
"output_cost_per_token_batches": 2.75e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-opus-4-20250514-v1:0": {
"cache_creation_input_token_cost": 1.875e-05,
@@ -48890,7 +49200,11 @@
"bedrock_output_config_effort_ceiling": "high",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-5-20251101-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-opus-4-5-20251101-v1:0": {
"cache_creation_input_token_cost": 6.25e-06,
@@ -48923,7 +49237,11 @@
"bedrock_output_config_effort_ceiling": "high",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-5-20251101-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-opus-4-5-20251101-v1:0": {
"cache_creation_input_token_cost": 6.875e-06,
@@ -48956,7 +49274,11 @@
"bedrock_output_config_effort_ceiling": "high",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-5-20251101-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-sonnet-4-20250514-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -48989,7 +49311,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.deepseek.r1-v1:0": {
"deprecation_date": "2027-03-30",
@@ -61055,7 +61381,11 @@
"supports_native_structured_output": true,
"supports_pdf_input": true,
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 4096
+ "prompt_cache_min_tokens": 4096,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-haiku-4-5-20251001-v1:0": {
"cache_creation_input_token_cost": 1.5e-06,
@@ -61081,7 +61411,11 @@
"supports_native_structured_output": true,
"supports_pdf_input": true,
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 4096
+ "prompt_cache_min_tokens": 4096,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"snowflake/claude-sonnet-4-5": {
"max_tokens": 16384,
@@ -67226,7 +67560,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -67260,7 +67599,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -67292,7 +67636,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -67327,7 +67676,12 @@
"supports_xhigh_reasoning_effort": true,
"thinking_always_on": true,
"supports_forced_tool_use": false,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.5e-05,
@@ -67360,7 +67714,12 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 512
+ "prompt_cache_min_tokens": 512,
+ "token_count_model": {
+ "model": "anthropic.claude-fable-5-1",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-east-1/nvidia.nemotron-nano-3-30b": {
"input_cost_per_token": 7.2e-08,
@@ -72763,7 +73122,12 @@
"cache_read_input_token_cost": 1.1e-06,
"output_cost_per_token": 5.5e-05,
"cache_creation_input_token_cost_above_1hr": 2.2e-05,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-mythos-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"apac.anthropic.claude-fable-5": {
"litellm_provider": "bedrock_converse",
@@ -72862,7 +73226,12 @@
"input_cost_per_token": 5.5e-06,
"cache_creation_input_token_cost_above_1hr": 1.1e-05,
"cache_read_input_token_cost": 5.5e-07,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-northeast-1"
+ }
},
"apac.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -72897,7 +73266,12 @@
"output_cost_per_token": 2.75e-05,
"cache_read_input_token_cost": 5.5e-07,
"cache_creation_input_token_cost": 6.875e-06,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-northeast-1"
+ }
},
"apac.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -72930,7 +73304,12 @@
"input_cost_per_token": 5.5e-06,
"cache_read_input_token_cost": 5.5e-07,
"output_cost_per_token": 2.75e-05,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"apac.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -72965,7 +73344,12 @@
"input_cost_per_token": 4.4e-06,
"output_cost_per_token": 2.2e-05,
"cache_read_input_token_cost": 2.2e-07,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"apac.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -72995,7 +73379,11 @@
"cache_read_input_token_cost": 3.3e-07,
"cache_creation_input_token_cost": 4.125e-06,
"input_cost_per_token": 3.3e-06,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"apac.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -73030,7 +73418,12 @@
"input_cost_per_token": 2.2e-06,
"output_cost_per_token": 1.1e-05,
"cache_read_input_token_cost": 2.2e-07,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"us.anthropic.claude-mythos-preview": {
"litellm_provider": "bedrock_converse",
@@ -73154,6 +73547,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -73231,6 +73625,7 @@
"au.anthropic.claude-sonnet-5-5": {
"token_count_model": {
"model": "au.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "ap-southeast-4"
},
"bedrock_converse_supports_strict_tools": false,
@@ -73382,7 +73777,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"eu.anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -73435,6 +73835,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "global.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -73637,7 +74038,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us.anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -73648,6 +74054,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "us.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -74627,6 +75034,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -74709,6 +75117,7 @@
"au.anthropic.claude-haiku-5-5": {
"token_count_model": {
"model": "au.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "ap-southeast-4"
},
"input_cost_per_token_above_100k_tokens": 5.5e-07,
@@ -74880,7 +75289,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"eu.anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 5.5e-07,
@@ -74943,6 +75357,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "global.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -75078,7 +75493,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us.anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 5.5e-07,
@@ -75094,6 +75514,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "us.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
diff --git a/litellm/proxy/common_utils/token_count_settings.py b/litellm/proxy/common_utils/token_count_settings.py
index 6f805616820..22b35bd1001 100644
--- a/litellm/proxy/common_utils/token_count_settings.py
+++ b/litellm/proxy/common_utils/token_count_settings.py
@@ -9,7 +9,7 @@ import litellm
from litellm.anthropic_interface.exceptions.exception_mapping_utils import AnthropicExceptionMapping
from litellm.litellm_core_utils.core_helpers import as_str_mapping
from litellm.proxy._types import ProxyException
-from litellm.types.token_count import TokenCountSourceFields, TokenCountTokenizer
+from litellm.types.token_count import TokenCountProvider, TokenCountSourceFields, TokenCountTokenizer
from litellm.types.utils import TokenCountResponse
CANNOT_COUNT_MODEL_STATUSES: Final = frozenset({400, 404})
@@ -46,6 +46,7 @@ def _with_hint(message: str, hint: str) -> str:
class TokenCountModel:
model: str
region: str | None
+ litellm_provider: TokenCountProvider | None = None
@dataclass(frozen=True, slots=True)
@@ -100,9 +101,27 @@ def _non_blank(value: object) -> str | None:
return value if isinstance(value, str) and value.strip() else None
+def _count_provider(value: object) -> TokenCountProvider | None:
+ match value:
+ case "bedrock":
+ return "bedrock"
+ case "bedrock_mantle":
+ return "bedrock_mantle"
+ case _:
+ return None
+
+
def _count_model(value: Mapping[str, object]) -> TokenCountModel | None:
model: Final = _non_blank(value.get("model"))
- return None if model is None else TokenCountModel(model=model, region=_non_blank(value.get("region")))
+ return (
+ None
+ if model is None
+ else TokenCountModel(
+ model=model,
+ region=_non_blank(value.get("region")),
+ litellm_provider=_count_provider(value.get("litellm_provider")),
+ )
+ )
def _geography(region: str) -> str:
@@ -112,7 +131,10 @@ def _geography(region: str) -> str:
def _within_deployment_geography(
count_model: TokenCountModel | None, deployment_region: Callable[[], str]
) -> TokenCountModel | None:
- if count_model is None or count_model.region is None or count_model.model.startswith("global."):
+ if count_model is None or count_model.region is None:
+ return count_model
+ model: Final = count_model.model.removeprefix("bedrock/").removeprefix("bedrock_mantle/")
+ if model.startswith("global."):
return count_model
if _geography(deployment_region()) == _geography(count_model.region):
return count_model
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py
index 581698626d5..811d4b8601e 100644
--- a/litellm/proxy/proxy_server.py
+++ b/litellm/proxy/proxy_server.py
@@ -14851,9 +14851,14 @@ async def _provider_token_count(
Returns None when the count should be estimated locally, or the provider's failure when the framed local
estimate stands in for it and that failure is the answer if the estimate cannot read the request."""
count_model: Final = settings.count_model
- counted: Final = await (
- count_with(model_to_use, None) if count_model is None else count_with(count_model.model, count_model.region)
+ counting_model: Final = (
+ model_to_use
+ if count_model is None
+ else count_model.model
+ if count_model.litellm_provider is None
+ else f"{count_model.litellm_provider}/{count_model.model.removeprefix('bedrock/').removeprefix('bedrock_mantle/')}"
)
+ counted: Final = await count_with(counting_model, None if count_model is None else count_model.region)
if counted is None:
return None
if isinstance(counted, TokenCountResponse):
diff --git a/litellm/types/token_count.py b/litellm/types/token_count.py
index 3b21401066c..90ccefea177 100644
--- a/litellm/types/token_count.py
+++ b/litellm/types/token_count.py
@@ -4,11 +4,13 @@ from typing_extensions import NotRequired, ReadOnly, TypedDict
TokenCountSource: TypeAlias = Literal["provider", "token_count_model", "local_estimate"]
TokenCountTokenizer: TypeAlias = Literal["kimi_k3"]
+TokenCountProvider: TypeAlias = Literal["bedrock", "bedrock_mantle"]
class TokenCountModelInfo(TypedDict):
model: ReadOnly[str]
region: ReadOnly[NotRequired[str]]
+ litellm_provider: ReadOnly[NotRequired[TokenCountProvider]]
class TokenCountSourceFields(TypedDict, total=False):
diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json
index 95285d50f26..7f8a2c2ae93 100644
--- a/model_prices_and_context_window.json
+++ b/model_prices_and_context_window.json
@@ -922,7 +922,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5e-07,
- "output_cost_per_token_batches": 2.5e-06
+ "output_cost_per_token_batches": 2.5e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-haiku-4-5@20251001": {
"cache_creation_input_token_cost": 1.25e-06,
@@ -1076,7 +1080,11 @@
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
- "prompt_cache_min_tokens": 1024
+ "prompt_cache_min_tokens": 1024,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-1-20250805-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-opus-4-20250514-v1:0": {
"cache_creation_input_token_cost": 1.875e-05,
@@ -1135,7 +1143,11 @@
"bedrock_output_config_effort_ceiling": "high",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-5-20251101-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1171,7 +1183,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1207,7 +1223,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1243,7 +1263,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1279,7 +1303,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"au.anthropic.claude-opus-4-6-v1": {
"supports_adaptive_thinking": true,
@@ -1315,7 +1343,11 @@
"bedrock_output_config_effort_ceiling": "max",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-6-v1",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -1353,7 +1385,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"anthropic.claude-mythos-preview": {
"cache_creation_input_token_cost": 3.4375e-05,
@@ -1411,7 +1448,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -1449,7 +1491,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"eu.anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -1487,7 +1534,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "eu-west-1"
+ }
},
"au.anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -1525,7 +1577,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.25e-05,
@@ -1563,7 +1620,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-fable-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.25e-05,
@@ -1640,7 +1702,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-fable-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.25e-05,
@@ -1717,7 +1784,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-fable-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.375e-05,
@@ -1870,7 +1942,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -1910,7 +1987,12 @@
"prompt_cache_min_tokens": 512,
"source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
"thinking_always_on": true,
- "supports_forced_tool_use": false
+ "supports_forced_tool_use": false,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -1948,7 +2030,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -1988,7 +2075,12 @@
"prompt_cache_min_tokens": 512,
"source": "https://aws.amazon.com/bedrock/pricing/",
"thinking_always_on": true,
- "supports_forced_tool_use": false
+ "supports_forced_tool_use": false,
+ "token_count_model": {
+ "model": "global.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2026,7 +2118,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2066,7 +2163,12 @@
"prompt_cache_min_tokens": 512,
"source": "https://aws.amazon.com/bedrock/pricing/",
"thinking_always_on": true,
- "supports_forced_tool_use": false
+ "supports_forced_tool_use": false,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"eu.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2104,7 +2206,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "eu-west-1"
+ }
},
"eu.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2182,7 +2289,12 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"au.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2222,7 +2334,12 @@
"prompt_cache_min_tokens": 512,
"thinking_always_on": true,
"supports_forced_tool_use": false,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"jp.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2340,7 +2457,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2380,7 +2502,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2420,7 +2547,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"eu.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2460,7 +2592,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "eu-west-1"
+ }
},
"au.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2500,7 +2637,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"jp.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -2540,7 +2682,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-northeast-1"
+ }
},
"jp.anthropic.claude-opus-4-7": {
"bedrock_converse_supports_strict_tools": false,
@@ -2577,7 +2724,12 @@
"supports_minimal_reasoning_effort": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 2048,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-northeast-1"
+ }
},
"anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2617,7 +2769,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"global.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2657,7 +2814,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "global.anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"us.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2697,7 +2859,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"eu.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2737,7 +2904,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "eu-west-1"
+ }
},
"au.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2777,7 +2949,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"jp.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -2852,7 +3029,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -2887,7 +3068,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -2922,7 +3107,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -2957,7 +3146,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"au.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -2992,7 +3185,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"jp.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -3027,7 +3224,11 @@
"supports_output_config": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-sonnet-4-20250514-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -3060,7 +3261,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -3099,7 +3304,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.5e-06,
"output_cost_per_token_batches": 7.5e-06,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"anthropic.claude-v1": {
"input_cost_per_token": 8e-06,
@@ -3312,7 +3521,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
- "output_cost_per_token_batches": 2.75e-06
+ "output_cost_per_token_batches": 2.75e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"apac.anthropic.claude-sonnet-4-20250514-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -3345,7 +3558,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"assemblyai/best": {
"input_cost_per_second": 3.333e-05,
@@ -3396,7 +3613,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.65e-06,
"output_cost_per_token_batches": 8.25e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"azure/ada": {
"deprecation_date": "2028-02-09",
@@ -14651,7 +14872,11 @@
"supports_vision": true,
"supports_native_structured_output": true,
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 1024
+ "prompt_cache_min_tokens": 1024,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"bedrock/us-gov-east-1/claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.5e-06,
@@ -14828,7 +15053,11 @@
"supports_vision": true,
"supports_native_structured_output": true,
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 1024
+ "prompt_cache_min_tokens": 1024,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"bedrock/us-gov-west-1/claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.5e-06,
@@ -24589,7 +24818,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
- "output_cost_per_token_batches": 2.75e-06
+ "output_cost_per_token_batches": 2.75e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-3-5-sonnet-20240620-v1:0": {
"input_cost_per_token": 3e-06,
@@ -24686,7 +24919,11 @@
"supports_tool_choice": true,
"supports_vision": true,
"prompt_cache_min_tokens": 1024,
- "deprecation_date": "2027-01-08"
+ "deprecation_date": "2027-01-08",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-1-20250805-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-opus-4-20250514-v1:0": {
"cache_creation_input_token_cost": 1.875e-05,
@@ -24745,7 +24982,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.125e-06,
@@ -24784,7 +25025,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.65e-06,
"output_cost_per_token_batches": 8.25e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.meta.llama3-2-1b-instruct-v1:0": {
"deprecation_date": "2026-07-07",
@@ -33929,7 +34174,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.5e-06,
"output_cost_per_token_batches": 7.5e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-sonnet-4-20250514-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -33962,7 +34211,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-haiku-4-5-20251001-v1:0": {
"cache_creation_input_token_cost": 1.25e-06,
@@ -33990,7 +34243,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5e-07,
- "output_cost_per_token_batches": 2.5e-06
+ "output_cost_per_token_batches": 2.5e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"global.amazon.nova-2-lite-v1:0": {
"cache_read_input_token_cost": 7.5e-08,
@@ -39238,7 +39495,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.65e-06,
"output_cost_per_token_batches": 8.25e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"jp.anthropic.claude-haiku-4-5-20251001-v1:0": {
"cache_creation_input_token_cost": 1.375e-06,
@@ -39266,7 +39527,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
- "output_cost_per_token_batches": 2.75e-06
+ "output_cost_per_token_batches": 2.75e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"crusoe/deepseek-ai/DeepSeek-R1-0528": {
"input_cost_per_token": 3e-06,
@@ -48338,7 +48603,11 @@
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
- "output_cost_per_token_batches": 2.75e-06
+ "output_cost_per_token_batches": 2.75e-06,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-3-5-sonnet-20240620-v1:0": {
"input_cost_per_token": 3e-06,
@@ -48436,7 +48705,11 @@
"supports_tool_choice": true,
"supports_vision": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-1-20250805-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.125e-06,
@@ -48475,7 +48748,11 @@
"prompt_cache_min_tokens": 1024,
"input_cost_per_token_batches": 1.65e-06,
"output_cost_per_token_batches": 8.25e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us-gov.anthropic.claude-sonnet-4-5-20250929-v1:0": {
"cache_creation_input_token_cost": 4.5e-06,
@@ -48506,7 +48783,11 @@
"supports_native_structured_output": true,
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-5-20250929-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us-gov.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -48541,7 +48822,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -48576,7 +48862,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -48609,7 +48900,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -48644,7 +48940,12 @@
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"thinking_always_on": true,
- "supports_forced_tool_use": false
+ "supports_forced_tool_use": false,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.5e-05,
@@ -48678,7 +48979,12 @@
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 512,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-fable-5-1",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us-gov.nvidia.nemotron-nano-3-30b": {
"input_cost_per_token": 7.2e-08,
@@ -48831,7 +49137,11 @@
"prompt_cache_min_tokens": 4096,
"input_cost_per_token_batches": 5.5e-07,
"output_cost_per_token_batches": 2.75e-06,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-opus-4-20250514-v1:0": {
"cache_creation_input_token_cost": 1.875e-05,
@@ -48890,7 +49200,11 @@
"bedrock_output_config_effort_ceiling": "high",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-5-20251101-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"global.anthropic.claude-opus-4-5-20251101-v1:0": {
"cache_creation_input_token_cost": 6.25e-06,
@@ -48923,7 +49237,11 @@
"bedrock_output_config_effort_ceiling": "high",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-5-20251101-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"eu.anthropic.claude-opus-4-5-20251101-v1:0": {
"cache_creation_input_token_cost": 6.875e-06,
@@ -48956,7 +49274,11 @@
"bedrock_output_config_effort_ceiling": "high",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 4096,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-5-20251101-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.anthropic.claude-sonnet-4-20250514-v1:0": {
"cache_creation_input_token_cost": 3.75e-06,
@@ -48989,7 +49311,11 @@
"supports_vision": true,
"bedrock_converse_supports_strict_tools": false,
"prompt_cache_min_tokens": 1024,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-20250514-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"us.deepseek.r1-v1:0": {
"deprecation_date": "2027-03-30",
@@ -61055,7 +61381,11 @@
"supports_native_structured_output": true,
"supports_pdf_input": true,
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 4096
+ "prompt_cache_min_tokens": 4096,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-haiku-4-5-20251001-v1:0": {
"cache_creation_input_token_cost": 1.5e-06,
@@ -61081,7 +61411,11 @@
"supports_native_structured_output": true,
"supports_pdf_input": true,
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 4096
+ "prompt_cache_min_tokens": 4096,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-4-5-20251001-v1:0",
+ "litellm_provider": "bedrock"
+ }
},
"snowflake/claude-sonnet-4-5": {
"max_tokens": 16384,
@@ -67226,7 +67560,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -67260,7 +67599,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -67292,7 +67636,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -67327,7 +67676,12 @@
"supports_xhigh_reasoning_effort": true,
"thinking_always_on": true,
"supports_forced_tool_use": false,
- "source": "https://aws.amazon.com/bedrock/pricing/"
+ "source": "https://aws.amazon.com/bedrock/pricing/",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-west-1/anthropic.claude-fable-5-1": {
"cache_creation_input_token_cost": 1.5e-05,
@@ -67360,7 +67714,12 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
- "prompt_cache_min_tokens": 512
+ "prompt_cache_min_tokens": 512,
+ "token_count_model": {
+ "model": "anthropic.claude-fable-5-1",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"bedrock/us-gov-east-1/nvidia.nemotron-nano-3-30b": {
"input_cost_per_token": 7.2e-08,
@@ -72763,7 +73122,12 @@
"cache_read_input_token_cost": 1.1e-06,
"output_cost_per_token": 5.5e-05,
"cache_creation_input_token_cost_above_1hr": 2.2e-05,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-mythos-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-east-1"
+ }
},
"apac.anthropic.claude-fable-5": {
"litellm_provider": "bedrock_converse",
@@ -72862,7 +73226,12 @@
"input_cost_per_token": 5.5e-06,
"cache_creation_input_token_cost_above_1hr": 1.1e-05,
"cache_read_input_token_cost": 5.5e-07,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-7",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-northeast-1"
+ }
},
"apac.anthropic.claude-opus-4-8": {
"bedrock_converse_supports_strict_tools": false,
@@ -72897,7 +73266,12 @@
"output_cost_per_token": 2.75e-05,
"cache_read_input_token_cost": 5.5e-07,
"cache_creation_input_token_cost": 6.875e-06,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-4-8",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-northeast-1"
+ }
},
"apac.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -72930,7 +73304,12 @@
"input_cost_per_token": 5.5e-06,
"cache_read_input_token_cost": 5.5e-07,
"output_cost_per_token": 2.75e-05,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"apac.anthropic.claude-opus-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -72965,7 +73344,12 @@
"input_cost_per_token": 4.4e-06,
"output_cost_per_token": 2.2e-05,
"cache_read_input_token_cost": 2.2e-07,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"apac.anthropic.claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@@ -72995,7 +73379,11 @@
"cache_read_input_token_cost": 3.3e-07,
"cache_creation_input_token_cost": 4.125e-06,
"input_cost_per_token": 3.3e-06,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-4-6",
+ "litellm_provider": "bedrock"
+ }
},
"apac.anthropic.claude-sonnet-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -73030,7 +73418,12 @@
"input_cost_per_token": 2.2e-06,
"output_cost_per_token": 1.1e-05,
"cache_read_input_token_cost": 2.2e-07,
- "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
+ "source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json",
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "ap-southeast-4"
+ }
},
"us.anthropic.claude-mythos-preview": {
"litellm_provider": "bedrock_converse",
@@ -73154,6 +73547,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -73231,6 +73625,7 @@
"au.anthropic.claude-sonnet-5-5": {
"token_count_model": {
"model": "au.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "ap-southeast-4"
},
"bedrock_converse_supports_strict_tools": false,
@@ -73382,7 +73777,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"eu.anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -73435,6 +73835,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "global.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -73637,7 +74038,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-sonnet-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us.anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
@@ -73648,6 +74054,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "us.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -74627,6 +75034,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -74709,6 +75117,7 @@
"au.anthropic.claude-haiku-5-5": {
"token_count_model": {
"model": "au.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "ap-southeast-4"
},
"input_cost_per_token_above_100k_tokens": 5.5e-07,
@@ -74880,7 +75289,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"eu.anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 5.5e-07,
@@ -74943,6 +75357,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "global.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
@@ -75078,7 +75493,12 @@
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
- "supports_xhigh_reasoning_effort": true
+ "supports_xhigh_reasoning_effort": true,
+ "token_count_model": {
+ "model": "anthropic.claude-haiku-5-5",
+ "litellm_provider": "bedrock_mantle",
+ "region": "us-gov-west-1"
+ }
},
"us.anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 5.5e-07,
@@ -75094,6 +75514,7 @@
"litellm_provider": "bedrock_converse",
"token_count_model": {
"model": "us.anthropic.claude-opus-5-5",
+ "litellm_provider": "bedrock_mantle",
"region": "us-east-1"
},
"supports_tool_search": true,
diff --git a/model_prices_and_context_window.schema.json b/model_prices_and_context_window.schema.json
index de57fc0616c..ce9af67eb94 100644
--- a/model_prices_and_context_window.schema.json
+++ b/model_prices_and_context_window.schema.json
@@ -1229,9 +1229,16 @@
"region": {
"type": "string",
"pattern": "\\S"
+ },
+ "litellm_provider": {
+ "type": "string",
+ "enum": [
+ "bedrock",
+ "bedrock_mantle"
+ ]
}
},
- "description": "Model that counts tokens for this one, and the AWS region its count API runs in."
+ "description": "Model that counts tokens for this one, its counting provider, and the AWS region its count API runs in."
},
"token_count_tokenizer": {
"type": "string",
diff --git a/tests/unit/llms/bedrock/count_tokens/test_bedrock_token_counter.py b/tests/unit/llms/bedrock/count_tokens/test_bedrock_token_counter.py
index 8a21027872a..dd0d6429f8a 100644
--- a/tests/unit/llms/bedrock/count_tokens/test_bedrock_token_counter.py
+++ b/tests/unit/llms/bedrock/count_tokens/test_bedrock_token_counter.py
@@ -174,3 +174,50 @@ async def test_claude_runtime_404_retries_with_system_and_tools_on_mantle() -> N
"system": "You are a terse assistant.",
"tools": tools,
}
+
+
+ ("model", "host", "tokenizer", "expected_tokens"),
+ (
+ ("bedrock_mantle/anthropic.claude-opus-5-5", MANTLE_HOST, "bedrock_mantle_api", 271),
+ ("bedrock/anthropic.claude-3-haiku-20240307-v1:0", RUNTIME_HOST, "bedrock_api", 193),
+ ),
+)
+async def test_qualified_counting_model_uses_its_endpoint_without_a_failed_probe(
+ model: str, host: str, tokenizer: str, expected_tokens: int
+) -> None:
+ bedrock: Final = _Bedrock(runtime=(200, {"inputTokens": 193}), mantle=(200, {"input_tokens": 271}))
+
+ result: Final = await _counter(bedrock).count_tokens(
+ model_to_use=model,
+ messages=MESSAGES,
+ contents=None,
+ deployment=DEPLOYMENT,
+ request_model="served-model",
+ )
+
+ assert result is not None
+ assert result.total_tokens == expected_tokens
+ assert result.tokenizer_type == tokenizer
+ assert bedrock.posted_hosts() == (host,)
+ if host == MANTLE_HOST:
+ assert _JSON_BODY.validate_json(bedrock.requests[0].content)["model"] == model.split("/", 1)[1]
+
+
+async def test_explicit_mantle_failure_does_not_probe_runtime() -> None:
+ bedrock: Final = _Bedrock(runtime=(200, {"inputTokens": 193}), mantle=(404, UNSUPPORTED))
+
+ result: Final = await _counter(bedrock).count_tokens(
+ model_to_use="bedrock_mantle/anthropic.claude-opus-5-5",
+ messages=MESSAGES,
+ contents=None,
+ deployment=DEPLOYMENT,
+ )
+
+ assert result is not None
+ assert result.error is True
+ assert result.status_code == 404
+ assert result.tokenizer_type == "bedrock_mantle_api"
+ assert bedrock.posted_hosts() == (MANTLE_HOST,)
diff --git a/tests/unit/proxy/common_utils/test_token_count_settings.py b/tests/unit/proxy/common_utils/test_token_count_settings.py
index 8bd5ced1b58..d7314f1a6d3 100644
--- a/tests/unit/proxy/common_utils/test_token_count_settings.py
+++ b/tests/unit/proxy/common_utils/test_token_count_settings.py
@@ -4,6 +4,7 @@ from typing import Final
import pytest
+from litellm.llms.bedrock.common_utils import get_bedrock_base_model
from litellm.proxy.common_utils.token_count_settings import (
ProviderCountFailure,
TokenCountModel,
@@ -33,6 +34,13 @@ def _in_us_west_2() -> str:
{"token_count_framing": 5, "token_count_model": {"model": "custom-model", "region": "ap-southeast-4"}},
TokenCountSettings(framing=5, count_model=TokenCountModel(model="custom-model", region="ap-southeast-4")),
),
+ (
+ {"token_count_model": {"model": "custom-model", "litellm_provider": "bedrock_mantle"}},
+ TokenCountSettings(
+ framing=97,
+ count_model=TokenCountModel(model="custom-model", region=None, litellm_provider="bedrock_mantle"),
+ ),
+ ),
(
{"token_count_model": {"model": "custom-model"}},
TokenCountSettings(framing=97, count_model=TokenCountModel(model="custom-model", region=None)),
@@ -94,13 +102,15 @@ def test_shipped_count_region_never_takes_the_prompt_out_of_the_deployment_geogr
assert settings.count_model == TokenCountModel(model="anthropic.claude-opus-5-5", region=expected_region)
-def test_shipped_global_count_model_keeps_its_region_for_a_deployment_in_any_geography() -> None:
[email protected]("prefix", ("", "bedrock/", "bedrock_mantle/"))
+def test_shipped_global_count_model_keeps_its_region_for_a_deployment_in_any_geography(prefix: str) -> None:
+ model: Final = f"{prefix}global.anthropic.claude-opus-5-5"
settings: Final = resolve_token_count_settings(
configured={},
- default={"token_count_model": {"model": "global.anthropic.claude-opus-5-5", "region": "us-east-1"}},
+ default={"token_count_model": {"model": model, "region": "us-east-1"}},
deployment_region=lambda: "eu-west-1",
)
- assert settings.count_model == TokenCountModel(model="global.anthropic.claude-opus-5-5", region="us-east-1")
+ assert settings.count_model == TokenCountModel(model=model, region="us-east-1")
def test_shipped_australian_count_region_stays_with_an_australian_deployment() -> None:
@@ -157,21 +167,24 @@ def test_count_source_fields_name_the_counting_model_only_when_token_count_model
assert count_source_fields(_counted(source)) == expected
-def test_every_shipped_token_count_model_is_another_mapped_model_of_the_same_provider_in_a_named_region() -> None:
+def test_every_shipped_token_count_model_resolves_to_a_mapped_aws_model() -> None:
cost_map: Final = json.loads(_COST_MAP.read_text())
+ aws_models: Final = frozenset(
+ get_bedrock_base_model(name)
+ for name, entry in cost_map.items()
+ if isinstance(entry, dict) and entry.get("litellm_provider") in ("bedrock", "bedrock_converse")
+ )
count_models: Final = {
name: entry["token_count_model"]
for name, entry in cost_map.items()
if isinstance(entry, dict) and "token_count_model" in entry
}
assert count_models
- assert {
- name: count_model
- for name, count_model in count_models.items()
- if cost_map.get(count_model["model"], {}).get("litellm_provider") != cost_map[name]["litellm_provider"]
- or count_model["model"] == name
- or not count_model.get("region")
- } == {}
+ for name, count_model in count_models.items():
+ model: Final = count_model["model"]
+ assert get_bedrock_base_model(model) in aws_models
+ assert cost_map[name]["litellm_provider"] in ("bedrock", "bedrock_converse")
+ assert "region" not in count_model or count_model["region"].strip()
_UPSTREAM_404: Final = {
diff --git a/tests/unit/proxy/test_proxy_token_counter.py b/tests/unit/proxy/test_proxy_token_counter.py
index 5cbda9d320c..f1b8d3fd591 100644
--- a/tests/unit/proxy/test_proxy_token_counter.py
+++ b/tests/unit/proxy/test_proxy_token_counter.py
@@ -67,6 +67,7 @@ from litellm.proxy.common_utils.token_count_settings import (
TokenCountModel,
TokenCountSettings,
cost_map_entry,
+ resolve_token_count_settings,
)
from litellm.proxy.google_endpoints.endpoints import _google_count_tokens_request
from litellm.proxy.proxy_server import (
@@ -1636,6 +1637,65 @@ async def test_model_without_token_count_model_counts_itself_in_the_deployment_r
assert ([call[0] for call in counter.calls], counter.regions) == (["us.anthropic.claude-sonnet-5-5"], ["us-west-2"])
+ ("provider", "expected_host", "expected_tokens"),
+ (
+ ("bedrock", "bedrock-runtime.us-east-1.amazonaws.com", 193),
+ ("bedrock_mantle", "bedrock-mantle.us-east-1.api.aws", 271),
+ ),
+)
+async def test_token_count_model_provider_selects_the_endpoint_and_preserves_the_public_model(
+ provider: str, expected_host: str, expected_tokens: int, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ monkeypatch.delenv("AWS_BEARER_TOKEN_BEDROCK", raising=False)
+ model: Final = "anthropic.claude-opus-5-5"
+
+ def peer(request: httpx.Request) -> httpx.Response:
+ assert request.url.host == expected_host
+ if provider == "bedrock_mantle":
+ assert json.loads(request.content)["model"] == model
+ return httpx.Response(200, json={"input_tokens": expected_tokens})
+ assert request.url.path == f"/model/{model}/count-tokens"
+ return httpx.Response(200, json={"inputTokens": expected_tokens})
+
+ settings: Final = resolve_token_count_settings(
+ configured={},
+ default={"token_count_model": {"model": model, "litellm_provider": provider, "region": "us-east-1"}},
+ deployment_region=lambda: "us-west-2",
+ )
+ counter: Final = BedrockTokenCounter(client=AsyncHTTPHandler(transport=httpx.MockTransport(peer)))
+ result: Final = await _provider_token_count(
+ count_with=partial(
+ _try_provider_token_count,
+ counter,
+ "bedrock",
+ messages=_COUNT_REQUEST.messages,
+ contents=_COUNT_REQUEST.contents,
+ request_model=_COUNT_REQUEST.model,
+ deployment={
+ "litellm_params": {
+ "aws_access_key_id": "AKIATESTACCESSKEY",
+ "aws_secret_access_key": "test-secret",
+ "aws_region_name": "us-west-2",
+ }
+ },
+ tools=_COUNT_REQUEST.tools,
+ system=_COUNT_REQUEST.system,
+ ),
+ model_to_use="us.anthropic.claude-sonnet-5-5",
+ settings=settings,
+ local_estimate_allowed=False,
+ )
+
+ assert isinstance(result, TokenCountResponse)
+ assert (result.total_tokens, result.model_used, result.count_source) == (
+ expected_tokens,
+ model,
+ "token_count_model",
+ )
+
+
@pytest.mark.parametrize(
("count_model", "region"),
[
@@ -2658,7 +2718,7 @@ async def test_uncountable_model_keeps_the_provider_error_when_local_counting_is
@pytest.mark.parametrize(
("model_info", "counted_with"),
[
- ({}, ("us.anthropic.claude-opus-5-5", "us-east-1", 447)),
+ ({}, ("bedrock_mantle/us.anthropic.claude-opus-5-5", "us-east-1", 447)),
(
{"token_count_model": {"model": "us.anthropic.claude-opus-5-5", "region": "ap-southeast-4"}},
("us.anthropic.claude-opus-5-5", "ap-southeast-4", 447),
@@ -2674,6 +2734,7 @@ async def test_configured_token_count_model_overrides_the_shipped_one_and_an_emp
{
"us.anthropic.claude-sonnet-5-5": _provider_reply("sonnet", total_tokens=300),
"us.anthropic.claude-opus-5-5": _provider_reply("opus", total_tokens=447),
+ "bedrock_mantle/us.anthropic.claude-opus-5-5": _provider_reply("opus", total_tokens=447),
}
)
monkeypatch.setattr(
@@ -2712,7 +2773,7 @@ async def test_configured_token_count_model_overrides_the_shipped_one_and_an_emp
async def test_shipped_token_count_model_keeps_the_prompt_in_the_deployment_geography(
monkeypatch: pytest.MonkeyPatch, aws_region_name: str, counted_in: str
):
- counter: Final = _ScriptedCounter({"anthropic.claude-opus-5-5": _provider_reply("opus", total_tokens=447)})
+ counter: Final = _ScriptedCounter({"bedrock_mantle/anthropic.claude-opus-5-5": _provider_reply("opus", total_tokens=447)})
monkeypatch.setattr(
litellm.proxy.proxy_server,
"llm_router",
@@ -2736,7 +2797,7 @@ async def test_shipped_token_count_model_keeps_the_prompt_in_the_deployment_geog
request=TokenCountRequest(model="sonnet", messages=[{"role": "user", "content": "hi"}]), call_endpoint=True
)
- assert (counter.calls[0][0], counter.regions[0]) == ("anthropic.claude-opus-5-5", counted_in)
+ assert (counter.calls[0][0], counter.regions[0]) == ("bedrock_mantle/anthropic.claude-opus-5-5", counted_in)
class _SlowVault:
@@ -2756,7 +2817,7 @@ async def _longest_stall(done: asyncio.Event) -> float:
async def test_region_lookup_for_a_shipped_count_model_leaves_the_event_loop_free(monkeypatch: pytest.MonkeyPatch):
from litellm.proxy import proxy_server
- counter: Final = _ScriptedCounter({"anthropic.claude-opus-5-5": _provider_reply("opus", total_tokens=447)})
+ counter: Final = _ScriptedCounter({"bedrock_mantle/anthropic.claude-opus-5-5": _provider_reply("opus", total_tokens=447)})
def bedrock_counter(deployment: object, model: str) -> tuple[_ScriptedCounter, str, str]:
return counter, model, "bedrock"