|
| 1 | +--- |
| 2 | +title: Azure OpenAI |
| 3 | +subtitle: Use custom Azure OpenAI instances with your own rate limits and configurations |
| 4 | +slug: providers/model/azure-openai |
| 5 | +--- |
| 6 | + |
| 7 | +**What is Azure OpenAI?** |
| 8 | + |
| 9 | +Azure OpenAI Service provides REST API access to OpenAI's powerful language models, including GPT-4.1, GPT-4o, GPT-4 Turbo, GPT-3.5 Turbo, and the Embeddings model series. These models can be easily adapted to your specific task with fine-tuning, offering enterprise-grade security, responsible AI practices, and regional availability. |
| 10 | + |
| 11 | +**Custom Azure OpenAI Integration with Vapi:** |
| 12 | + |
| 13 | +With Vapi's Azure OpenAI integration, you can connect your own Azure OpenAI instances to leverage your custom rate limits, regional deployments, and specific configurations. This enables you to use your Azure OpenAI resources directly while maintaining full control over billing, usage limits, and data residency. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +Before configuring Azure OpenAI with Vapi, ensure you have: |
| 18 | + |
| 19 | +- An active Azure subscription |
| 20 | +- Azure OpenAI Service resource deployed |
| 21 | +- Model deployments configured in your Azure OpenAI instance |
| 22 | +- API keys and endpoint information from your Azure OpenAI resource |
| 23 | + |
| 24 | +## Credential Settings |
| 25 | + |
| 26 | +You can configure your Azure OpenAI credentials in the "Model Providers" section of the "Provider Credentials" page in the Vapi dashboard. |
| 27 | + |
| 28 | +| Setting | Description | Required | |
| 29 | +|---------|-------------|----------| |
| 30 | +| **Provider** | Select "Azure OpenAI" | ✅ | |
| 31 | +| **Models** | List of model deployment names (must match Vapi's supported models) | ✅ | |
| 32 | +| **Region** | Azure region where your OpenAI resource is deployed | ✅ | |
| 33 | +| **OpenAI Endpoint** | Base Azure OpenAI endpoint URL (e.g., `https://your-resource.openai.azure.com`) | ✅ | |
| 34 | +| **OpenAI Key** | API key for your Azure OpenAI resource | ✅ | |
| 35 | +| **OCP-APIM-Subscription-Key** | API Management subscription key (optional - can be left blank) | ❌ | |
| 36 | + |
| 37 | +## Important Configuration Notes |
| 38 | + |
| 39 | +### Model and Deployment Names |
| 40 | + |
| 41 | +<Warning> |
| 42 | +**Critical Requirement**: Your Azure deployment name **must exactly match** one of Vapi's supported model names. Custom deployment names are not supported. |
| 43 | +</Warning> |
| 44 | + |
| 45 | +For example, if you want to use GPT-4o, your Azure deployment must be named exactly `gpt-4o-2024-11-20` (or another supported variant), not a custom name like `my-custom-gpt4`. |
| 46 | + |
| 47 | +### Supported Models |
| 48 | + |
| 49 | +Vapi supports these Azure OpenAI models (ensure your deployment names match exactly): |
| 50 | + |
| 51 | +**Latest GPT-4.1 Models:** |
| 52 | +- `gpt-4.1-2025-04-14` |
| 53 | +- `gpt-4.1-mini-2025-04-14` |
| 54 | +- `gpt-4.1-nano-2025-04-14` |
| 55 | + |
| 56 | +**GPT-4o Models:** |
| 57 | +- `gpt-4o-2024-11-20` |
| 58 | +- `gpt-4o-2024-08-06` |
| 59 | +- `gpt-4o-2024-05-13` |
| 60 | +- `gpt-4o-mini-2024-07-18` |
| 61 | + |
| 62 | +**GPT-4 Models:** |
| 63 | +- `gpt-4-turbo-2024-04-09` |
| 64 | +- `gpt-4-0125-preview` |
| 65 | +- `gpt-4-1106-preview` |
| 66 | +- `gpt-4-0613` |
| 67 | + |
| 68 | +**GPT-3.5 Models:** |
| 69 | +- `gpt-35-turbo-0125` |
| 70 | +- `gpt-35-turbo-1106` |
| 71 | + |
| 72 | +### Supported Regions |
| 73 | + |
| 74 | +Vapi supports these Azure regions for OpenAI deployments: |
| 75 | + |
| 76 | +- `australia` (Australia East) |
| 77 | +- `canadaeast` (Canada East) |
| 78 | +- `canadacentral` (Canada Central) |
| 79 | +- `eastus` (East US) |
| 80 | +- `eastus2` (East US 2) |
| 81 | +- `france` (France Central) |
| 82 | +- `india` (Central India) |
| 83 | +- `japaneast` (Japan East) |
| 84 | +- `japanwest` (Japan West) |
| 85 | +- `northcentralus` (North Central US) |
| 86 | +- `norway` (Norway East) |
| 87 | +- `southcentralus` (South Central US) |
| 88 | +- `swedencentral` (Sweden Central) |
| 89 | +- `switzerland` (Switzerland North) |
| 90 | +- `uaenorth` (UAE North) |
| 91 | +- `uk` (UK South) |
| 92 | +- `westus` (West US) |
| 93 | +- `westus3` (West US 3) |
| 94 | + |
| 95 | +<Note> |
| 96 | +Choose the region closest to your users for optimal performance, or use a specific region for data residency compliance. |
| 97 | +</Note> |
| 98 | + |
| 99 | +### Endpoint URL Format |
| 100 | + |
| 101 | +<Tip> |
| 102 | +Use only the **base endpoint URL** from your Azure OpenAI resource, not the full completions URL. |
| 103 | +</Tip> |
| 104 | + |
| 105 | +**Correct format:** |
| 106 | +``` |
| 107 | +https://your-resource-name.openai.azure.com |
| 108 | +``` |
| 109 | + |
| 110 | +**Incorrect format:** |
| 111 | +``` |
| 112 | +https://your-resource-name.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-11-20 |
| 113 | +``` |
| 114 | + |
| 115 | +### API Management Subscription Key |
| 116 | + |
| 117 | +The `OCP-APIM-Subscription-Key` field is optional and can be left blank in most configurations. Only include this if your Azure OpenAI resource is behind Azure API Management and specifically requires this header. |
| 118 | + |
| 119 | +## Configuration Steps |
| 120 | + |
| 121 | +<Steps> |
| 122 | + <Step title="Gather Azure OpenAI Details"> |
| 123 | + From your Azure OpenAI resource in the Azure portal, collect: |
| 124 | + - Base endpoint URL |
| 125 | + - API key (from Keys and Endpoint section) |
| 126 | + - Deployment names |
| 127 | + - Region |
| 128 | + </Step> |
| 129 | + |
| 130 | + <Step title="Verify Deployment Names"> |
| 131 | + Ensure your model deployments use names that exactly match Vapi's supported model list. If needed, create new deployments with the correct names. |
| 132 | + </Step> |
| 133 | + |
| 134 | + <Step title="Configure in Vapi Dashboard"> |
| 135 | + Navigate to Settings → Integrations → Provider Credentials → Model Providers and add your Azure OpenAI configuration. |
| 136 | + </Step> |
| 137 | + |
| 138 | + <Step title="Test Configuration"> |
| 139 | + Create a test assistant using your Azure OpenAI model to verify the connection works correctly. |
| 140 | + </Step> |
| 141 | +</Steps> |
| 142 | + |
| 143 | +## Example Configuration |
| 144 | + |
| 145 | +```json |
| 146 | +{ |
| 147 | + "provider": "azure-openai", |
| 148 | + "models": ["gpt-4o-2024-11-20"], |
| 149 | + "region": "eastus", |
| 150 | + "openAIEndpoint": "https://your-resource.openai.azure.com", |
| 151 | + "openAIKey": "your-azure-openai-api-key", |
| 152 | + "ocpApimSubscriptionKey": "" |
| 153 | +} |
| 154 | +``` |
| 155 | + |
| 156 | +## Benefits of Using Azure OpenAI |
| 157 | + |
| 158 | +**Enterprise Security:** |
| 159 | +- Data residency control with regional deployments |
| 160 | +- Enterprise-grade security and compliance (SOC 2, ISO 27001, etc.) |
| 161 | +- Private network connectivity options |
| 162 | + |
| 163 | +**Custom Rate Limits:** |
| 164 | +- Use your own Azure OpenAI quota and rate limits |
| 165 | +- Avoid shared resource constraints |
| 166 | +- Predictable costs and billing through Azure |
| 167 | + |
| 168 | +**Advanced Features:** |
| 169 | +- Support for fine-tuned models |
| 170 | +- Content filtering and safety controls |
| 171 | +- Integration with Azure monitoring and logging |
| 172 | + |
| 173 | +## Troubleshooting |
| 174 | + |
| 175 | +### Common Error: "Resource not found" |
| 176 | +- **Cause**: Incorrect endpoint URL or model deployment name |
| 177 | +- **Solution**: Verify the endpoint URL format and ensure deployment names match exactly |
| 178 | + |
| 179 | +### Common Error: "No model specified in request" |
| 180 | +- **Cause**: Deployment name doesn't match the selected model in Vapi |
| 181 | +- **Solution**: Create a deployment with the exact model name as expected by Vapi |
| 182 | + |
| 183 | +### Common Error: "Couldn't Validate Azure OpenAI Credential" |
| 184 | +- **Cause**: Invalid API key, incorrect endpoint, or network restrictions |
| 185 | +- **Solution**: Verify API key, check endpoint URL format, and ensure network access |
| 186 | + |
| 187 | +<Note> |
| 188 | +For additional support with Azure OpenAI configuration, consult the [Azure OpenAI documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/openai/) or contact Vapi support. |
| 189 | +</Note> |
| 190 | + |
| 191 | +## Next Steps |
| 192 | + |
| 193 | +After configuring Azure OpenAI: |
| 194 | + |
| 195 | +- **[Create an Assistant](mdc:docs/assistants)**: Build your first voice assistant using your Azure OpenAI models |
| 196 | +- **[Advanced Configuration](mdc:docs/customization/custom-llm)**: Explore advanced model customization options |
| 197 | +- **[Security Setup](mdc:docs/security-and-privacy)**: Configure enterprise security features |
0 commit comments