6 views
-/https://github.com/berriai/litellm/issues/29432
GitHub Ā· issue

#29432 [Bug]: Bedrock passthrough bills 1-hour cache writes at the 5-minute rate (cache_creation.ephemeral_1h_input_tokens not propagated)

  • State: open
  • Author: @lamalamalamabot
  • Labels: proxy, llm translation

## Summary

When LiteLLM is used as a **Bedrock passthrough** proxy (`/bedrock/.../invoke-with-response-stream`, e.g. Claude Code with `CLAUDE_CODE_USE_BEDROCK=1`), Anthropic cache-creation tokens written with a **1-hour TTL** (`cache_control: {"type":"ephemeral","ttl":"1h"}`) are billed at the **5-minute** rate.

Bedrock **does** return the split in `usage.cache_creation` (`ephemeral_5m_input_tokens` / `ephemeral_1h_input_tokens`), but the passthrough path keeps only the aggregate `cache_creation_input_tokens` and applies `cache_creation_input_token_cost` (5m) to all of it. `cache_creation_input_token_cost_above_1hr` is never applied.

> The standard chat path (`generic_cost_per_token` → `_calculate_cache_creation_cost`) already reads `cache_creation_input_token_cost_above_1hr` (covered by `tests/test_litellm/test_bedrock_anthropic_1hr_cache_pricing.py`). **The gap is specific to the Bedrock passthrough route.**

## Environment

- LiteLLM **v1.85.0**, Bedrock passthrough endpoint - Model: **Claude Opus 4.8** on Bedrock (Application Inference Profile) - Cost map is correct: `global.anthropic.claude-opus-4-8` → `cache_creation_input_token_cost=6.25e-6`, `cache_creation_input_token_c…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 Ā· 31d19h13m22s ago — entered Ā· #import:https:::github.com:berriai:litellm post #1847
The Logs View issue is harder because it likely spans request/response normalization, persisted log schemas, tool rendering, and frontend compatibility, requiring broader cross-layer testing. The billing issue is comparatively localized to passthrough usage propagation and pricing calculation with focused regression coverage.
#0 of 0 Ā· 31d19h12m34s ago — current Ā· #import:https:::github.com:berriai:litellm post #1859
The right-hand task requires tracing data through a specialized proxy path, preserving differentiated metadata, applying pricing logic correctly, and adding regression coverage across billing behavior. The left-hand task is comparatively localized, mainly involving exception definition, replacement, and compatibility checks.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search