Installation
Environment Setup
Azure OpenAI requires three environment variables:Quick Start
Azure deployments use theazure/ prefix followed by your deployment name:
Common Deployment Patterns
The exact name depends on what you named your deployment in Azure.
Tool Use
Tools work the same as on OpenAI directly:Streaming
Multiple Deployments
Many organizations create separate deployments for different workloads (e.g., one with a 50K TPM quota for production, one with 5K TPM for dev). Swarms can target any of them by deployment name:Private Networking
If your Azure OpenAI resource is behind a private endpoint, setAZURE_API_BASE to the internal URL and ensure your runtime has network access:
Multi-Agent Pipeline
The same composition patterns work on Azure:Production Defaults
Troubleshooting
InvalidRequestError: Resource not found — your model_name doesn’t match a deployment in your Azure resource. Check the Deployments tab in Azure AI Foundry.
AuthenticationError — your AZURE_API_KEY, AZURE_API_BASE, or AZURE_API_VERSION is missing or wrong. All three are required.
Rate-limit errors — Azure deployments have hard TPM/RPM quotas set in the portal. Request a quota increase or split traffic across multiple deployments.
Next Steps
- Building Agents with OpenAI — direct OpenAI alternative
- Model Providers Overview
- Production Best Practices