-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Problem (one or two sentences)
Problem
It’s currently impossible to use an Anthropic model hosted on Azure Foundry in Roo Code with the OpenAI Compatible provider. Requests fail with a 401 error.
Two issues cause the failure:
-
The
_isAzureAiInferenceheuristic triggers because the Azure Anthropic endpoint follows the pattern
https://{resource}-resource.services.ai.azure.com/anthropic/v1/messages.
When this detection activates, Roo Code appendsOPENAI_AZURE_AI_INFERENCE_PATH(models/chat/completions) to the URL.
This results in a final request path like:
/anthropic/v1/messages/models/chat/completions, which is invalid for Azure Anthropic. -
The API key is sent using the
Authorization: Bearerheader, but Azure Anthropic requires the key in thex-api-keyheader.
This also triggers a 401.
Expected behavior
Roo Code should:
- Avoid applying
_isAzureAiInferencelogic to Anthropic endpoints on Azure. - Use
x-api-keyfor authentication when targeting Azure Anthropic. - Keep the correct path
/anthropic/v1/messageswithout appending OpenAI-style routes.
Proposed solution
- Add an exception in
_isAzureAiInferenceso Anthropic URLs are not modified. - Detect Azure Anthropic endpoints and automatically switch to
x-api-keyinstead of the Authorization header. - Avoid appending
models/chat/completionswhen the path already contains a valid Anthropic route.
Context (who is affected and when)
Impact
Any attempt to use Anthropic models deployed through Azure Foundry with the OpenAI Compatible provider fails.
This blocks the ability to use the newly announced Microsoft × Anthropic integration.
Reproduction steps
Steps to reproduce
- Create an Anthropic resource on Azure Foundry.
- Use its endpoint in Roo Code under the OpenAI Compatible provider:
https://{resource}-resource.services.ai.azure.com/anthropic/v1/messages - Trigger a request.
- Observe the 401 error.
Expected result
The model starts working
Actual result
401 error
Variations tried (optional)
No response
App Version
last
API Provider (optional)
OpenAI Compatible
Model Used (optional)
claude-sonnet-4-5
Roo Code Task Links (optional)
No response
Relevant logs or errors (optional)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status