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(types): add cache_read_cost and cache_creation_cost fields to CostBreakdown TypedDict

Ishaan Jafferc1dcfa70c97b
diff --git a/litellm/types/utils.py b/litellm/types/utils.py
index c6fa61f8a97..0e3bc8f3ed3 100644
--- a/litellm/types/utils.py
+++ b/litellm/types/utils.py
@@ -2798,7 +2798,9 @@ class CostBreakdown(TypedDict, total=False):
Detailed cost breakdown for a request
"""
- input_cost: float # Cost of input/prompt tokens
+ input_cost: float # Cost of raw (non-cached) input tokens only
+ cache_read_cost: float # Cost of cache-read tokens (discounted rate)
+ cache_creation_cost: float # Cost of cache-write tokens (premium rate)
output_cost: (
float # Cost of output/completion tokens (includes reasoning if applicable)
)