diff --git a/litellm/llms/azure/common_utils.py b/litellm/llms/azure/common_utils.py index b88b6985a98..3f1785d885c 100644 --- a/litellm/llms/azure/common_utils.py +++ b/litellm/llms/azure/common_utils.py @@ -665,10 +665,6 @@ class BaseAzureLLM(BaseOpenAILLM): ) -> dict: litellm_params = litellm_params or GenericLiteLLMParams() - # If api-key is already in headers, preserve it - if "api-key" in headers: - return headers - api_key = ( litellm_params.api_key or litellm.api_key diff --git a/litellm/llms/azure/passthrough/transformation.py b/litellm/llms/azure/passthrough/transformation.py index b6fed6b4470..4e9de4b314f 100644 --- a/litellm/llms/azure/passthrough/transformation.py +++ b/litellm/llms/azure/passthrough/transformation.py @@ -58,7 +58,9 @@ class AzurePassthroughConfig(BasePassthroughConfig): ) -> dict: return BaseAzureLLM._base_validate_azure_environment( headers=headers, - litellm_params=GenericLiteLLMParams(**litellm_params), + litellm_params=GenericLiteLLMParams( + **{**litellm_params, "api_key": api_key} + ), ) @staticmethod diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yaml index 0882a9298aa..fad6ad336a8 100644 --- a/litellm/proxy/_new_secret_config.yaml +++ b/litellm/proxy/_new_secret_config.yaml @@ -20,7 +20,7 @@ model_list: model: azure/gpt-4.1 api_base: os.environ/AZURE_API_BASE_ALT api_version: "2023-05-15" - api_key: os.environ/AZURE_API_KEY_HIDDEN + api_key: os.environ/AZURE_API_KEY_ALT # mcp_servers: # github_mcp: