#31835 [Feature]: SpendLogs historical recalculation and failed request billing policy
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### The Feature
I would like LiteLLM to support historical SpendLogs recalculation and configurable failed request billing policy.
Suggested behavior:
1. Admins can recalculate historical spend for a date range. 2. Recalculation can use the current model cost map or a selected pricing rule version. 3. Failed request billing behavior can be configured. 4. Recalculation can correct stale or missing spend fields. 5. The process should be auditable and safe to run repeatedly.
Example failed request billing policies:
- never bill failed requests - bill failed requests only if token usage is present - preserve provider-reported cost - custom callback decides
Suggested admin operation:
```text POST /spend/recalculate
### Motivation, pitch
Spend tracking is operationally important, but historical spend records may need recalculation when:
- model pricing configuration changes - provider returns corrected usage - a bug caused incorrect cost calculation - failed requests were incorrectly billed - enterprise negotiated pricing is updated
Today, teams often need ex…