-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Before submitting your bug report
- I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- I'm not able to find a related conversation on GitHub discussions that reports the same bug
- I'm not able to find an open issue that reports the same bug
- I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS:
- Continue version:
- IDE version:
- Model:
- config:
OR link to agent in Continue hub:Description
Problem
Continue does not support Azure AI Foundry-hosted Anthropic models (Claude Opus 4.5, Haiku 4.5, etc.), even though these are now available in EU regions and represent an important deployment option for enterprise customers requiring GDPR compliance and data residency.
Current Behavior
When configuring an Azure-hosted Anthropic endpoint:
models:
- provider: anthropic
model: claude-opus-4-5
apiBase: https://my-resource.services.ai.azure.com/anthropic
apiKey: <AZURE_API_KEY>Result:
- ❌ 401 Unauthorized Error
- Misleading error message: "forgot to add '/v1' to apiBase"
Root Cause
Azure AI Foundry uses the native Anthropic Messages API format but with a different authentication header:
| Provider | Auth Header | Value |
|---|---|---|
| Anthropic Direct | x-api-key |
Anthropic API Key |
| Azure-hosted Anthropic | api-key |
Azure API Key |
Continue's Anthropic provider always sends x-api-key, which Azure rejects.
Expected Behavior
Continue should automatically detect Azure endpoints and use the correct authentication header:
// Detection logic
const isAzureEndpoint = apiBase?.toLowerCase().includes('.services.ai.azure.com') ||
apiBase?.toLowerCase().includes('.cognitiveservices.azure.com');
const authHeader = isAzureEndpoint ? 'api-key' : 'x-api-key';Proposed Solution
Extend the Anthropic provider to detect Azure endpoints and adjust the authentication header accordingly. This requires minimal changes:
-
packages/openai-adapters/src/apis/AnthropicUtils.ts- Add Azure endpoint detection function
- Modify
getAnthropicHeaders()to acceptapiBaseparameter - Use conditional header name based on endpoint
-
packages/openai-adapters/src/apis/Anthropic.ts- Pass
apiBasetogetAnthropicHeaders()
- Pass
-
core/llm/llms/Anthropic.ts- Pass
apiBasetogetAnthropicHeaders()
- Pass
Why This Matters
- GDPR Compliance: EU customers can use Claude models while keeping data in EU regions
- Enterprise Requirements: Many organizations require Azure-based deployments
- Unified Billing: Anthropic usage through Azure subscription
- Data Residency: Regional deployments for compliance
Additional Context
- Azure AI Foundry Anthropic API uses the same request/response format as standard Anthropic
- Only the authentication header differs
- All Anthropic features (streaming, caching, tools) work identically
- Continue's existing retry logic handles Azure rate limits (HTTP 429 + Retry-After)
Workarounds
None available. Users cannot currently use Azure-hosted Anthropic models with Continue.
Environment
- Continue Version: [latest]
- IDE: VS Code / JetBrains
- Azure AI Foundry: Claude Opus 4.5, Claude Haiku 4.5
References
I'm willing to contribute a PR for this if the approach is acceptable.
To reproduce
No response
Log output
Metadata
Metadata
Assignees
Labels
Type
Projects
Status