azure_openai_env_conflictTier 1 · 70% confidence
ai-agents-azure-openai-env-con-using-azurechatopenai-or-azureopenaiembeddings-wit-3536ee0a
agent: ai_agents
When does this happen?
IF Using AzureChatOpenAI (or AzureOpenAIEmbeddings) with openai>=1.0.0 and having both OPENAI_API_BASE and AZURE_OPENAI_ENDPOINT environment variables set causes a validation error 'base_url and azure_endpoint are mutually exclusive'.
How others solved it
THEN Unset the legacy OPENAI_API_BASE environment variable before using Azure OpenAI with the new openai package. Only set AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_API_KEY. If you previously used OPENAI_API_BASE, remove it from your environment.
# Correct environment setup for Azure OpenAI with openai>=1.0.0 export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/" export AZURE_OPENAI_API_KEY="your-key" # Do NOT set OPENAI_API_BASE or OPENAI_API_KEY
Related patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.