feat: add Azure Anthropic (Claude) provider support#190
Merged
leonvanzyl merged 1 commit intoAutoForgeAI:masterfrom Feb 11, 2026
Merged
feat: add Azure Anthropic (Claude) provider support#190leonvanzyl merged 1 commit intoAutoForgeAI:masterfrom
leonvanzyl merged 1 commit intoAutoForgeAI:masterfrom
Conversation
- Add "Azure Anthropic (Claude)" to API_PROVIDERS in registry.py with ANTHROPIC_API_KEY auth (required for Claude CLI to route through custom base URL instead of default Anthropic endpoint) - Add Azure env var template to .env.example - Show Base URL input field for Azure provider in Settings UI with "Configured" state and Azure-specific placeholder - Widen Settings modal for better readability with long URLs - Add Azure endpoint detection and "Azure Mode" log label - Rename misleading "GLM Mode" fallback label to "Alternative API" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Background
Azure AI Services hosts Claude models at custom endpoints (
https://{resource}.services.ai.azure.com/anthropic). Unlike other alternative providers (GLM, Ollama, Kimi) which have fixed base URLs, each Azure customer has a unique resource-specific endpoint.A key discovery during implementation: the Claude Code CLI ignores
ANTHROPIC_BASE_URLwhenANTHROPIC_AUTH_TOKENis set, as it falls back to its own subscription authentication. The fix is to useANTHROPIC_API_KEYinstead, which forces the CLI into API key authentication mode and properly respects the custom base URL.Changes
Backend
registry.py"azure"entry toAPI_PROVIDERSwithauth_env_var: "ANTHROPIC_API_KEY"(critical for correct routing), emptybase_url(user must provide their own), and Claude model options (Opus, Sonnet, Haiku)client.pyservices.ai.azure.comin base URL) with proper "Azure Mode" log labelFrontend
ui/src/components/SettingsModal.tsxhttps://your-resource.services.ai.azure.com/anthropic)max-w-sm(384px) tomax-w-lg(512px) for better readability with longer URLsConfiguration
.env.exampleANTHROPIC_API_KEY(notANTHROPIC_AUTH_TOKEN)Key Technical Details
Why
ANTHROPIC_API_KEYinstead ofANTHROPIC_AUTH_TOKEN?Testing revealed that the Claude Code CLI behaves differently depending on the auth env var:
ANTHROPIC_AUTH_TOKENANTHROPIC_BASE_URLANTHROPIC_API_KEYANTHROPIC_BASE_URLThis means Azure (and any custom endpoint) must use
ANTHROPIC_API_KEYto ensure requests are routed to the correct endpoint.How to Use
Via Settings UI (recommended)
,key)https://myresource.services.ai.azure.com/anthropic)Via
.envfile