From 4e68cbd1ea628ca0b4ccde8218e2993f040ec708 Mon Sep 17 00:00:00 2001 From: milan Date: Tue, 28 Jul 2026 14:37:35 +0000 Subject: [PATCH] feat(azure_ai): add MAI-Image-2.5-Pro image generation pricing Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../model_prices_and_context_window_backup.json | 13 +++++++++++++ model_prices_and_context_window.json | 13 +++++++++++++ .../image_generation/test_mai_image_generation.py | 15 ++++++++++++++- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 2cef600ea32..073e0737f57 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -8642,6 +8642,19 @@ "/v1/images/edits" ] }, + "azure_ai/MAI-Image-2.5-Pro": { + "input_cost_per_image_token": 8e-06, + "input_cost_per_token": 5e-06, + "litellm_provider": "azure_ai", + "mode": "image_generation", + "output_cost_per_image": 0.05, + "output_cost_per_image_token": 4.7e-05, + "source": "https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/new-mai-models-in-microsoft-foundry-across-text-image-voice-and-speech/4524632", + "supported_endpoints": [ + "/v1/images/generations", + "/v1/images/edits" + ] + }, "azure_ai/MAI-Image-2e": { "input_cost_per_token": 5e-06, "litellm_provider": "azure_ai", diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index db28118d52b..99bd299284a 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -8642,6 +8642,19 @@ "/v1/images/edits" ] }, + "azure_ai/MAI-Image-2.5-Pro": { + "input_cost_per_image_token": 8e-06, + "input_cost_per_token": 5e-06, + "litellm_provider": "azure_ai", + "mode": "image_generation", + "output_cost_per_image": 0.05, + "output_cost_per_image_token": 4.7e-05, + "source": "https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/new-mai-models-in-microsoft-foundry-across-text-image-voice-and-speech/4524632", + "supported_endpoints": [ + "/v1/images/generations", + "/v1/images/edits" + ] + }, "azure_ai/MAI-Image-2e": { "input_cost_per_token": 5e-06, "litellm_provider": "azure_ai", diff --git a/tests/test_litellm/llms/azure_ai/image_generation/test_mai_image_generation.py b/tests/test_litellm/llms/azure_ai/image_generation/test_mai_image_generation.py index f7ad333293c..34e797c157a 100644 --- a/tests/test_litellm/llms/azure_ai/image_generation/test_mai_image_generation.py +++ b/tests/test_litellm/llms/azure_ai/image_generation/test_mai_image_generation.py @@ -36,11 +36,15 @@ class TestAzureMAIImageGeneration: "azure_ai/MAI-Image-2.5" ) assert AzureFoundryMAIImageGenerationConfig.is_mai_model("MAI-Image-2.5-Flash") + assert AzureFoundryMAIImageGenerationConfig.is_mai_model("MAI-Image-2.5-Pro") + assert AzureFoundryMAIImageGenerationConfig.is_mai_model( + "azure_ai/MAI-Image-2.5-Pro" + ) assert AzureFoundryMAIImageGenerationConfig.is_mai_model("MAI-Image-2e") assert not AzureFoundryMAIImageGenerationConfig.is_mai_model("flux.2-pro") assert not AzureFoundryMAIImageGenerationConfig.is_mai_model("MAI-DS-R1") - def test_mai_flash_and_2e_model_pricing_in_cost_map(self): + def test_mai_flash_pro_and_2e_model_pricing_in_cost_map(self): os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" litellm.model_cost = litellm.get_model_cost_map(url="") @@ -52,6 +56,15 @@ class TestAzureMAIImageGeneration: assert flash_info["input_cost_per_image_token"] == 1.75e-06 assert flash_info["output_cost_per_image_token"] == 3.3e-05 + pro_info = litellm.get_model_info( + model="azure_ai/MAI-Image-2.5-Pro", + custom_llm_provider="azure_ai", + ) + assert pro_info["input_cost_per_token"] == 5e-06 + assert pro_info["input_cost_per_image_token"] == 8e-06 + assert pro_info["output_cost_per_image_token"] == 4.7e-05 + assert pro_info["output_cost_per_image"] == 0.05 + image_2e_info = litellm.get_model_info( model="azure_ai/MAI-Image-2e", custom_llm_provider="azure_ai",