Azure OpenAI
Description
Azure OpenAI uses the OpenAI wire format. The gateway routes Azure requests to the per-resource Azure endpoint and converts the Authorization header to the api-key header that Azure expects.
The gateway exposes two paths to reach Azure:
- Through the OpenAI provider with Azure config — the request goes to
POST /v1/<TENANT>/<GATEWAY>/openai/...and the gateway looks upazure_endpointin the gateway configuration. When that key is set, the request is rewritten to the Azure URL. - Through the dedicated Azure provider — the request goes to
POST /v1/<TENANT>/<GATEWAY>/azure/...and uses the dedicated Azure handler.
Both paths translate Authorization: Bearer <KEY> to api-key: <KEY> on the upstream call.
| Feature | Limitation |
|---|---|
| Chat completions | — |
| Streaming responses (SSE) | — |
| Vision input | Depends on the underlying deployment. |
| Tool use | Depends on the underlying deployment. |
Required gateway configuration
The gateway-config keys are not exposed in the Edit Gateway dialog of the SPA. Set them through the admin API.
For requests routed through the OpenAI provider:
| Key | Type | Default | Description |
|---|---|---|---|
azure_endpoint |
string | unset | Full base URL including the deployment path, for example https://myresource.openai.azure.com/openai/deployments/my-deployment. The gateway appends the request path (for example /chat/completions) and the api-version query parameter to this value verbatim. When set, OpenAI requests on this gateway are rewritten to the Azure URL. |
azure_deployment |
string | unset | Ignored on this path. The deployment must be embedded in azure_endpoint instead. (Used only by the dedicated Azure provider path below.) |
azure_api_version |
string | 2024-02-01 |
Value of the api-version query parameter. |
For requests routed through the Azure provider:
| Key | Type | Default | Description |
|---|---|---|---|
azure_resource |
string | unset | Resource name. The handler builds the URL https://<RESOURCE>.openai.azure.com/openai/deployments/<DEPLOYMENT>/chat/completions?api-version=<VERSION>. |
azure_deployment |
string | falls back to the request model, then to gpt-4o |
Deployment name in Azure AI Foundry. |
azure_api_version |
string | 2024-10-21 |
Value of the api-version query parameter. |
Send a PATCH /admin/v1/gateways/<ID> with the config field to set these keys. See Tenants and gateways API.
BYOK key format
The BYOK value for the azure provider (or the openai provider with Azure config) is the Azure OpenAI resource API key. The gateway sends the value in the api-key request header.
Adding the key
The procedure for storing a BYOK key is the same for every provider. See Provider keys (BYOK). Select azure in the Provider drop-down list of the Add Model dialog and paste the API key in the API Key field.
Inference endpoint
Or, when the gateway has azure_endpoint set, requests through the OpenAI path are also routed to Azure:
Address Azure through its native path (/v1/{tenant}/{gateway}/azure/chat/completions). The compat endpoint cannot route to Azure by model name, because Azure model names overlap with OpenAI model names.