Merge pull request #38405 from BerriAI/litellm_lit6243_prompt_cache_min_tokens

fix(cost-map): correct prompt_cache_min_tokens for Claude Fable 5 and backfill Anthropic re-export entries
This commit is contained in:
Mateo Wang 2026-08-26 14:51:56 -07:00 • committed by GitHub
commit 77bce45100
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 279 additions and 104 deletions

View file

@ -1428,7 +1428,7 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024
"prompt_cache_min_tokens": 512
},
"global.anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.25e-05,
@ -1465,7 +1465,7 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024
"prompt_cache_min_tokens": 512
},
"us.anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.375e-05,
@ -1502,7 +1502,7 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024
"prompt_cache_min_tokens": 512
},
"eu.anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.375e-05,
@ -1539,7 +1539,7 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024
"prompt_cache_min_tokens": 512
},
"anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@ -2933,7 +2933,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 4096
},
"azure_ai/claude-opus-4-5": {
"deprecation_date": "2026-10-19",
@ -2956,7 +2957,8 @@
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"azure_ai/claude-opus-4-6": {
"deprecation_date": "2027-02-02",
@ -2987,7 +2989,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 4096
},
"azure_ai/claude-opus-4-7": {
"deprecation_date": "2027-04-06",
@ -3018,7 +3021,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 2048
},
"azure_ai/claude-fable-5": {
"supports_mid_conversation_system": true,
@ -3050,7 +3054,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 512
},
"azure_ai/claude-opus-5": {
"supports_mid_conversation_system": true,
@ -3113,7 +3118,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 1024
},
"azure_ai/claude-opus-4-1": {
"deprecation_date": "2026-08-05",
@ -3135,7 +3141,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"azure_ai/claude-sonnet-4-5": {
"deprecation_date": "2026-10-19",
@ -3157,7 +3164,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"azure_ai/claude-sonnet-5": {
"supports_mid_conversation_system": true,
@ -3188,7 +3196,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 1024
},
"azure_ai/claude-sonnet-4-6": {
"deprecation_date": "2027-02-10",
@ -3214,7 +3223,8 @@
"supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 1024
},
"azure/computer-use-preview": {
"input_cost_per_token": 3e-06,
@ -14724,7 +14734,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 4096
},
"databricks/databricks-claude-opus-4": {
"cache_creation_input_token_cost": 1.874999e-05,
@ -14746,7 +14757,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-opus-4-1": {
"cache_creation_input_token_cost": 1.874999e-05,
@ -14768,7 +14780,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-opus-4-5": {
"cache_creation_input_token_cost": 6.25002e-06,
@ -14791,7 +14804,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"databricks/databricks-claude-opus-4-6": {
"cache_creation_input_token_cost": 6.25002e-06,
@ -14814,7 +14828,8 @@
"supports_legacy_thinking": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 4096
},
"databricks/databricks-claude-opus-4-7": {
"cache_creation_input_token_cost": 6.25002e-06,
@ -14916,7 +14931,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-sonnet-4-1": {
"cache_creation_input_token_cost": 3.74997e-06,
@ -14960,7 +14976,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-sonnet-4-6": {
"cache_creation_input_token_cost": 3.74997e-06,
@ -14983,7 +15000,8 @@
"supports_legacy_thinking": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-sonnet-5": {
"cache_creation_input_token_cost": 3.74997e-06,
@ -33861,7 +33879,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-opus-4.1": {
"input_cost_per_image": 0.0048,
@ -33881,7 +33900,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-sonnet-4": {
"input_cost_per_image": 0.0048,
@ -33904,7 +33924,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-sonnet-4.6": {
"supports_adaptive_thinking": true,
@ -33930,7 +33951,8 @@
"supports_reasoning": true,
"supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-opus-4.5": {
"cache_creation_input_token_cost": 6.25e-06,
@ -33949,7 +33971,8 @@
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"openrouter/anthropic/claude-opus-4.6": {
"supports_adaptive_thinking": true,
@ -33970,7 +33993,8 @@
"supports_reasoning": true,
"supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 4096
},
"openrouter/anthropic/claude-sonnet-4.5": {
"input_cost_per_image": 0.0048,
@ -33993,7 +34017,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-haiku-4.5": {
"cache_creation_input_token_cost": 1.25e-06,
@ -34011,7 +34036,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 4096
},
"openrouter/anthropic/claude-opus-4.7": {
"supports_adaptive_thinking": true,
@ -34034,7 +34060,8 @@
"supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true
"supports_xhigh_reasoning_effort": true,
"prompt_cache_min_tokens": 2048
},
"openrouter/anthropic/claude-opus-5": {
"prompt_cache_min_tokens": 512,
@ -36501,7 +36528,8 @@
"supports_system_messages": true,
"supports_tool_choice": true,
"supports_response_schema": true,
"supports_prompt_caching": true
"supports_prompt_caching": true,
"prompt_cache_min_tokens": 4096
},
"replicate/ibm-granite/granite-3.3-8b-instruct": {
"input_cost_per_token": 3e-08,
@ -36583,7 +36611,8 @@
"supports_system_messages": true,
"supports_tool_choice": true,
"supports_response_schema": true,
"supports_prompt_caching": true
"supports_prompt_caching": true,
"prompt_cache_min_tokens": 1024
},
"replicate/deepseek-ai/deepseek-v3": {
"input_cost_per_token": 1.45e-06,
@ -36658,7 +36687,8 @@
"supports_system_messages": true,
"supports_tool_choice": true,
"supports_response_schema": true,
"supports_prompt_caching": true
"supports_prompt_caching": true,
"prompt_cache_min_tokens": 1024
},
"replicate/openai/gpt-4.1": {
"input_cost_per_token": 2e-06,
@ -39687,7 +39717,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 4096
},
"vercel_ai_gateway/anthropic/claude-opus-4": {
"cache_creation_input_token_cost": 1.875e-05,
@ -39706,7 +39737,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"vercel_ai_gateway/anthropic/claude-opus-4.1": {
"cache_creation_input_token_cost": 1.875e-05,
@ -39725,7 +39757,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"vercel_ai_gateway/anthropic/claude-opus-4.5": {
"cache_creation_input_token_cost": 6.25e-06,
@ -39745,7 +39778,8 @@
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"vercel_ai_gateway/anthropic/claude-opus-4.6": {
"supports_adaptive_thinking": true,
@ -39767,7 +39801,8 @@
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"vercel_ai_gateway/anthropic/claude-sonnet-4": {
"cache_creation_input_token_cost": 3.75e-06,
@ -39786,7 +39821,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"vercel_ai_gateway/anthropic/claude-sonnet-4.5": {
"cache_creation_input_token_cost": 3.75e-06,
@ -39804,7 +39840,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"vercel_ai_gateway/cohere/command-a": {
"input_cost_per_token": 2.5e-06,
@ -41169,7 +41206,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 512
},
"vertex_ai/claude-fable-5@default": {
"deprecation_date": "2027-06-08",
@ -41203,7 +41241,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 512
},
"vertex_ai/claude-opus-5": {
"deprecation_date": "2027-01-24",
@ -50107,7 +50146,8 @@
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 1024
},
"snowflake/claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@ -50124,7 +50164,8 @@
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 1024
},
"snowflake/claude-4-sonnet": {
"max_tokens": 16384,
@ -50139,7 +50180,8 @@
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 1024
},
"snowflake/claude-4-opus": {
"max_tokens": 16384,
@ -50155,7 +50197,8 @@
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_reasoning": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 1024
},
"snowflake/claude-haiku-4-5": {
"max_tokens": 16384,
@ -50170,7 +50213,8 @@
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 4096
},
"snowflake/claude-3-7-sonnet": {
"max_tokens": 16384,

View file

@ -1428,7 +1428,7 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024
"prompt_cache_min_tokens": 512
},
"global.anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.25e-05,
@ -1465,7 +1465,7 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024
"prompt_cache_min_tokens": 512
},
"us.anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.375e-05,
@ -1502,7 +1502,7 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024
"prompt_cache_min_tokens": 512
},
"eu.anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.375e-05,
@ -1539,7 +1539,7 @@
"supports_output_config": true,
"bedrock_output_config_effort_ceiling": "xhigh",
"supports_parallel_tool_use_config": true,
"prompt_cache_min_tokens": 1024
"prompt_cache_min_tokens": 512
},
"anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
@ -2933,7 +2933,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 4096
},
"azure_ai/claude-opus-4-5": {
"deprecation_date": "2026-10-19",
@ -2956,7 +2957,8 @@
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"azure_ai/claude-opus-4-6": {
"deprecation_date": "2027-02-02",
@ -2987,7 +2989,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 4096
},
"azure_ai/claude-opus-4-7": {
"deprecation_date": "2027-04-06",
@ -3018,7 +3021,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 2048
},
"azure_ai/claude-fable-5": {
"supports_mid_conversation_system": true,
@ -3050,7 +3054,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 512
},
"azure_ai/claude-opus-5": {
"supports_mid_conversation_system": true,
@ -3113,7 +3118,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 1024
},
"azure_ai/claude-opus-4-1": {
"deprecation_date": "2026-08-05",
@ -3135,7 +3141,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"azure_ai/claude-sonnet-4-5": {
"deprecation_date": "2026-10-19",
@ -3157,7 +3164,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"azure_ai/claude-sonnet-5": {
"supports_mid_conversation_system": true,
@ -3188,7 +3196,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 1024
},
"azure_ai/claude-sonnet-4-6": {
"deprecation_date": "2027-02-10",
@ -3214,7 +3223,8 @@
"supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 1024
},
"azure/computer-use-preview": {
"input_cost_per_token": 3e-06,
@ -14724,7 +14734,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 4096
},
"databricks/databricks-claude-opus-4": {
"cache_creation_input_token_cost": 1.874999e-05,
@ -14746,7 +14757,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-opus-4-1": {
"cache_creation_input_token_cost": 1.874999e-05,
@ -14768,7 +14780,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-opus-4-5": {
"cache_creation_input_token_cost": 6.25002e-06,
@ -14791,7 +14804,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"databricks/databricks-claude-opus-4-6": {
"cache_creation_input_token_cost": 6.25002e-06,
@ -14814,7 +14828,8 @@
"supports_legacy_thinking": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 4096
},
"databricks/databricks-claude-opus-4-7": {
"cache_creation_input_token_cost": 6.25002e-06,
@ -14916,7 +14931,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-sonnet-4-1": {
"cache_creation_input_token_cost": 3.74997e-06,
@ -14960,7 +14976,8 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-sonnet-4-6": {
"cache_creation_input_token_cost": 3.74997e-06,
@ -14983,7 +15000,8 @@
"supports_legacy_thinking": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
"databricks/databricks-claude-sonnet-5": {
"cache_creation_input_token_cost": 3.74997e-06,
@ -33861,7 +33879,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-opus-4.1": {
"input_cost_per_image": 0.0048,
@ -33881,7 +33900,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-sonnet-4": {
"input_cost_per_image": 0.0048,
@ -33904,7 +33924,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-sonnet-4.6": {
"supports_adaptive_thinking": true,
@ -33930,7 +33951,8 @@
"supports_reasoning": true,
"supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-opus-4.5": {
"cache_creation_input_token_cost": 6.25e-06,
@ -33949,7 +33971,8 @@
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"openrouter/anthropic/claude-opus-4.6": {
"supports_adaptive_thinking": true,
@ -33970,7 +33993,8 @@
"supports_reasoning": true,
"supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 4096
},
"openrouter/anthropic/claude-sonnet-4.5": {
"input_cost_per_image": 0.0048,
@ -33993,7 +34017,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"openrouter/anthropic/claude-haiku-4.5": {
"cache_creation_input_token_cost": 1.25e-06,
@ -34011,7 +34036,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 4096
},
"openrouter/anthropic/claude-opus-4.7": {
"supports_adaptive_thinking": true,
@ -34034,7 +34060,8 @@
"supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true
"supports_xhigh_reasoning_effort": true,
"prompt_cache_min_tokens": 2048
},
"openrouter/anthropic/claude-opus-5": {
"prompt_cache_min_tokens": 512,
@ -36501,7 +36528,8 @@
"supports_system_messages": true,
"supports_tool_choice": true,
"supports_response_schema": true,
"supports_prompt_caching": true
"supports_prompt_caching": true,
"prompt_cache_min_tokens": 4096
},
"replicate/ibm-granite/granite-3.3-8b-instruct": {
"input_cost_per_token": 3e-08,
@ -36583,7 +36611,8 @@
"supports_system_messages": true,
"supports_tool_choice": true,
"supports_response_schema": true,
"supports_prompt_caching": true
"supports_prompt_caching": true,
"prompt_cache_min_tokens": 1024
},
"replicate/deepseek-ai/deepseek-v3": {
"input_cost_per_token": 1.45e-06,
@ -36658,7 +36687,8 @@
"supports_system_messages": true,
"supports_tool_choice": true,
"supports_response_schema": true,
"supports_prompt_caching": true
"supports_prompt_caching": true,
"prompt_cache_min_tokens": 1024
},
"replicate/openai/gpt-4.1": {
"input_cost_per_token": 2e-06,
@ -39687,7 +39717,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 4096
},
"vercel_ai_gateway/anthropic/claude-opus-4": {
"cache_creation_input_token_cost": 1.875e-05,
@ -39706,7 +39737,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"vercel_ai_gateway/anthropic/claude-opus-4.1": {
"cache_creation_input_token_cost": 1.875e-05,
@ -39725,7 +39757,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"vercel_ai_gateway/anthropic/claude-opus-4.5": {
"cache_creation_input_token_cost": 6.25e-06,
@ -39745,7 +39778,8 @@
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"vercel_ai_gateway/anthropic/claude-opus-4.6": {
"supports_adaptive_thinking": true,
@ -39767,7 +39801,8 @@
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_output_config": true
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
},
"vercel_ai_gateway/anthropic/claude-sonnet-4": {
"cache_creation_input_token_cost": 3.75e-06,
@ -39786,7 +39821,8 @@
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"vercel_ai_gateway/anthropic/claude-sonnet-4.5": {
"cache_creation_input_token_cost": 3.75e-06,
@ -39804,7 +39840,8 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true
"supports_vision": true,
"prompt_cache_min_tokens": 1024
},
"vercel_ai_gateway/cohere/command-a": {
"input_cost_per_token": 2.5e-06,
@ -41169,7 +41206,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 512
},
"vertex_ai/claude-fable-5@default": {
"deprecation_date": "2027-06-08",
@ -41203,7 +41241,8 @@
"supports_tool_choice": true,
"supports_vision": true,
"supports_xhigh_reasoning_effort": true,
"supports_max_reasoning_effort": true
"supports_max_reasoning_effort": true,
"prompt_cache_min_tokens": 512
},
"vertex_ai/claude-opus-5": {
"deprecation_date": "2027-01-24",
@ -50107,7 +50146,8 @@
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 1024
},
"snowflake/claude-sonnet-4-6": {
"supports_adaptive_thinking": true,
@ -50124,7 +50164,8 @@
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 1024
},
"snowflake/claude-4-sonnet": {
"max_tokens": 16384,
@ -50139,7 +50180,8 @@
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 1024
},
"snowflake/claude-4-opus": {
"max_tokens": 16384,
@ -50155,7 +50197,8 @@
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_reasoning": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 1024
},
"snowflake/claude-haiku-4-5": {
"max_tokens": 16384,
@ -50170,7 +50213,8 @@
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
"supports_response_schema": true,
"prompt_cache_min_tokens": 4096
},
"snowflake/claude-3-7-sonnet": {
"max_tokens": 16384,

View file

@ -4452,14 +4452,101 @@ def test_get_prompt_cache_min_tokens_resolves_per_model(
assert get_prompt_cache_min_tokens(model=model) == expected_min_tokens
def test_get_prompt_cache_min_tokens_differs_per_platform_for_same_model(local_model_cost_map: None) -> None:
"""The same model can carry a different minimum per platform, so the threshold must come from
the platform's own cost-map entry rather than being derived from the model family name."""
assert get_prompt_cache_min_tokens(model="claude-fable-5") == 512
assert get_prompt_cache_min_tokens(model="anthropic.claude-fable-5") == 1024
assert get_prompt_cache_min_tokens(model="claude-fable-5") != get_prompt_cache_min_tokens(
model="anthropic.claude-fable-5"
)
def test_get_prompt_cache_min_tokens_uniform_for_fable_5_across_platforms(local_model_cost_map: None) -> None:
"""Anthropic removed the Amazon Bedrock override for Claude Fable 5, so its 512-token minimum
now applies on every platform. The Bedrock entries carried the old 1024 and the re-export
entries carried nothing, so the router judged 512-1023-token prefixes uncacheable and skipped
prompt-cache-affinity routing for prompts the provider demonstrably caches (issue #35011)."""
wrong: Final = {
model: get_prompt_cache_min_tokens(model=model)
for model, info in litellm.model_cost.items()
if "fable-5" in model
and info.get("supports_prompt_caching")
and get_prompt_cache_min_tokens(model=model) != 512
}
assert not wrong, f"every Claude Fable 5 entry must carry prompt_cache_min_tokens 512: {wrong}"
ANTHROPIC_REEXPORT_CACHE_MIN: Final = {
"azure_ai/claude-fable-5": 512,
"azure_ai/claude-haiku-4-5": 4096,
"azure_ai/claude-opus-4-1": 1024,
"azure_ai/claude-opus-4-5": 4096,
"azure_ai/claude-opus-4-6": 4096,
"azure_ai/claude-opus-4-7": 2048,
"azure_ai/claude-opus-4-8": 1024,
"azure_ai/claude-sonnet-4-5": 1024,
"azure_ai/claude-sonnet-4-6": 1024,
"azure_ai/claude-sonnet-5": 1024,
"databricks/databricks-claude-haiku-4-5": 4096,
"databricks/databricks-claude-opus-4": 1024,
"databricks/databricks-claude-opus-4-1": 1024,
"databricks/databricks-claude-opus-4-5": 4096,
"databricks/databricks-claude-opus-4-6": 4096,
"databricks/databricks-claude-sonnet-4": 1024,
"databricks/databricks-claude-sonnet-4-5": 1024,
"databricks/databricks-claude-sonnet-4-6": 1024,
"openrouter/anthropic/claude-haiku-4.5": 4096,
"openrouter/anthropic/claude-opus-4": 1024,
"openrouter/anthropic/claude-opus-4.1": 1024,
"openrouter/anthropic/claude-opus-4.5": 4096,
"openrouter/anthropic/claude-opus-4.6": 4096,
"openrouter/anthropic/claude-opus-4.7": 2048,
"openrouter/anthropic/claude-sonnet-4": 1024,
"openrouter/anthropic/claude-sonnet-4.5": 1024,
"openrouter/anthropic/claude-sonnet-4.6": 1024,
"replicate/anthropic/claude-4-sonnet": 1024,
"replicate/anthropic/claude-4.5-haiku": 4096,
"replicate/anthropic/claude-4.5-sonnet": 1024,
"snowflake/claude-4-opus": 1024,
"snowflake/claude-4-sonnet": 1024,
"snowflake/claude-haiku-4-5": 4096,
"snowflake/claude-sonnet-4-5": 1024,
"snowflake/claude-sonnet-4-6": 1024,
"vercel_ai_gateway/anthropic/claude-haiku-4.5": 4096,
"vercel_ai_gateway/anthropic/claude-opus-4": 1024,
"vercel_ai_gateway/anthropic/claude-opus-4.1": 1024,
"vercel_ai_gateway/anthropic/claude-opus-4.5": 4096,
"vercel_ai_gateway/anthropic/claude-opus-4.6": 4096,
"vercel_ai_gateway/anthropic/claude-sonnet-4": 1024,
"vercel_ai_gateway/anthropic/claude-sonnet-4.5": 1024,
"vertex_ai/claude-fable-5": 512,
"vertex_ai/claude-fable-5@default": 512,
}
def test_anthropic_reexport_entries_carry_explicit_prompt_cache_min_tokens(local_model_cost_map: None) -> None:
"""Regression for issue #35011: these re-export entries carried no prompt_cache_min_tokens, so
they silently inherited the 1024 default. That skipped cache-affinity routing for Fable 5's
512-1023-token prefixes and reported 1024-4095-token prompts as cacheable on the 2048/4096
models. The entry must be explicit so a default change can never re-break them, which is why
this asserts the cost-map value itself and not just the resolver's answer."""
wrong: Final = {
model: (litellm.model_cost[model].get("prompt_cache_min_tokens"), get_prompt_cache_min_tokens(model=model))
for model, expected in ANTHROPIC_REEXPORT_CACHE_MIN.items()
if litellm.model_cost[model].get("prompt_cache_min_tokens") != expected
or get_prompt_cache_min_tokens(model=model) != expected
}
assert not wrong, f"(cost-map value, resolved value) diverge from Anthropic's published minimums: {wrong}"
def test_anthropic_reexport_cache_minimums_present_in_root_cost_map() -> None:
"""The root map ships to the CDN independently of the bundled backup, so both must carry the
minimum or proxies reading one of them regress to the 1024 default."""
root_map_path: Final = os.path.join(os.path.dirname(__file__), "..", "..", "model_prices_and_context_window.json")
with open(root_map_path) as f:
root_map: Final = json.load(f)
wrong: Final = {
model: root_map[model].get("prompt_cache_min_tokens")
for model, expected in ANTHROPIC_REEXPORT_CACHE_MIN.items()
if root_map[model].get("prompt_cache_min_tokens") != expected
}
fable_5_wrong: Final = {
model: info.get("prompt_cache_min_tokens")
for model, info in root_map.items()
if "fable-5" in model and info.get("supports_prompt_caching") and info.get("prompt_cache_min_tokens") != 512
}
assert not wrong and not fable_5_wrong, f"root cost map diverges: {wrong | fable_5_wrong}"
GEMINI_4096_CACHE_MIN_MODELS: Final = tuple(