in agent python, i want to use antrhopic sonnet mo...
# ask-ai
s
in agent python, i want to use antrhopic sonnet model but from azure ai foundry, what should be the key in env for that and the agent config in the code for it
t
Thanks for reaching out, Mostafa. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking how to point a LiveKit Python agent at Anthropic’s Sonnet model when that model is served through Azure AI Foundry: which environment variable key to set and what the agent config should look like. I checked the LiveKit agent docs and the Anthropic plugin docs. LiveKit documents: • direct Anthropic access using
ANTHROPIC_API_KEY
, and • Azure OpenAI access using
AZURE_OPENAI_API_KEY
/
AZURE_OPENAI_ENDPOINT
and related Azure keys. However, LiveKit’s docs do not show how to access Anthropic models that are hosted via Azure AI Foundry, and there is no documented environment variable name or agent config for “Anthropic Sonnet via Azure AI Foundry.” What I can do to help next • If you can share how Azure AI Foundry exposes Anthropic Sonnet to clients (for example: does it present an OpenAI-compatible endpoint, an Azure-specific endpoint+key, or a custom Anthropic-compatible endpoint?), I can map that to the correct environment variable and agent config pattern used by LiveKit agents. • If you can paste a sample of the Azure Foundry endpoint URL/credential format (or describe whether it expects an API key, Azure-style key + endpoint, or a token), I’ll provide the exact env var name and the Python agent config you should use. Guidance based on the two documented patterns in LiveKit • If Azure Foundry exposes the model via an OpenAI-compatible API / OpenAI-like endpoint, use the Azure OpenAI style config (endpoint + key) and the LiveKit Azure plugin configuration. • If Azure Foundry gives you a direct Anthropic-style API key and endpoint, use
ANTHROPIC_API_KEY
and the Anthropic plugin config. Please share one of these details so I can give a precise env var and the exact Python agent config snippet: 1. The form of the endpoint you got from Azure AI Foundry (example URL or whether it’s OpenAI-compatible). 2. The credential type you were given (single API key, Azure key+endpoint, or an OAuth/token). Once you send that, I’ll provide the exact env var name and a ready-to-drop-in Python agent config. Sources: Anthropic Claude LLM plugin guide | LiveKit Documentation | Azure OpenAI LLM plugin guide | LiveKit Documentation | Azure OpenAI STT plugin guide | LiveKit Documentation | Azure Speech STT plugin guide | LiveKit Documentation