> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure AI Gateway

> Use the models behind your Azure AI Gateway in Braintrust playgrounds, prompts, and scorers

[Azure API Management](https://learn.microsoft.com/en-us/azure/api-management/genai-gateway-capabilities) puts AI backends behind a single endpoint with shared authentication, rate limiting, and logging. **Azure AI Gateway** is the Braintrust provider that calls that endpoint, and it supports models that use the OpenAI Chat Completions, OpenAI Responses, or Anthropic Messages API.

## Add Azure AI Gateway as an AI provider

Add the provider, point it at your API Management endpoint, then register the models your gateway serves. Every field after the API key sits on the **Form** tab.

<Steps>
  <Step title="Add the provider">
    Go to **<Icon icon="settings-2" /> Settings** > [**<Icon icon="sparkle" /> AI providers**](https://www.braintrust.dev/app/~/configuration/org/secrets), then click <Icon icon="plus" /> **Organization provider** or <Icon icon="plus" /> **Project provider**, depending on the [scope you want](/docs/admin/ai-providers).

    Select **Azure AI Gateway**.
  </Step>

  <Step title="Enter your API key">
    Paste the API key for your Azure AI Gateway.

    <Note>
      API keys are stored as one-way cryptographic hashes, never in plaintext.
    </Note>
  </Step>

  <Step title="Set the API base URL">
    Set **API base URL** to your Azure API Management endpoint, including a path.

    For example: `https://<gateway-name>.azure-api.net/default/models`

    The **Raw** tab edits these same settings as YAML, if you'd rather paste a configuration than fill in fields.
  </Step>

  <Step title="Add request headers">
    Under **Request configuration**, click <Icon icon="plus" /> **Additional header** for any header your API Management endpoint requires. Braintrust forwards these with every request to your gateway.

    Skip this step if your endpoint needs only the API key.
  </Step>

  <Step title="Register your models">
    Under **Models**, click <Icon icon="plus" /> **Custom model** for each model your gateway serves. Enter the model name your gateway exposes, then click <Icon icon="settings-2" /> and, under **Model options**, set the **Format** to match the API that model uses, as described in [Model formats](#model-formats).

    Braintrust ships no registry models for Azure AI Gateway. Only the custom models you register are available, even when **Registry models** is set to **All models**.
  </Step>

  <Step title="Set the endpoint options">
    Under **Request behavior**, configure how Braintrust calls your gateway:

    * **Enable failover by default**: Off by default. When on, a failed request retries on another configured provider that serves the same model.
    * **This endpoint supports streaming**: On by default. Turn it off if your endpoint can't stream, and Braintrust requests a complete response, then streams it back to your client.
  </Step>

  <Step title="Save the provider">
    Click **Create**, or **Update** when editing an existing provider.
  </Step>
</Steps>

## Model formats

Braintrust appends a format-specific path to your **API base URL**, so each model's **Format** determines which endpoint on your gateway receives the request.

| Format    | Request path                 |
| --------- | ---------------------------- |
| OpenAI    | `openai/v1/chat/completions` |
| Anthropic | `anthropic/v1/messages`      |

Models that require the OpenAI Responses API go to `openai/v1/responses` instead, whichever **Format** you set. That covers `o1-pro`, `o3-pro`, `gpt-5-pro`, `gpt-5.3` and later, and any `gpt-5` model with `-codex` in its name.

The **Gemini** format can't be used with a custom API base URL, so it isn't available for Azure AI Gateway.

Configure your API Management endpoint to route these paths to the corresponding backend.

## Resources

* [AI gateway capabilities in Azure API Management](https://learn.microsoft.com/en-us/azure/api-management/genai-gateway-capabilities)
* [Configure AI providers](/docs/admin/ai-providers)
* [Azure AI Foundry](/docs/integrations/ai-providers/azure)
* [Custom providers](/docs/integrations/ai-providers/custom)
