What you’ll need
- ngrok account with AI Gateway access
- Azure OpenAI Service resource with a deployed model
- An access key from app.ngrok.ai
Overview
Azure OpenAI uses deployment-specific URLs and requires anapi-version query parameter. The gateway injects your Azure API key server-side.
Getting started
Gather Azure details
From the Azure Portal, collect:
- Resource endpoint:
https://your-resource.openai.azure.com - API key: from Keys and Endpoint
- Deployment name: the name of your model deployment
- API version: a supported version (for example
2024-02-15-preview)
Create the custom provider
Azure requires the deployment path and
api-version in the base URL. See Create a custom provider with:- Provider ID:
azure-openai - Base URL:
https://your-resource.openai.azure.com/openai/deployments/your-deployment?api-version=2024-02-15-preview - API format: OpenAI Chat Completions
- Models: the model name for this deployment (for example
gpt-4o)
Include
api-version as a query parameter on the base URL. Azure rejects requests without it.Store your Azure API key
Add a provider key for your Azure deployment.
Configure access
Create an access key configuration that:
- Allows the
azure-openaiprovider in the access scope - Adds a routing rule for
azure-openaiwith Bring your own API key and your stored key attached
Multiple deployments and regions
Create a separate custom provider for each Azure deployment or region. Give each a unique provider ID (for exampleazure-gpt4, azure-eastus) with its own deployment URL and model list.
Attach the same or different provider keys per deployment. Pin a region with azure-eastus:gpt-4o, or list multiple models for failover: models: ["azure-eastus:gpt-4o", "openai:gpt-4o"].
Troubleshooting
| Symptom | Fix |
|---|---|
| 401 unauthorized | Verify the provider key in app.ngrok.ai matches Azure Portal and is attached in your access key configuration |
| 404 deployment not found | Check the deployment name in the base URL matches Azure Portal |
| API version errors | Update the api-version query parameter to a supported version |
| 429 rate limiting | Add multiple provider keys for failover or request a quota increase in Azure Portal |
Next steps
- Use a model you run yourself: URL requirements and configuration
- Provider Keys: Store upstream credentials
- Access Key Configurations: Route traffic per access key
- Quickstart: Create your first access key