litellm/tests/test_litellm/llms/azure
Cesar Garcia 57b1d99b44
feat(azure): add support for Azure OpenAI v1 API (#19313)
* feat(azure): add support for Azure OpenAI v1 API

When api_version is 'v1', 'latest', or 'preview', use the standard
OpenAI client instead of AzureOpenAI client with base_url pointing
to /openai/v1/ endpoint.

This follows Microsoft's documentation for the new v1 API format:
https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs

Changes:
- Add OpenAI/AsyncOpenAI imports to common_utils.py and azure.py
- Modify get_azure_openai_client() to detect v1 API versions and
  create appropriate client type
- Update isinstance checks and type hints to accept both client types
- Add unit tests for v1 API client creation

* fix(azure): fix MyPy type errors for v1 API support

- Add type: ignore for AsyncOpenAI constructor
- Update type hints in files/handler.py and batches/handler.py
- Add OpenAI/AsyncOpenAI to Union types for client parameters
- Update isinstance checks to include OpenAI/AsyncOpenAI

* fix(azure): update type hints in files and batches handlers for v1 API

Update async method signatures to accept Union[AsyncAzureOpenAI, AsyncOpenAI]
to fix mypy errors when using v1 API client.
2026-01-19 10:44:38 -08:00
..
chat fix(azure): add logprobs support for Azure OpenAI GPT-5.2 model (#18856) 2026-01-09 22:57:50 +05:30
image_generation Fix: response_format leaking into extra_body 2026-01-09 16:53:35 +05:30
realtime fix: Azure OpenAI GA path relies soley on model paramter as deployment 2025-11-28 14:27:57 +00:00
response [Feat]Add cancel endpoint support for openai and azure (#14561) 2025-09-15 07:08:56 -07:00
text_to_speech [Feat] Add SSML Support for Azure Text-to-Speech (AVA) (#16747) 2025-11-17 15:41:22 -08:00
videos Fix the azure auth format for videos (#17009) 2025-11-24 17:40:55 -08:00
test_azure_common_utils.py feat(azure): add support for Azure OpenAI v1 API (#19313) 2026-01-19 10:44:38 -08:00
test_azure_exception_mapping.py Adds support for returning Azure Content Policy error information when exceptions from Azure OpenAI occur (#16231) 2025-11-08 16:04:36 -08:00