LibreChat/packages
Danny Avila 4cb35945dc
🩹 fix: Bill Anthropic Prompt-Cache Tokens Once (#13798)
The installed @librechat/agents folds cache_creation + cache_read into
Anthropic usage_metadata.input_tokens (cache-inclusive), but
cacheSubsetProviders omitted anthropic, so splitUsage() took the additive
branch and billed cache tokens twice — at the full input rate and again at
the cache write/read rate. Verified live: a cache-read-heavy Sonnet call was
overcharged 10.7x.

Add Providers.ANTHROPIC to cacheSubsetProviders (single source of truth for
backend billing and client usage normalization). Bedrock stays additive: its
Converse path passes AWS inputTokens through unmodified. Update the Anthropic
regression tests to production-accurate cache-inclusive fixtures.

Fixes #13795
2026-06-16 14:28:48 -04:00
..
api 🩹 fix: Bill Anthropic Prompt-Cache Tokens Once (#13798) 2026-06-16 14:28:48 -04:00
client v0.8.7-rc1 (#13592) 2026-06-15 13:10:30 -04:00
data-provider 🩹 fix: Bill Anthropic Prompt-Cache Tokens Once (#13798) 2026-06-16 14:28:48 -04:00
data-schemas 🧾 refactor: Disable Context Cost By Default (#13768) 2026-06-15 15:13:30 -04:00