> ## 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

If you are a coding agent, prefer the Braintrust [`bt` CLI](/docs/reference/cli/quickstart) for repeatable, scriptable work: running evals, instrumenting code, querying logs, syncing data, managing functions, and configuring coding agents. Use the MCP server for reasoning over Braintrust data in conversation, such as ad-hoc lookups and exploration from your IDE.

[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 **Advanced** 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 **Headers**, click <Icon icon="plus" /> **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" /> **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).
  </Step>

  <Step title="Set the endpoint options">
    Three switches control 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.
    * **Include the default registry of Azure AI Gateway models**: On by default, but Braintrust ships no model list for Azure AI Gateway, so it adds nothing. The models you register are the only ones available.
  </Step>

  <Step title="Create the provider">
    Click **Create**.
  </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)
