fix(pricing): remove gpt-image-2 text output cost - #32754
Conversation
Greptile SummaryRemoves the erroneous
Confidence Score: 5/5Safe to merge — the change removes a billing field that should never have existed; no logic is altered beyond the cost-map data. The deletions are narrow, factually correct per upstream pricing documentation, and mirrored consistently across both JSON files. The No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Removes incorrect output_cost_per_token from gpt-image-2 and gpt-image-2-2026-04-21 (both OpenAI and azure/ entries); image output rate preserved at 3e-5 |
| litellm/model_prices_and_context_window_backup.json | Mirror of the main cost map change — same four entries corrected; backup stays in sync with canonical file |
| tests/test_litellm/test_utils.py | Updates three existing assertions from output_cost_per_token == 1e-05 to == 0, adds a raw-JSON regression test; the == 0 assertion is valid because get_model_info defaults the missing field to 0 |
| tests/test_litellm/test_gpt_image_cost_calculator.py | Removes text-token parameters from breakdown test and updates fallback-path test to expect image rate (3e-5); both changes are consistent with the _get_token_base_cost fallback that uses output_cost_per_image_token when output_cost_per_token is 0 |
Reviews (1): Last reviewed commit: "fix(pricing): remove gpt-image-2 text ou..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
89f54fe to
9acf527
Compare
|
Superseded: the gpt-image-2 output_cost_per_token removal is already on litellm_internal_staging. Registry work continues in rolling PR #31884. |
Relevant issues
Related to #31142, closed unmerged #26865, and open #27064
PR #26865 already noted that GPT Image 2 has no text output rate, but it was closed without merging after #26644 added the current entries. PR #27064 applies the same omission to separate
azure_ai/...aliases and does not update these existing OpenAI and Azure entriesLinear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review)
Screenshots / Proof of Fix
No UI change
OpenAI lists GPT Image 2 text output as
-while image output remains $30 per 1M tokens, and the model page lists image as its only output modality. Microsoft likewise states there is no billing for GPT Image 2 text output tokensSources: OpenAI pricing, OpenAI model, Microsoft Foundry announcement
Before at
bf02a4a47f08ad8007a24c8da2ffa8de1a1d36a2:After at
89f54feccafb10c990b90d60a3271ce0185bdc77:Type
Bug Fix
Changes
Remove the unsupported
output_cost_per_tokenfield from the canonical and dated GPT Image 2 entries for OpenAI and Azure in both cost mapsUpdate model metadata and cost calculator regression tests so image output remains billed at
output_cost_per_image_tokenand raw cost maps cannot reintroduce a text output rate