fix(azure): add model router flat fee to azure provider cost tracking (#44876)

* fix(azure): add model router flat fee to azure provider cost tracking

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(azure): price the azure router fee from one canonical entry

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(azure): reuse the azure_ai model router fee path for azure

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(azure): drop model router fee unit tests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-10-06 10:47:26 -07:00 • committed by GitHub
parent 096b20b6db
commit e2c55daaaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -278,7 +278,7 @@ def _get_additional_costs(
try:
config_class = None
if custom_llm_provider == "azure_ai":
if custom_llm_provider in ("azure_ai", "azure"):
from litellm.llms.azure_ai.common_utils import AzureFoundryModelInfo
config_class = AzureFoundryModelInfo.get_azure_ai_config_for_model(model)
@ -1818,7 +1818,7 @@ def completion_cost(
)
# Get additional costs from provider (e.g., routing fees, infrastructure costs)
if custom_llm_provider == "azure_ai" and not azure_ai_is_model_router_name(model):
if custom_llm_provider in ("azure_ai", "azure") and not azure_ai_is_model_router_name(model):
model_for_additional_costs = request_model_for_cost
if completion_response is not None:
hidden_params = getattr(completion_response, "_hidden_params", None) or {}