azure open ai
# support
v
Hi there! 👋 I see you're having trouble adding Azure OpenAI credentials to Vapi, even though the same credentials are working in your Python calls. This is a common issue with a few potential solutions! I can't determine exactly what's working in your Python setup, but I can definitely help troubleshoot why your credentials aren't validating in Vapi. Based on the error message you're seeing (401: "Access denied due to invalid subscription key or wrong API endpoint"), here are the most likely causes and solutions: ## 1. API Endpoint Format Vapi requires a specific endpoint format that might differ from what works in Python: - The endpoint should go up to
chat/completions?api-version=
without including the version number - Use the shorter resource endpoint, not the longer deployment endpoint - Example format:
openai/deployments/<deployment_name>/chat/completions?api-version
[Discord user feedback](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336754090880798765) confirms this format requirement. ## 2. Authentication Method There might be a discrepancy in the authentication method: - Vapi might be expecting the
Ocp-Apim-Subscription-Key
header - Azure OpenAI now requires the
api-key
header - This could explain why credentials work in Python but not in Vapi According to [user discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339956981297057892), this authentication method mismatch is a common issue. ## 3. Model and Deployment Name Make sure: - The deployment name exactly matches the model name in Vapi (e.g., "gpt-4o-2024-08-06") - You're using the OpenAI provider standard model name (e.g., gpt-4o) not a custom name - You're using "OpenAI" as the provider ## 4. Region Configuration Check your region settings: - Vapi might default to "australia" for the region - Manually select the correct region for your Azure OpenAI resource
- Note that some region names have been updated (e.g.,
canada
is now
canadaeast
) [Changelog documentation](https://docs.vapi.ai/changelog/2025/1/21) shows these region name updates. ## 5. Credential Precedence If you have both OpenAI and Azure OpenAI credentials: - The system might be favoring OpenAI over Azure OpenAI - Try removing the OpenAI credential if you want to exclusively use Azure OpenAI Would you like me to help troubleshoot any specific part of this issue in more detail? Sources: - [Discord user feedback](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336754090880798765) - [User discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339956981297057892) - [Changelog documentation](https://docs.vapi.ai/changelog/2025/1/21)
k
When entering credentials, make sure the endpoint field is just the root URL and the key field is the correct key, without extra whitespace..
k
King's big if possible can you get in a chat with Manish and see what could have been going wrong for him?