> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vapi.ai/llms.txt.
> For full documentation content, see https://docs.vapi.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vapi.ai/_mcp/server.

# Azure OpenAI

**Video Tutorial:**

<iframe src="https://www.loom.com/embed/951976f68e564ed39691fd150489afee" title="Loom video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" width="100%" height="400px" allowfullscreen />

**What is Azure OpenAI?**

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.

**Custom Azure OpenAI Integration with Vapi:**

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.

## Prerequisites

Before configuring Azure OpenAI with Vapi, ensure you have:

* An active Azure subscription
* Azure OpenAI Service resource deployed
* Model deployments configured in your Azure OpenAI instance
* API keys and endpoint information from your Azure OpenAI resource

## Credential Settings

You can configure your Azure OpenAI credentials in the "Model Providers" section of the "Provider Credentials" page in the Vapi dashboard.

| Setting                       | Description                                                                     | Required |
| ----------------------------- | ------------------------------------------------------------------------------- | -------- |
| **Provider**                  | Select "Azure OpenAI"                                                           | ✅        |
| **Models**                    | List of model deployment names (must match Vapi's supported models)             | ✅        |
| **Region**                    | Azure region where your OpenAI resource is deployed                             | ✅        |
| **OpenAI Endpoint**           | Base Azure OpenAI endpoint URL (e.g., `https://your-resource.openai.azure.com`) | ✅        |
| **OpenAI Key**                | API key for your Azure OpenAI resource                                          | ✅        |
| **OCP-APIM-Subscription-Key** | API Management subscription key (optional - can be left blank)                  | ❌        |

## Important Configuration Notes

### Model and Deployment Names

**Critical Requirement**: Your Azure deployment name **must exactly match** one of Vapi's supported model names. Custom deployment names are not supported.

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`.

### Supported Models

Vapi supports these Azure OpenAI models (ensure your deployment names match exactly):

**Latest GPT-4.1 Models:**

* `gpt-4.1-2025-04-14`
* `gpt-4.1-mini-2025-04-14`
* `gpt-4.1-nano-2025-04-14`

**GPT-4o Models:**

* `gpt-4o-2024-11-20`
* `gpt-4o-2024-08-06`
* `gpt-4o-2024-05-13`
* `gpt-4o-mini-2024-07-18`

**GPT-4 Models:**

* `gpt-4-turbo-2024-04-09`
* `gpt-4-0125-preview`
* `gpt-4-1106-preview`
* `gpt-4-0613`

**GPT-3.5 Models:**

* `gpt-35-turbo-0125`
* `gpt-35-turbo-1106`

### Supported Regions

Vapi supports these Azure regions for OpenAI deployments:

* `australia` (Australia East)
* `canadaeast` (Canada East)
* `canadacentral` (Canada Central)
* `eastus` (East US)
* `eastus2` (East US 2)
* `france` (France Central)
* `india` (Central India)
* `japaneast` (Japan East)
* `japanwest` (Japan West)
* `northcentralus` (North Central US)
* `norway` (Norway East)
* `southcentralus` (South Central US)
* `swedencentral` (Sweden Central)
* `switzerland` (Switzerland North)
* `uaenorth` (UAE North)
* `uk` (UK South)
* `westus` (West US)
* `westus3` (West US 3)

Choose the region closest to your users for optimal performance, or use a specific region for data residency compliance.

### Endpoint URL Format

Use only the **base endpoint URL** from your Azure OpenAI resource, not the full completions URL.

**Correct format:**

```
https://your-resource-name.openai.azure.com
```

**Incorrect format:**

```
https://your-resource-name.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-11-20
```

### API Management Subscription Key

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.

## Configuration Steps

From your Azure OpenAI resource in the Azure portal, collect:

* Base endpoint URL
* API key (from Keys and Endpoint section)
* Deployment names
* Region

Ensure your model deployments use names that exactly match Vapi's supported model list. If needed, create new deployments with the correct names.

Navigate to Settings → Integrations → Provider Credentials → Model Providers and add your Azure OpenAI configuration.

Create a test assistant using your Azure OpenAI model to verify the connection works correctly.

## Example Configuration

```json
{
  "provider": "azure-openai",
  "models": ["gpt-4o-2024-11-20"],
  "region": "eastus", 
  "openAIEndpoint": "https://your-resource.openai.azure.com",
  "openAIKey": "your-azure-openai-api-key",
  "ocpApimSubscriptionKey": ""
}
```

## Benefits of Using Azure OpenAI

**Enterprise Security:**

* Data residency control with regional deployments
* Enterprise-grade security and compliance (SOC 2, ISO 27001, etc.)
* Private network connectivity options

**Custom Rate Limits:**

* Use your own Azure OpenAI quota and rate limits
* Avoid shared resource constraints
* Predictable costs and billing through Azure

**Advanced Features:**

* Support for fine-tuned models
* Content filtering and safety controls
* Integration with Azure monitoring and logging

## Troubleshooting

### Common Error: "Resource not found"

* **Cause**: Incorrect endpoint URL or model deployment name
* **Solution**: Verify the endpoint URL format and ensure deployment names match exactly

### Common Error: "No model specified in request"

* **Cause**: Deployment name doesn't match the selected model in Vapi
* **Solution**: Create a deployment with the exact model name as expected by Vapi

### Common Error: "Couldn't Validate Azure OpenAI Credential"

* **Cause**: Invalid API key, incorrect endpoint, or network restrictions
* **Solution**: Verify API key, check endpoint URL format, and ensure network access