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
1
Open the Microsoft Foundry model account form
In the TrueFoundry dashboard, open AI Gateway > Models and select Microsoft Foundry.
2
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:The project endpoint should include the project path, for example:The
/openai and /openai/v1 suffixes are optional. TrueFoundry removes them before constructing the upstream request path.3
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, client secret authentication, and workload identity federation.
4
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, ordatazone_eu. - Model types: the operations supported by the deployment.
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 withinferred.model_types: true so you can select the model types manually.
Call a Microsoft Foundry model
Gateway model IDs use the format:my-foundry and the integration is gpt-4.1, use my-foundry/gpt-4.1 in the request body:
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:Cohere rerank deployments
Cohere rerank deployments use the Foundry Cohere route. Selectrerank as the model type and use the deployment name as the integration’s model_id.