You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: OpenAI image spans price only one image when n > 1 #1933
common_image_logic in sdk/python/src/openlit/instrumentation/openai/utils.py computes gen_ai.usage.cost as get_image_model_cost(model, pricing, size, quality). That is the price of a single image. The request's n and the number of images in response.data are ignored. OpenAI bills per image, so images.generate(n=4) reports 1/4 of the real cost, both on the span and on the gen_ai.usage.cost metric. The same function also backs images.edit and images.create_variation.
The Together image path already multiplies by the number of returned images (len(scope._response_data) * cost).
Activity