Skip to content

docs: add Azure AI Foundry documentation for Claude models - #17104

Merged
ishaan-jaff merged 2 commits into
BerriAI:mainfrom
Chesars:docs/azure-ai-foundry-claude
Dec 2, 2025
Merged

docs: add Azure AI Foundry documentation for Claude models#17104
ishaan-jaff merged 2 commits into
BerriAI:mainfrom
Chesars:docs/azure-ai-foundry-claude

Conversation

@Chesars

@Chesars Chesars commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Title

docs: add Azure AI Foundry documentation for Claude models

Relevant issues

Fixes #17066

Type

📖 Documentation

Changes

Add documentation for using Claude models (Sonnet 4.5, Haiku 4.5, Opus 4.1) deployed on Azure AI Foundry.

Azure exposes Claude using Anthropic's native /v1/messages API, so users can use the existing anthropic/ provider with their Azure endpoint - no changes to model pricing or new provider needed.

Documentation includes:

  • LiteLLM SDK usage example
  • Environment variables configuration
  • LiteLLM Proxy config.yaml example
  • Instructions for finding Azure endpoint

@vercel

vercel Bot commented Nov 25, 2025

Copy link
Copy Markdown

@Chesars is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread docs/my-website/docs/providers/anthropic.md Outdated
Add documentation explaining how to use Claude models (Sonnet 4.5,
Haiku 4.5, Opus 4.1) deployed on Azure AI Foundry with LiteLLM.

Azure exposes Claude using Anthropic's native API, so users can use
the existing anthropic/ provider with their Azure endpoint.

Closes BerriAI#17066
…ovider

Document that users can use anthropic/ provider with Azure endpoint
as an alternative to the dedicated azure_ai/ provider.
@Chesars
Chesars force-pushed the docs/azure-ai-foundry-claude branch from d4547a9 to a6ecc48 Compare November 28, 2025 22:00
@jasverma-hub

Copy link
Copy Markdown

Is this task completed or still pending? I'm trying to add the Claude model deployed on Azure AI Foundry, but it's not working for me. I've followed the documentation and added everything, yet it still doesn't work.

@Chesars

Chesars commented Dec 1, 2025

Copy link
Copy Markdown
Contributor Author

Hi @jasverma-hub. This PR adds in the documentation an alternative method to use Anthropic models deployed in Azure, since the Azure API with Anthropic models is almost the same as the direct Anthropic API. In this PR #17202 the integration for azure with Anthropic models was added as a built-in method to use it like model=f"azure_ai/{deployment_name}", and adding to .env AZURE_AI_API_BASE and AZURE_AI_API_KEY . Are you getting any error messages from LiteLLM?

@jasverma-hub

jasverma-hub commented Dec 2, 2025

Copy link
Copy Markdown

Hi @jasverma-hub. This PR adds in the documentation an alternative method to use Anthropic models deployed in Azure, since the Azure API with Anthropic models is almost the same as the direct Anthropic API. In this PR #17202 the integration for azure with Anthropic models was added as a built-in method to use it like model=f"azure_ai/{deployment_name}", and adding to .env AZURE_AI_API_BASE and AZURE_AI_API_KEY . Are you getting any error messages from LiteLLM?

I’ve tried adding the Claude models through both the config.yaml and the LiteLLM UI, but I’m still getting the same routing error. I’m already running the latest LiteLLM version.

This is how I currently have the models defined in my config:

  • model_name: claude-sonnet-4-5
    litellm_params:
    model: azure_ai/claude-sonnet-4-5
    api_base: https://######.services.ai.azure.com/anthropic
    api_key: os.environ/OPENAI_API_KEY

  • model_name: claude-opus-4-1
    litellm_params:
    model: azure_ai/claude-opus-4-1
    api_base: https://######.services.ai.azure.com/anthropic
    api_key: os.environ/OPENAI_API_KEY

  • model_name: claude-opus-4-5
    litellm_params:
    model: azure_ai/claude-opus-4-5
    api_base: https://######.services.ai.azure.com/anthropic
    api_key: os.environ/OPENAI_API_KEY

image

@ishaan-jaff
ishaan-jaff merged commit 81f4d86 into BerriAI:main Dec 2, 2025
4 of 6 checks passed
@Chesars
Chesars deleted the docs/azure-ai-foundry-claude branch December 2, 2025 17:39
@Chesars

Chesars commented Dec 2, 2025

Copy link
Copy Markdown
Contributor Author

Hi @jasverma-hub. This PR adds in the documentation an alternative method to use Anthropic models deployed in Azure, since the Azure API with Anthropic models is almost the same as the direct Anthropic API. In this PR #17202 the integration for azure with Anthropic models was added as a built-in method to use it like model=f"azure_ai/{deployment_name}", and adding to .env AZURE_AI_API_BASE and AZURE_AI_API_KEY . Are you getting any error messages from LiteLLM?

I’ve tried adding the Claude models through both the config.yaml and the LiteLLM UI, but I’m still getting the same routing error. I’m already running the latest LiteLLM version.

This is how I currently have the models defined in my config:

  • model_name: claude-sonnet-4-5

    litellm_params:

    model: azure_ai/claude-sonnet-4-5
    
    api_base: https://######.services.ai.azure.com/anthropic
    
    api_key: os.environ/OPENAI_API_KEY
    
  • model_name: claude-opus-4-1

    litellm_params:

    model: azure_ai/claude-opus-4-1
    
    api_base: https://######.services.ai.azure.com/anthropic
    
    api_key: os.environ/OPENAI_API_KEY
    
  • model_name: claude-opus-4-5

    litellm_params:

    model: azure_ai/claude-opus-4-5
    
    api_base: https://######.services.ai.azure.com/anthropic
    
    api_key: os.environ/OPENAI_API_KEY
    
image

The feature for model=azure_ai/claude-sonnet-4-5 should be available in the next release.

@jasverma-hub

Copy link
Copy Markdown

Hi @jasverma-hub. This PR adds in the documentation an alternative method to use Anthropic models deployed in Azure, since the Azure API with Anthropic models is almost the same as the direct Anthropic API. In this PR #17202 the integration for azure with Anthropic models was added as a built-in method to use it like model=f"azure_ai/{deployment_name}", and adding to .env AZURE_AI_API_BASE and AZURE_AI_API_KEY . Are you getting any error messages from LiteLLM?

I’ve tried adding the Claude models through both the config.yaml and the LiteLLM UI, but I’m still getting the same routing error. I’m already running the latest LiteLLM version.
This is how I currently have the models defined in my config:

  • model_name: claude-sonnet-4-5
    litellm_params:
    model: azure_ai/claude-sonnet-4-5
    
    api_base: https://######.services.ai.azure.com/anthropic
    
    api_key: os.environ/OPENAI_API_KEY
    
  • model_name: claude-opus-4-1
    litellm_params:
    model: azure_ai/claude-opus-4-1
    
    api_base: https://######.services.ai.azure.com/anthropic
    
    api_key: os.environ/OPENAI_API_KEY
    
  • model_name: claude-opus-4-5
    litellm_params:
    model: azure_ai/claude-opus-4-5
    
    api_base: https://######.services.ai.azure.com/anthropic
    
    api_key: os.environ/OPENAI_API_KEY
    
image

The feature for model=azure_ai/claude-sonnet-4-5 should be available in the next release.

Hi @jasverma-hub. This PR adds in the documentation an alternative method to use Anthropic models deployed in Azure, since the Azure API with Anthropic models is almost the same as the direct Anthropic API. In this PR #17202 the integration for azure with Anthropic models was added as a built-in method to use it like model=f"azure_ai/{deployment_name}", and adding to .env AZURE_AI_API_BASE and AZURE_AI_API_KEY . Are you getting any error messages from LiteLLM?

How can I add this to the config.yaml? Will it work if I follow the instructions in the Anthropic documentation on LiteLLM?

@Chesars

Chesars commented Dec 2, 2025

Copy link
Copy Markdown
Contributor Author

Yes, it will work when the updated package comes out in a release.

@jasverma-hub

Copy link
Copy Markdown

I have connected my LiteLLM to OpenWebUI, and I need to use the Claude models. Therefore, I will have to wait until the updated packages are released, as there are no other options available, right?

@Chesars

Chesars commented Dec 2, 2025

Copy link
Copy Markdown
Contributor Author

The other option is to use the alternative method documented in this PR. https://github.com/BerriAI/litellm/pull/17104/files.

@jasverma-hub

jasverma-hub commented Dec 2, 2025

Copy link
Copy Markdown

I tried this, but I'm still encountering this error:
azureuser@openwebui-vm:/opt/docker/litellm$ sudo nano test_anthropic.py
azureuser@openwebui-vm:/opt/docker/litellm$ python3 test_anthropic.py

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm._turn_on_debug()'.

Traceback (most recent call last):
File "/opt/docker/litellm/litellm/llms/anthropic/chat/handler.py", line 440, in completion
response = client.post(
File "/opt/docker/litellm/litellm/llms/custom_httpx/http_handler.py", line 707, in post
raise e
File "/opt/docker/litellm/litellm/llms/custom_httpx/http_handler.py", line 689, in post
response.raise_for_status()
File "/usr/local/lib/python3.10/dist-packages/httpx/_models.py", line 829, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 PermissionDenied' for url 'https:####'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/docker/litellm/litellm/main.py", line 2051, in completion
response = anthropic_chat_completions.completion(
File "/opt/docker/litellm/litellm/llms/anthropic/chat/handler.py", line 455, in completion
raise AnthropicError(
litellm.llms.anthropic.common_utils.AnthropicError: {"error":{"code":"401","message":"Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/docker/litellm/test_anthropic.py", line 3, in
response = completion(
File "/opt/docker/litellm/litellm/utils.py", line 1285, in wrapper
raise e
File "/opt/docker/litellm/litellm/utils.py", line 1163, in wrapper
result = original_function(*args, **kwargs)
File "/opt/docker/litellm/litellm/main.py", line 3305, in completion
raise exception_type(
File "/opt/docker/litellm/litellm/litellm_core_utils/exception_mapping_utils.py", line 2271, in exception_type
raise e
File "/opt/docker/litellm/litellm/litellm_core_utils/exception_mapping_utils.py", line 571, in exception_type
raise AuthenticationError(
litellm.exceptions.AuthenticationError: litellm.AuthenticationError: AnthropicException - {"error":{"code":"401","message":"Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."}}
azureuser@openwebui-vm:/opt/docker/litellm$

I am using the exact API BASE and API KEY from Azure still encountering this.

@Chesars

Chesars commented Dec 2, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for reporting it, we'll look into that. So yes, we'll have to wait for the next release.

@jasverma-hub

Copy link
Copy Markdown

Okay, fine. One last thing: is the problem with Claude models or Claude models hosted by Azure?

fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…7104)

* docs: add Azure AI Foundry documentation for Claude models

Add documentation explaining how to use Claude models (Sonnet 4.5,
Haiku 4.5, Opus 4.1) deployed on Azure AI Foundry with LiteLLM.

Azure exposes Claude using Anthropic's native API, so users can use
the existing anthropic/ provider with their Azure endpoint.

Closes BerriAI#17066

* docs: Add alternative method for Azure AI Foundry using anthropic/ provider

Document that users can use anthropic/ provider with Azure endpoint
as an alternative to the dedicated azure_ai/ provider.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: claude-sonnet-4-5 model under azure_ai

3 participants