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

# Microsoft Foundry

> Configure Microsoft Foundry deployments and access them through TrueFoundry's AI Gateway.

Microsoft Foundry provides one account for Azure OpenAI models and models from other publishers, including Anthropic, Cohere, Meta, and Mistral. TrueFoundry's Microsoft Foundry integration uses the OpenAI-compatible v1 surface for compatible deployments and provider-specific routes where required.

## Before you start

You need:

* A Microsoft Foundry resource with one or more deployed models.
* The resource's OpenAI endpoint.
* The project endpoint used for deployment discovery and provider-specific Foundry routes.
* An API key or one of the supported Azure identity authentication methods.
* A TrueFoundry API key for requests through the AI Gateway.

## Add a Microsoft Foundry account

<Steps>
  <Step title="Open the Microsoft Foundry model account form">
    In the TrueFoundry dashboard, open **AI Gateway** > **Models** and select **Microsoft Foundry**.
  </Step>

  <Step title="Configure the resource">
    Enter an account name, the Azure OpenAI endpoint, and the Microsoft Foundry project endpoint.

    The OpenAI endpoint should be the resource URL, for example:

    ```text theme={"dark"}
    https://my-resource.openai.azure.com
    ```

    The project endpoint should include the project path, for example:

    ```text theme={"dark"}
    https://my-resource.services.ai.azure.com/api/projects/my-project
    ```

    The `/openai` and `/openai/v1` suffixes are optional. TrueFoundry removes them before constructing the upstream request path.
  </Step>

  <Step title="Configure authentication">
    Configure authentication at the account level using an API key, certificate, client secret, or workload identity federation.

    See the guides for [certificate authentication](/docs/ai-gateway/azure-entra-certificate-auth), [client secret authentication](/docs/ai-gateway/azure-entra-client-secret-auth), and [workload identity federation](/docs/ai-gateway/azure-entra-wif-auth).
  </Step>

  <Step title="Add or discover deployments">
    Use model discovery when the project endpoint is available, or add deployments manually.

    A model integration uses:

    * **Name**: the integration name used in Gateway model IDs.
    * **Model ID**: the deployment name in Microsoft Foundry.
    * **Foundation model**: the underlying model used for catalogue metadata and routing.
    * **Deployment type**: `standard`, `global`, `datazone_us`, or `datazone_eu`.
    * **Model types**: the operations supported by the deployment.
  </Step>
</Steps>

## Discover deployments

Model discovery reads deployments from the project endpoint. It uses the catalogue to infer model types and public cost metadata when the foundation model is known.

Discovery is stateless. Include the current integrations in the request so existing integration names remain stable and new names avoid collisions.

If the foundation model is not in the catalogue, the deployment is returned with `inferred.model_types: true` so you can select the model types manually.

## Call a Microsoft Foundry model

Gateway model IDs use the format:

```text theme={"dark"}
<provider-account-name>/<integration-name>
```

For example, if the account is `my-foundry` and the integration is `gpt-4.1`, use `my-foundry/gpt-4.1` in the request body:

```bash theme={"dark"}
curl "$GATEWAY_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $TFY_API_KEY" \
  -H "x-tfy-provider-name: my-foundry" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "my-foundry/gpt-4.1",
    "messages": [
      {"role": "user", "content": "Explain Microsoft Foundry in one sentence."}
    ]
  }'
```

The TrueFoundry API key authenticates the Gateway request. The Azure credential configured on the provider account authenticates the upstream Microsoft Foundry request.

## Supported operations

Microsoft Foundry models can use the following Gateway operations when the deployment and model integration declare the corresponding model type:

* Chat completions and legacy text completions
* Responses and Responses compaction
* Embeddings
* Image generation and image editing
* Text-to-speech, audio transcription, and audio translation
* Realtime WebSocket sessions
* Files, batches, and fine-tuning
* Cohere rerank
* Anthropic Messages and Messages token counting for Claude deployments

### OpenAI-compatible deployments

OpenAI-compatible deployments use the `/openai/v1` upstream surface by default. The deployment name is sent as the upstream `model` value.

If a deployment does not support v1, set `api_version` on that model integration. TrueFoundry then uses the deployment-scoped Azure route with that API version.

### Claude deployments

Claude deployments use the native Anthropic Messages route. The provider account must include the project endpoint so TrueFoundry can reach the resource-level Anthropic surface.

Use a Gateway model ID such as:

```text theme={"dark"}
my-foundry/claude-opus-4-8
```

### Cohere rerank deployments

Cohere rerank deployments use the Foundry Cohere route. Select `rerank` as the model type and use the deployment name as the integration's `model_id`.

### Realtime models

Realtime models use the Gateway WebSocket endpoint:

```text theme={"dark"}
ws://<gateway-host>/live/<provider-account-name>?model=<integration-name>
```

For example:

```text theme={"dark"}
wss://gateway.example.com/live/my-foundry?model=gpt-realtime
```

The provider account is already present in the URL, so the realtime query parameter is the integration name rather than the full Gateway model FQN.

## Limitations

The unified Microsoft Foundry Gateway integration does not currently expose a dedicated OCR operation. Vision-capable chat models can still process image or document inputs when the deployment supports them.
