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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Add supported providers to prompt caching doc (#26124)
Michael-RZ-Berri4f823cedac47
diff --git a/docs/my-website/docs/completion/prompt_caching.md b/docs/my-website/docs/completion/prompt_caching.mdindex 402c7b9f4c7..aaae7e7be76 100644--- a/docs/my-website/docs/completion/prompt_caching.md+++ b/docs/my-website/docs/completion/prompt_caching.md@@ -10,6 +10,7 @@ Supported Providers:- Vertex AI (`vertex_ai/`, `vertex_ai_beta/`)- Bedrock (`bedrock/`, `bedrock/invoke/`, `bedrock/converse`) ([All models bedrock supports prompt caching on](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html))- Deepseek API (`deepseek/`)+- xAI (`xai/`)For the supported providers, LiteLLM follows the OpenAI prompt caching usage object format:diff --git a/docs/my-website/docs/tutorials/prompt_caching.md b/docs/my-website/docs/tutorials/prompt_caching.mdindex ab2aa00d773..581d2ba7c36 100644--- a/docs/my-website/docs/tutorials/prompt_caching.md+++ b/docs/my-website/docs/tutorials/prompt_caching.md@@ -8,6 +8,22 @@ Reduce costs by up to 90% by using LiteLLM to auto-inject prompt caching checkpo<Image img={require('../../img/auto_prompt_caching.png')} style={{ width: '800px', height: 'auto' }} />+Supported Providers (`cache_control` marker):+- Anthropic API (`anthropic/`)+- AWS Bedrock - Claude (`bedrock/`)+- Vertex AI - Claude and Gemini (`vertex_ai/`)+- Google AI Studio - Gemini (`gemini/`)+- Azure AI - Claude (`azure_ai/`)+- OpenRouter - Claude, Gemini, MiniMax, GLM, z-ai routes (`openrouter/`)+- Databricks - Claude (`databricks/`)+- DashScope / Qwen (`dashscope/`)+- MiniMax (`minimax/`)+- Z.ai / GLM (`zai/`)++Provider Managed (automatic, no marker needed):+- OpenAI (`openai/`)+- DeepSeek (`deepseek/`)+- xAI (`xai/`)## How it worksdiff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex 04b68b8f4ec..72806369ea5 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -33302,6 +33302,7 @@"output_cost_per_token": 1.5e-05,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_response_schema": false,"supports_tool_choice": true,"supports_web_search": true@@ -33317,6 +33318,7 @@"output_cost_per_token": 1.5e-05,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_response_schema": false,"supports_tool_choice": true,"supports_web_search": true@@ -33332,6 +33334,7 @@"output_cost_per_token": 2.5e-05,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_response_schema": false,"supports_tool_choice": true,"supports_web_search": true@@ -33347,6 +33350,7 @@"output_cost_per_token": 2.5e-05,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_response_schema": false,"supports_tool_choice": true,"supports_web_search": true@@ -33362,6 +33366,7 @@"output_cost_per_token": 1.5e-05,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_response_schema": false,"supports_tool_choice": true,"supports_web_search": true@@ -33378,6 +33383,7 @@"output_cost_per_token": 5e-07,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": false,"supports_tool_choice": true,@@ -33395,6 +33401,7 @@"output_cost_per_token": 5e-07,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": false,"supports_tool_choice": true,@@ -33411,6 +33418,7 @@"output_cost_per_token": 4e-06,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": false,"supports_tool_choice": true,@@ -33427,6 +33435,7 @@"output_cost_per_token": 4e-06,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": false,"supports_tool_choice": true,@@ -33443,6 +33452,7 @@"output_cost_per_token": 4e-06,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": false,"supports_tool_choice": true,@@ -33459,6 +33469,7 @@"output_cost_per_token": 5e-07,"source": "https://x.ai/api#pricing","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": false,"supports_tool_choice": true,@@ -33474,38 +33485,41 @@"output_cost_per_token": 1.5e-05,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_tool_choice": true,"supports_web_search": true},"xai/grok-4-fast-reasoning": {+ "cache_read_input_token_cost": 5e-08,+ "input_cost_per_token": 2e-07,+ "input_cost_per_token_above_128k_tokens": 4e-07,"litellm_provider": "xai","max_input_tokens": 2000000.0,"max_output_tokens": 2000000.0,"max_tokens": 2000000.0,"mode": "chat",- "input_cost_per_token": 2e-07,- "input_cost_per_token_above_128k_tokens": 4e-07,"output_cost_per_token": 5e-07,"output_cost_per_token_above_128k_tokens": 1e-06,- "cache_read_input_token_cost": 5e-08,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_tool_choice": true,"supports_web_search": true},"xai/grok-4-fast-non-reasoning": {+ "cache_read_input_token_cost": 5e-08,+ "input_cost_per_token": 2e-07,+ "input_cost_per_token_above_128k_tokens": 4e-07,"litellm_provider": "xai","max_input_tokens": 2000000.0,"max_output_tokens": 2000000.0,- "cache_read_input_token_cost": 5e-08,"max_tokens": 2000000.0,"mode": "chat",- "input_cost_per_token": 2e-07,- "input_cost_per_token_above_128k_tokens": 4e-07,"output_cost_per_token": 5e-07,"output_cost_per_token_above_128k_tokens": 1e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_tool_choice": true,"supports_web_search": true},@@ -33521,6 +33535,7 @@"output_cost_per_token_above_128k_tokens": 3e-05,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_tool_choice": true,"supports_web_search": true},@@ -33536,6 +33551,7 @@"output_cost_per_token_above_128k_tokens": 3e-05,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_tool_choice": true,"supports_web_search": true},@@ -33553,6 +33569,7 @@"source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning","supports_audio_input": true,"supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": true,"supports_tool_choice": true,@@ -33573,6 +33590,7 @@"source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning","supports_audio_input": true,"supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": true,"supports_tool_choice": true,@@ -33593,6 +33611,7 @@"source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning","supports_audio_input": true,"supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_response_schema": true,"supports_tool_choice": true,@@ -33613,6 +33632,7 @@"source": "https://docs.x.ai/docs/models/grok-4-1-fast-non-reasoning","supports_audio_input": true,"supports_function_calling": true,+ "supports_prompt_caching": true,"supports_response_schema": true,"supports_tool_choice": true,"supports_vision": true,@@ -33632,6 +33652,7 @@"source": "https://docs.x.ai/docs/models/grok-4-1-fast-non-reasoning","supports_audio_input": true,"supports_function_calling": true,+ "supports_prompt_caching": true,"supports_response_schema": true,"supports_tool_choice": true,"supports_vision": true,@@ -33648,6 +33669,7 @@"output_cost_per_token": 6e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_tool_choice": true,"supports_vision": true,@@ -33664,6 +33686,7 @@"output_cost_per_token": 6e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_tool_choice": true,"supports_vision": true,@@ -33696,6 +33719,7 @@"output_cost_per_token": 6e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_tool_choice": true,"supports_vision": true,"supports_web_search": true@@ -33724,6 +33748,7 @@"output_cost_per_token": 1.5e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_tool_choice": true},@@ -33738,6 +33763,7 @@"output_cost_per_token": 1.5e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_tool_choice": true},@@ -33752,6 +33778,7 @@"output_cost_per_token": 1.5e-06,"source": "https://docs.x.ai/docs/models","supports_function_calling": true,+ "supports_prompt_caching": true,"supports_reasoning": true,"supports_tool_choice": true},