#21023 [Bug]: Inconsistent spend logging for custom model pricing (claude-opus-4.6) causes budget control failure
### 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…