Azure AI Foundry Claude
Use Claude models through Azure AI Foundry with Agno agents.
Use Claude models through Azure AI Foundry. This uses Anthropic's native Messages API instead of the chat completions endpoint that Azure AI Foundry uses for other models.
Installation
uv pip install -U anthropic agnoFirst deploy a Claude model in Azure AI Foundry. Set id to the deployment name; the examples assume a deployment named claude-sonnet-4-6.
Authentication
Set your ANTHROPIC_FOUNDRY_API_KEY and ANTHROPIC_FOUNDRY_RESOURCE environment variables.
export ANTHROPIC_FOUNDRY_API_KEY=***
export ANTHROPIC_FOUNDRY_RESOURCE=***Choose either a resource name or a full base_url, such as https://your-resource.services.ai.azure.com/anthropic/. They are mutually exclusive: clear ANTHROPIC_FOUNDRY_RESOURCE before using an explicit base URL or ANTHROPIC_FOUNDRY_BASE_URL.
Authenticate with an Azure AD token provider instead of an API key by passing azure_ad_token_provider to the Claude constructor.
Example
Use Claude with your Agent:
from agno.agent import Agent
from agno.models.azure.claude import Claude
agent = Agent(
model=Claude(id="claude-sonnet-4-6"),
)
# Print the response on the terminal
agent.print_response("Share a 2 sentence dramatic story.")You can also use the string syntax:
agent = Agent(model="azure-foundry-claude:claude-sonnet-4-6")Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "claude-sonnet-4-5" | The specific Azure Foundry Claude model ID to use |
name | str | "AzureFoundryClaude" | The name identifier for the model |
provider | str | "AzureFoundry" | The provider of the model |
resource | Optional[str] | None | The Azure resource name (or set ANTHROPIC_FOUNDRY_RESOURCE) |
base_url | Optional[str] | None | The base URL, used instead of resource (or set ANTHROPIC_FOUNDRY_BASE_URL) |
azure_ad_token_provider | Optional[Callable] | None | Azure AD token provider for authentication |
max_retries | Optional[int] | None | Maximum number of retries for failed requests |
Claude (Azure AI Foundry) extends Anthropic Claude and runs its thinking-aware initialization, including trailing-user-message handling. It builds Azure requests separately and disables native structured-output and JSON-schema capability flags. Inheriting a parameter does not mean every Anthropic-native feature is enabled on this adapter.