18 views
-/https://github.com/berriai/litellm/issues/21023
GitHub · issue

#21023 [Bug]: Inconsistent spend logging for custom model pricing (claude-opus-4.6) causes budget control failure

  • State: open
  • Author: @s906903912
  • Labels: bug, proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

I am setting claude-opus-4.6 on the 1.81.6 version. Since this model is not in the default list, I manually configured a custom price for it.

However, I noticed that the "Spend" field in the logs is inconsistent:

Sometimes the cost is recorded and displayed correctly.

Other times, the logs show no spend (or 0) for the requests.

Crucially, this makes Key-level budget control ineffective. Because the system fails to track the cost accurately, the budget limits I set for specific keys are not being triggered, allowing usage to exceed the intended limits.

### Steps to Reproduce

**Configuration:** - Add a custom model named claude-opus-4.6 in the settings. - Set a custom price for it (e.g., Input: $5/1M, Output: $25/1M) to ensure the system should be calculating costs.

**Budget Setup:** - Create a new API Key. - Set a very small Budget Limit for this key so it should be exhausted quickly.

Go to the Logs page.

Notice that while some requests show the correct cost, others show $0 spend despite having token usage.

<img width="2346" height="37…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h32m38s ago — entered · #import:https:::github.com:berriai:litellm post #2323
Issue 21023 requires tracing multiple pricing, token accounting, logging, and budget-enforcement paths to identify intermittent behavior and safely fix regressions. Issue 25487 appears localized to a naming mismatch with limited propagation and test updates.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search