diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 2220d0e1fe5..aedff5da170 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -4123,6 +4123,38 @@ "supports_xhigh_reasoning_effort": true, "supports_minimal_reasoning_effort": false }, + "azure_ai/gpt-image-2": { + "cache_read_input_image_token_cost": 2e-06, + "cache_read_input_token_cost": 1.25e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_image_token": 8e-06, + "litellm_provider": "azure_ai", + "mode": "image_generation", + "output_cost_per_token": 1e-05, + "output_cost_per_image_token": 3e-05, + "supported_endpoints": [ + "/v1/images/generations", + "/v1/images/edits" + ], + "supports_vision": true, + "supports_pdf_input": true + }, + "azure_ai/gpt-image-to-image": { + "cache_read_input_image_token_cost": 2e-06, + "cache_read_input_token_cost": 1.25e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_image_token": 8e-06, + "litellm_provider": "azure_ai", + "mode": "image_generation", + "output_cost_per_token": 1e-05, + "output_cost_per_image_token": 3e-05, + "supported_endpoints": [ + "/v1/images/generations", + "/v1/images/edits" + ], + "supports_vision": true, + "supports_pdf_input": true + }, "azure_ai/model_router": { "deprecation_date": "2027-05-20", "input_cost_per_token": 1.4e-07, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 2220d0e1fe5..aedff5da170 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -4123,6 +4123,38 @@ "supports_xhigh_reasoning_effort": true, "supports_minimal_reasoning_effort": false }, + "azure_ai/gpt-image-2": { + "cache_read_input_image_token_cost": 2e-06, + "cache_read_input_token_cost": 1.25e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_image_token": 8e-06, + "litellm_provider": "azure_ai", + "mode": "image_generation", + "output_cost_per_token": 1e-05, + "output_cost_per_image_token": 3e-05, + "supported_endpoints": [ + "/v1/images/generations", + "/v1/images/edits" + ], + "supports_vision": true, + "supports_pdf_input": true + }, + "azure_ai/gpt-image-to-image": { + "cache_read_input_image_token_cost": 2e-06, + "cache_read_input_token_cost": 1.25e-06, + "input_cost_per_token": 5e-06, + "input_cost_per_image_token": 8e-06, + "litellm_provider": "azure_ai", + "mode": "image_generation", + "output_cost_per_token": 1e-05, + "output_cost_per_image_token": 3e-05, + "supported_endpoints": [ + "/v1/images/generations", + "/v1/images/edits" + ], + "supports_vision": true, + "supports_pdf_input": true + }, "azure_ai/model_router": { "deprecation_date": "2027-05-20", "input_cost_per_token": 1.4e-07, diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index d89496a0fd0..c9b1936a64d 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -4116,6 +4116,37 @@ class TestValidateAndFixThinkingParam: assert validate_and_fix_thinking_param(thinking=False) is None +def test_azure_ai_gpt_image_models_in_cost_map(): + """ + Test that azure_ai/gpt-image-2 and azure_ai/gpt-image-to-image entries + are correctly configured in model_prices_and_context_window.json. + + Prices: + - Text Input: $5/M tokens + - Image Input: $8/M tokens + - Image Output: $30/M tokens + + Closes https://github.com/BerriAI/litellm/issues/26765 + """ + import json + from pathlib import Path + + json_path = Path(__file__).parents[2] / "model_prices_and_context_window.json" + with open(json_path) as f: + model_cost = json.load(f) + + for key in ["azure_ai/gpt-image-2", "azure_ai/gpt-image-to-image"]: + info = model_cost.get(key) + assert info is not None, f"{key} missing from model_prices_and_context_window.json" + assert info["litellm_provider"] == "azure_ai" + assert info["mode"] == "image_generation" + assert info["input_cost_per_token"] == 5e-06 + assert info["input_cost_per_image_token"] == 8e-06 + assert info["output_cost_per_image_token"] == 3e-05 + assert info["cache_read_input_image_token_cost"] == 2e-06 + assert info["supports_vision"] is True + + def test_deepseek_v4_models_in_cost_map(): """ Test that deepseek-v4-flash and deepseek-v4-pro entries are correctly