mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-19 08:18:15 +00:00
* fix(cost_calculator): correct gpt-image-1 cost calculation using token-based pricing (#13847) gpt-image-1 uses token-based pricing (like chat models), not pixel-based pricing like DALL-E. The old code was calculating incorrect costs by treating it as DALL-E. Changes: - Update model pricing JSON with correct token-based costs for gpt-image-1 - Add dedicated cost calculator for OpenAI gpt-image models - Route gpt-image-1 to token-based calculator in cost router - Add comprehensive tests for the new calculator * refactor: simplify gpt-image-1 cost calculator using responses API helper Reuse _transform_response_api_usage_to_chat_usage and generic_cost_per_token for gpt-image-1 cost calculation since ImageUsage has the same spec as ResponseAPIUsage.
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/test_litellm
This folder can only run mock tests.