litellm/tests/integration/cost_calculation
devin-ai-integration[bot] c2bc5aecff
fix(cost_calculator): apply the anthropic fast multiplier to cache cost breakdown (#46112)
* fix(cost_calculator): apply the anthropic fast multiplier to cache cost breakdown

Anthropic fast mode billed totals at provider_specific_entry.fast while the
spend log cost_breakdown kept cache_read_cost and cache_creation_cost at 1x.
Move the speed lookup into a shared helper, multiply it into the billed token
rates used by get_token_type_cost_breakdown, and have the Anthropic calculator
read the same helper so totals and breakdown cannot drift apart.

Production change carried from #44074.

Co-authored-by: kerry <kerry@berri.ai>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cost_calculator): narrow the provider entry instead of defaulting to a dict literal

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: kerry <kerry@berri.ai>
2026-10-12 17:38:08 -07:00
..
cases fix(cost_calculator): apply the anthropic fast multiplier to cache cost breakdown (#46112) 2026-10-12 17:38:08 -07:00
stream_parity test(integration): move the openai cost tracking cases from cost_tracking_cases.json to CostTrackingTestCase literals (#45879) 2026-10-10 23:29:23 +00:00
assertions.py test(integration): tighten batch and realtime cost assertions 2026-09-20 01:29:46 +00:00
catalog.py test(integration): bill Decisions spend from captured provider responses on /v1/decisions and /v1/systemone (#45902) 2026-10-12 09:51:06 -07:00
conftest.py test(integration): wait for the batch retrieval row and drop the failed-only output file 2026-09-20 01:46:23 +00:00
cost_map.py feat(decisions): bill decisions and systemone from _decisions cost map fields (#45904) 2026-10-12 14:31:12 -07:00
cost_tracking_case.py feat(decisions): bill decisions and systemone from _decisions cost map fields (#45904) 2026-10-12 14:31:12 -07:00
test_batch_realtime_cost.py test(integration): move the openai cost tracking cases from cost_tracking_cases.json to CostTrackingTestCase literals (#45879) 2026-10-10 23:29:23 +00:00
test_cost_tracking.py test(integration): bill Decisions spend from captured provider responses on /v1/decisions and /v1/systemone (#45902) 2026-10-12 09:51:06 -07:00