diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index b49d97dc4e3..47a9d99e180 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -2089,6 +2089,38 @@ "supports_response_schema": true, "supports_tool_choice": true }, + "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": { "input_cost_per_token": 1.4e-07, "output_cost_per_token": 0, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 76dcfc55c10..2a6e4c4ac34 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -2103,6 +2103,38 @@ "supports_response_schema": true, "supports_tool_choice": true }, + "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": { "input_cost_per_token": 1.4e-07, "output_cost_per_token": 0, diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index f28fe3ed258..a0e876ba7bc 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -3983,3 +3983,34 @@ class TestValidateAndFixThinkingParam: validate_and_fix_thinking_param(thinking=thinking) assert "budgetTokens" in thinking assert "budget_tokens" not in thinking + + +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