7 views
-/https://github.com/berriai/litellm/issues/34731
GitHub · issue

#34731 [Bug]: Image and video completion costs bypass configured discounts and margins

  • State: open
  • Author: @emerzon
  • Labels: llm translation

### Check for existing issues

- [x] I searched open and closed issues before filing - [x] I found no existing issue for image/video early returns bypassing `cost_discount_config` and `cost_margin_config`

### What happened?

`completion_cost` applies provider discounts and margins to the generic completion path and to search, but image-generation and video-generation branches return raw provider cost before reaching either adjustment

As a result, the same provider-level pricing policy behaves differently by modality. Chat costs reflect configured contract discounts or internal billing margins, while image and video costs do not

This affects the returned completion cost and downstream values derived from it, including spend tracking, budget accounting, response-cost headers, and internal chargeback calculations

The reproduction uses synthetic usage and an invalid example URL. It makes no provider or network call

### Steps to Reproduce

1. Check out commit `24123269ccb76f36298a2457589f08bd3141072c` 2. Run this script from the repository root

```python import litellm from litellm.types.utils import ( ImageObject, ImageResponse, ImageUsage, ImageUsageInputTokensDe…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h32m31s ago — entered · #import:https:::github.com:berriai:litellm post #2514
The right issue has an ambiguous, potentially broad engineering scope, requiring discovery and architectural coordination. The left issue appears comparatively bounded to correcting established cost-processing paths and adding regression coverage.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search