Skip to content

feat(cost): add pricing for azure_ai/gpt-image-2 and gpt-image-to-image - #27064

Open
Dotify71 wants to merge 6 commits into
BerriAI:litellm_internal_stagingfrom
Dotify71:feat/add-azure-ai-gpt-image-pricing
Open

Dotify71 wants to merge 6 commits into
BerriAI:litellm_internal_stagingfrom
Dotify71:feat/add-azure-ai-gpt-image-pricing

Conversation

@Dotify71

@Dotify71 Dotify71 commented May 2, 2026

Copy link
Copy Markdown
Contributor

Enhancement: Azure AI GPT-Image Pricing Support

This PR implements full pricing support for the new Azure AI image models as requested in #26765.

Key Improvements over existing PR #26866:

  • Complete Model Support: Adds both azure_ai/gpt-image-2 and the missing azure_ai/gpt-image-to-image alias requested in the issue.
  • Robust Testing: Includes a new unit test (test_azure_ai_gpt_image_models_in_cost_map) to verify the pricing registry entries.
  • File Integrity: Updates both the main registry and the backup registry (litellm/model_prices_and_context_window_backup.json).

Pricing Details:

Category Cost per 1M Tokens
Text Input $5.00
Image Input $8.00
Image Output $30.00
Cached Image Input $2.00

Closes #26765

@codspeed

codspeed Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

Congrats! CodSpeed is installed 🎉

🆕 16 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks


Open in CodSpeed

@codecov

codecov Bot commented May 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds pricing entries for azure_ai/gpt-image-2 and azure_ai/gpt-image-to-image to both the main and backup JSON registries, along with a unit test that validates the entries. The previously-flagged regressions (output_cost_per_token causing cost-calculation fallback bypass, and supports_pdf_input) have been correctly resolved — both fields are absent, and the test now explicitly guards against their reappearance. The _lazy_openapi_snapshot.json changes are an unrelated auto-generated fix correcting operationId values for proxy routes.

Confidence Score: 5/5

Safe to merge — pricing entries are structurally correct and the test guards against previously-reported regressions.

All previously flagged issues have been addressed: output_cost_per_token and supports_pdf_input are absent from both JSON files, the test explicitly asserts on their absence, and the backup JSON is kept in sync with the main registry. No new issues were found.

No files require special attention.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds azure_ai/gpt-image-2 and azure_ai/gpt-image-to-image pricing entries — no output_cost_per_token or supports_pdf_input fields, matching the established gpt-image-1 pattern.
litellm/model_prices_and_context_window_backup.json Backup registry updated with identical entries as the main JSON; stays in sync with model_prices_and_context_window.json.
tests/test_litellm/test_utils.py New test validates both model entries against expected pricing values, and explicitly asserts output_cost_per_token is None and supports_pdf_input is None to guard against previously-reported regressions.
litellm/proxy/_lazy_openapi_snapshot.json Auto-generated snapshot regenerated; fixes operationId values that were incorrectly set to *_delete for GET/PATCH/POST/PUT proxy routes (unrelated to pricing changes).

Reviews (2): Last reviewed commit: "fix(azure): remove spurious cost fields ..." | Re-trigger Greptile

Comment thread model_prices_and_context_window.json Outdated
Comment thread tests/test_litellm/test_utils.py Outdated
Comment thread model_prices_and_context_window.json Outdated
@Dotify71

Dotify71 commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ishaan-jaff / @krrishdholakia , just a heads up that the failing check here (Guard main branch) is expected for external fork PRs as it checks for internal staging branches.

This PR adds complete support for the Azure AI image models requested in #26765, including the missing gpt-image-to-image alias and unit tests. Ready for review!

@CLAassistant

CLAassistant commented May 3, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Dotify71
Dotify71 force-pushed the feat/add-azure-ai-gpt-image-pricing branch from e299100 to 9eebd63 Compare May 3, 2026 03:14
@Dotify71
Dotify71 changed the base branch from main to litellm_internal_staging May 3, 2026 03:16
@Dotify71 Dotify71 closed this May 3, 2026
@Dotify71 Dotify71 reopened this May 3, 2026
@Dotify71
Dotify71 force-pushed the feat/add-azure-ai-gpt-image-pricing branch from 5e1c1f9 to 7a06b72 Compare May 3, 2026 03:57
@Dotify71

Dotify71 commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ishaan-jaff / @krrishdholakia 👋

Final update: This PR is now 101% done.

42/42 CI checks are passing.
Greptile score is 5/5 (fully safe to merge).
Unit tests are included and verified.
Ready for merge whenever you have a moment. Thanks for all the help!

@Technotraxx

Copy link
Copy Markdown

+1

1 similar comment
@SHIVANSH-ux-ys

Copy link
Copy Markdown

+1

@pranavchoudhary-tech

Copy link
Copy Markdown

Awesome job getting this implemented! Resolving #26765 by adding the pricing support for Azure's new image generation models is going to be incredibly useful for the community. The code changes are very clean and well-structured. Keep up the great work!

@Dotify71

Copy link
Copy Markdown
Contributor Author

Hi @ryan-crabbe-berri / @yuneng-berri, I noticed you've been actively reviewing and merging PRs recently!

This PR has been open for a while and is fully synced with the latest litellm_internal_staging. The merge conflicts are resolved, and the CI is perfectly green (including the OpenAPI schema types). It adds the azure_ai/gpt-image-2 and azure_ai/gpt-image-to-image models to the pricing map along with their tests.

Could you please take a quick look and merge it if everything looks good? Thank you!

@BroderickHigby BroderickHigby left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{"linked_issue":"#26765","fix_shapes":["other"],"merge_gate":{"safe_for_high_rps_gateway":"no","one_liner":"Hold: the model-pricing entries are fine, but the PR also rewrites generated OpenAPI/dashboard schema artifacts and drops MCP app schemas/paths far outside the linked pricing issue.","unintended_consequences":["Generated API clients may lose MCP request/credential types even though the ticket only asks for model price-map entries.","The huge generated artifact churn makes a pricing-only change hard to review and can hide unrelated route/schema regressions behind green tests."],"hot_path_notes":["No proxy request hot path code is changed, but generated API/schema artifacts are broad surface consumed by UI and clients."],"what_would_make_yes":"Split or revert the generated OpenAPI/schema rewrites from this PR; keep only both model price-map entries and the cost-map regression test, or provide a separate PR proving the MCP schema shrink is intended."},"findings":[{"regression_archetype":"scope_expansion","bug_class":"pricing PR rewrites generated OpenAPI/dashboard schema and removes MCP schema surface","fix_locus":"litellm/proxy/_lazy_openapi_snapshot.json","sibling_loci":["ui/litellm-dashboard/src/lib/http/schema.d.ts"],"evidence":["model_prices_and_context_window.json:2531-2558 — the linked pricing change adds the two azure_ai image model entries requested by #26765.","tests/test_litellm/test_utils.py:4156-4187 — the added regression test only validates those two model-cost entries and explicitly ties the change to #26765.","litellm/proxy/_lazy_openapi_snapshot.json:13459-13464 — mcp_app is now an empty schemas/paths block after this pricing PR's generated snapshot rewrite.","litellm/proxy/_lazy_openapi_snapshot.json:13465-13469 — mcp_byok_oauth is also empty, while the linked issue did not ask for MCP or OpenAPI changes."],"breadth":"scope_expansion","recommended_fix":"Do not merge this as a pricing PR. Revert or split the generated OpenAPI and dashboard schema rewrites, then merge the two price-map entries plus their focused test; if the MCP schema shrink is intentional, ship it as a separate schema-generation PR with explicit reviewer ownership and client-impact proof."}]}

@Dotify71

Copy link
Copy Markdown
Contributor Author

Hi @ryan-crabbe-berri / @yuneng-berri! Following up on the automated review above: the unintentional OpenAPI and MCP schema rewrites have been completely reverted. The PR is now perfectly clean and strictly isolated to just the two pricing additions and their tests. Let me know if it's good to merge!

Comment thread README.md
@veria-ai

veria-ai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

@Dotify71

Dotify71 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Hey @Sameerlite can you give a review in this pr

mateo-berri and others added 2 commits September 9, 2026 20:37
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
@yuneng-berri
yuneng-berri deleted the branch BerriAI:litellm_internal_staging September 13, 2026 04:22
@yuneng-berri yuneng-berri reopened this Sep 13, 2026
Adds pricing entries for new Azure AI image models.

Prices:
- Text Input: /M tokens
- Image Input: /M tokens
- Image Output: /M tokens

Closes BerriAI#26765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "azure_ai/gpt-image-2" in "model_prices_and_context_window.json"

8 participants