Skip to content

Conversation

@ch-robiche
Copy link

@ch-robiche ch-robiche commented Jan 11, 2026

Summary

  • Add Azure Foundry provider for Claude models via Microsoft Azure AI Services
  • Add Azure OpenAI provider for GPT and Codex models via Microsoft Azure

Azure Foundry (Claude models)

  • Uses @ai-sdk/anthropic with Azure baseURL
  • Requires AZURE_FOUNDRY_RESOURCE and AZURE_FOUNDRY_API_KEY
  • Supports prompt caching via wrapFetchWithAnthropicCacheControl

Azure OpenAI (GPT/Codex models)

  • Uses @ai-sdk/azure SDK
  • Requires AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_API_KEY
  • Optional deployment name (defaults to model ID)
  • API routing:
    • GPT models (gpt-5.2): Chat Completions API with 2024-12-01-preview
    • Codex models: Responses API with 2025-04-01-preview

Models added

  • azure-foundry:claude-sonnet-4-20250514
  • azure-openai:gpt-5.2
  • azure-openai:gpt-5.1-codex
  • azure-openai:gpt-5.1-codex-max

Test plan

  • Verify Azure Foundry connects and prompt caching works
  • Verify Azure OpenAI GPT models work via Chat Completions API
  • Verify Azure OpenAI Codex models work via Responses API

Generated with mux • Model: anthropic:claude-opus-4-5-20250514 • Thinking: off • Cost: $0.00

Charles-Henri ROBICHE and others added 2 commits January 11, 2026 20:10
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]>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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]>
@ch-robiche ch-robiche changed the title Feat/azure foundry provider feat: add Azure Foundry and Azure OpenAI provider support Jan 11, 2026
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.

1 participant