all docs
/ integrations

Azure OpenAI integration

Call Azure OpenAI through the ACE gateway: endpoint, zero-trust credential headers, stored-key alternative and runnable examples.

Send Azure OpenAI traffic to https://engine.acefleet.dev/azure/openai/deployments/<deployment>/chat/completions with your ACE developer key in Authorization: Bearer ace_dev_... and the provider credential on the zero-trust headers below. The request body is the vendor's own, relayed as written, and the vendor's answer comes back verbatim.

The same headers also serve:

  • https://engine.acefleet.dev/azure/openai/v1/chat/completions
  • https://engine.acefleet.dev/azure/openai/v1/responses
  • https://engine.acefleet.dev/azure/openai/responses?api-version=…

Zero-trust headers

Header Required What it carries
x-ace-azure-key yes Upstream Azure OpenAI deployment key.
x-ace-azure-endpoint yes Your Azure OpenAI resource endpoint. Azure has no global host, so the key alone does not say where to send the call.
x-ace-provider situational Pin the channel to azure when the model name would not imply it.

Stored key instead

A stored azure vendor key replaces x-ace-azure-key; the endpoint is stored with it. The deployment ACE addresses is the request's model (the <deployment> path segment on this door), unless the stored Azure config maps that model to a differently-named deployment — set per model in the settings page or with store_provider_key's deployments. x-ace-azure-deployment is deprecated: it does not override model, and one that contradicts it is a 400.

Example request

curl -X POST "https://engine.acefleet.dev/azure/openai/deployments/gpt-4o-prod/chat/completions?api-version=2024-02-15-preview" \
  -H "Authorization: Bearer ace_dev_<your-dev-key>" \
  -H "x-ace-provider: azure" \
  -H "x-ace-azure-key: <your-azure-key>" \
  -H "x-ace-azure-endpoint: https://<resource>.openai.azure.com" \
  -H "Content-Type: application/json" \
  -d '{ "messages": [{ "role": "user", "content": "ping" }] }'

Quickstarts

Azure OpenAI proxy (cURL)

curl -X POST "https://engine.acefleet.dev/azure/openai/deployments/gpt-4o-prod/chat/completions?api-version=2024-02-15-preview" \
  -H "Authorization: Bearer ace_dev_<your-dev-key>" \
  -H "x-ace-provider: azure" \
  -H "x-ace-azure-key: <your-azure-key>" \
  -H "x-ace-azure-endpoint: https://<resource>.openai.azure.com" \
  -H "Content-Type: application/json" \
  -d '{ "messages": [{ "role": "user", "content": "Optimize GPU allocations." }] }'

Azure Responses API (cURL)

curl -X POST "https://engine.acefleet.dev/azure/openai/v1/responses?api-version=preview" \
  -H "Authorization: Bearer ace_dev_<your-dev-key>" \
  -H "x-ace-provider: azure" \
  -H "x-ace-azure-key: <your-azure-key>" \
  -H "x-ace-azure-endpoint: https://<resource>.openai.azure.com" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5-mini",
    "input": [{ "role": "user", "content": [{ "type": "input_text", "text": "Optimize GPU allocations." }] }],
    "reasoning": { "effort": "low" },
    "store": false,
    "include": ["reasoning.encrypted_content"]
  }'

Vercel AI SDK: OpenAI and Azure (@ai-sdk/openai, @ai-sdk/azure)

Both default to the Responses API, which the gateway serves as its own surface — /v1/responses, and under /azure/openai the three spellings the Azure SDKs use — with the item array, reasoning, store, include and encrypted_content relayed as sent and the response.* stream returned verbatim; chat completions from the same factories land on /v1/chat/completions and /azure/openai/deployments/{deployment}/chat/completions. @ai-sdk/openai sends apiKey as Authorization: Bearer; @ai-sdk/azure sends it as api-key, which the Azure surface reads the same way. Azure has no global host, so the resource endpoint travels on x-ace-azure-endpoint and the deployment name is the model.

import { createOpenAI } from '@ai-sdk/openai';
import { createAzure } from '@ai-sdk/azure';

const openai = createOpenAI({
  baseURL: 'https://engine.acefleet.dev/v1',
  apiKey: 'ace_dev_<your-dev-key>',                 // Authorization: Bearer
  headers: { 'x-ace-openai-key': 'sk-proj-...' },
});

const azure = createAzure({
  baseURL: 'https://engine.acefleet.dev/azure/openai',
  apiKey: 'ace_dev_<your-dev-key>',                 // sent as api-key
  headers: {
    'x-ace-provider': 'azure',
    'x-ace-azure-key': '<your-azure-key>',
    'x-ace-azure-endpoint': 'https://<resource>.openai.azure.com',
  },
});
// model: azure('gpt-4o-prod') — the deployment name