-
Notifications
You must be signed in to change notification settings - Fork 42
feat: add Azure Foundry and Azure OpenAI provider support #1574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add Azure Foundry as a separate provider to support Claude models through Microsoft's AI marketplace. Uses the same @ai-sdk/anthropic package as the direct Anthropic provider with Azure-specific initialization. - Add azure-foundry to provider registry - Support AZURE_FOUNDRY_ENDPOINT and AZURE_FOUNDRY_API_KEY env vars - Add Claude 4.5 model definitions (Opus, Sonnet, Haiku) - Duplicate Anthropic handler with Azure URL handling - Document Azure Foundry setup in providers.mdx - Use Anthropic icon (Claude branding) Azure Foundry provides explicit UX for users accessing Claude via Azure while reusing proven Anthropic SDK and handler logic. No new dependencies required. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add Azure AI Foundry support for accessing Claude models through Microsoft's Azure marketplace using @ai-sdk/anthropic with custom baseURL. Configuration: - Uses `resource` field (just the resource name, not full URL) - Environment variables: AZURE_FOUNDRY_RESOURCE, AZURE_FOUNDRY_API_KEY - Models: claude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5 Changes: - providers.ts: Register azure-foundry provider - providerRequirements.ts: Add resource credential resolution - aiService.ts: Build baseURL from resource name - api.ts: Add resource field to schema - providerService.ts: Return resource in config - ProvidersSection.tsx: Add Resource field in UI - providers.mdx: Update documentation - knownModels.ts: Fix Opus tokenizer (remove incorrect override) Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1466b7d9a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Add Azure OpenAI provider for GPT and Codex models via Microsoft Azure. Configuration: - Requires AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_API_KEY - Optional deployment name (defaults to model ID) - API version auto-selected based on model type API routing: - GPT models (gpt-5.2): Chat Completions API with 2024-12-01-preview - Codex models: Responses API with 2025-04-01-preview (forced) Models added to knownModels: - azure-openai:gpt-5.2 (azure-gpt) - azure-openai:gpt-5.1-codex (azure-codex) - azure-openai:gpt-5.1-codex-max (azure-codex-max) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary
Azure Foundry (Claude models)
@ai-sdk/anthropicwith Azure baseURLAZURE_FOUNDRY_RESOURCEandAZURE_FOUNDRY_API_KEYwrapFetchWithAnthropicCacheControlAzure OpenAI (GPT/Codex models)
@ai-sdk/azureSDKAZURE_OPENAI_ENDPOINTandAZURE_OPENAI_API_KEYModels added
azure-foundry:claude-sonnet-4-20250514azure-openai:gpt-5.2azure-openai:gpt-5.1-codexazure-openai:gpt-5.1-codex-maxTest plan
Generated with
mux• Model:anthropic:claude-opus-4-5-20250514• Thinking:off• Cost:$0.00