Connect Azure OpenAI Through APIM
If you front your Azure OpenAI endpoint with Azure API Management (APIM), point the Azure OpenAI provider at the APIM gateway instead of the Azure OpenAI endpoint directly. APIM acts as an OpenAI-compatible proxy. Two settings have to line up, one in APIM and one in Qualytics.
Prerequisites
- A Qualytics account with the Manager or Admin role.
- An APIM instance in front of your Azure OpenAI resource, with the Azure OpenAI API imported and its URL suffix set to
openaiso the gateway path mirrors a native Azure OpenAI endpoint. This is an APIM setting and is not entered in Qualytics. - Permission to change the subscription header name in APIM.
- The APIM gateway host and an APIM subscription key.
Steps
Step 1: In APIM, go to API > Settings > Subscription > Header name and change it from Ocp-Apim-Subscription-Key to api-key. The Azure OpenAI client sends its credential in the api-key HTTP header, so this one change lets the subscription key travel in the header the client already uses.
Step 2: In Qualytics, open the AgentQ setup page and select Custom setup. See Add Integration.
Step 3: Select Azure OpenAI as the Provider.
Step 4: Enter the APIM gateway host as the Base URL, using only the host and no trailing /openai.
The Azure OpenAI client appends /openai/deployments/{deployment}/...?api-version=... on its own, so adding /openai yourself doubles the path and the requests fail.
Step 5: Enter the APIM subscription key as the API Key.
Step 6: Fill in the remaining Azure OpenAI fields and finish connecting, as described in Add Integration.
Note
Confirm that the deployment name and api-version match what is deployed behind APIM. The standard Azure OpenAI import passes both through. APIM authenticates to the real Azure OpenAI backend on its own side, so the backend model credentials are never exposed to Qualytics.
For more detail, see the Azure API Management documentation on authenticating and authorizing to LLM APIs, importing an Azure OpenAI API, and subscriptions and custom header names.