#27191 [Feature]: Cache Token Cost & Tracking for Custom Pricing and OpenAI-Compatible Providers
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### The Feature
## Summary
Two related but independent bugs prevented LiteLLM from correctly handling prompt-cache tokens when using:
1. **Custom pricing** (`custom_cost_per_token` with `cache_read_input_token_cost` / `cache_creation_input_token_cost`) — cache tokens were billed at the full `input_cost_per_token` rate instead of the configured cache rate. 2. **OpenAI-compatible providers** (moonshotai, openai, deepseek, kimi-k2, etc.) that report cache info via `usage.prompt_tokens_details` — daily spend aggregation always recorded `Cache Read Tokens = 0` and `Cache Write Tokens = 0` in the dashboard.
This patch fixes both, while preserving existing behavior when no custom cache pricing is configured (cache tokens fall back to `input_cost_per_token`).
References: - https://github.com/BerriAI/litellm/issues/26807 - https://docs.litellm.ai/docs/proxy/custom_pricing - https://docs.litellm.ai/docs/completion/prompt_caching
---
## Bug 1: `custom_cost_per_token` Ignores Cache Token Pricing
### Symptom
When a user configures custom pricing with ca…