Azure AI Foundry Claude

Use Claude models through Azure AI Foundry with Kern agents.

Use Claude models through Azure AI Foundry. This provides a native Claude integration optimized for Azure AI Foundry infrastructure.

Authentication

Set your ANTHROPIC_FOUNDRY_API_KEY and ANTHROPIC_FOUNDRY_RESOURCE environment variables.

1export ANTHROPIC_FOUNDRY_API_KEY=***
2export ANTHROPIC_FOUNDRY_RESOURCE=***
1setx ANTHROPIC_FOUNDRY_API_KEY ***
2setx ANTHROPIC_FOUNDRY_RESOURCE ***

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:

1from kern.agent import Agent
2from kern.models.azure.claude import Claude
3
4agent = Agent(
5 model=Claude(id="claude-sonnet-4-6"),
6)
7
8# Print the response on the terminal
9agent.print_response("Share a 2 sentence dramatic story.")

You can also use the string syntax:

1agent = Agent(model="azure-foundry-claude:claude-sonnet-4-6")
NoteView more examples here.

Parameters

ParameterTypeDefaultDescription
idstr"claude-sonnet-4-5"The specific Azure Foundry Claude model ID to use
namestr"AzureFoundryClaude"The name identifier for the model
providerstr"AzureFoundry"The provider of the model
resourcestrNoneThe Azure resource name (or set ANTHROPIC_FOUNDRY_RESOURCE)
base_urlstrNoneThe base URL (mutually exclusive with resource)
azure_ad_token_providerCallableNoneAzure AD token provider for authentication
max_retriesintNoneMaximum number of retries for failed requests

Claude (Azure AI Foundry) extends the Anthropic Claude model with Azure AI Foundry integration and has access to most of the same parameters.