AI Gateway Model providers Azure OpenAI & AI Foundry

Azure OpenAI & AI Foundry

Azure models run on your own Azure resource, under deployment names you chose, so the credential includes your endpoint and deployments. Pick Azure OpenAI for OpenAI models, or Azure AI Foundry for other models (Llama, Mistral, DeepSeek and so on) deployed in Azure AI Foundry. Both take the same fields.

FieldWhat to enter
AuthenticationAPI key, or Microsoft Entra ID service principal.
API keyOne of the resource's keys. Only shown for API key authentication.
Tenant ID, Client (application) ID, Client secretThe service principal's Entra tenant ID and application ID (both GUIDs) and its client secret value. Only shown for Entra ID authentication. Forgebench gets access tokens from Entra ID for you.
EndpointYour resource's endpoint: https://<resource>.openai.azure.com, https://<resource>.cognitiveservices.azure.com, https://<resource>.services.ai.azure.com for Azure AI Foundry, or https://<app>.<env>.<region>.azurecontainerapps.io for an OpenAI-compatible model you host on Azure Container Apps (API key only). Nothing else is accepted.
API versionDefaults to 2024-10-21. Change it only if your deployments need another version.
Supported Azure models (multi-select) and DeploymentsSelect supported, priced chat models, or enter each deployment and its base model, such as my-gpt4o = gpt-4o. A bare model name uses that name as the deployment. Up to 100 per credential. The picker can check your endpoint for deployments or supported models.

Call a deployment by its name with the prefix: my-gpt4o above becomes azure-my-gpt4o, or azureai-<deployment> for Azure AI Foundry.

Forgebench bills each deployment at its base model's price. If Forgebench has no price for a base model, the save is refused and the error names it. Azure models run only on your credential; there is no shared fallback. Embedding, audio, and image base models cannot be saved as Azure chat deployments.

Saving against the same endpoint adds to saved deployments by default. Select Replace saved deployments to remove entries you no longer want. A different endpoint replaces the mapping. The backend resolves and stores the base-model price when you save, so a custom deployment name is not billed at a placeholder.

To add the credential, choose Add credential on Admin → Secrets and pick Azure OpenAI or Azure AI Foundry as the provider. See Model providers. Each Azure credential shows the endpoint it points at; the key is never shown again.

More than one Azure resource

A workspace can use several Azure resources, for example one with reserved capacity and one pay-as-you-go. The first credential you add is the Primary resource, and its models keep their plain names (azure-my-gpt4o). To add another, choose Add another resource on an Azure row, or Add credential and pick Azure again, and give it a name such as azure-pg. Nothing already saved changes.

Each named resource has its own endpoint, key and deployments, and its models carry its name after an @:

ResourceHow you call a deployment named my-gpt4o
Primaryazure-my-gpt4o
A resource named azure-pgazure-my-gpt4o@azure-pg
The same, on Azure AI Foundryazureai-my-gpt4o@azure-pg

The same deployment name can exist on several resources. Each id goes to its own endpoint, is priced by that resource's base model, and shows up under its own name in usage and traces. You can pick these ids anywhere a model is chosen: API key allowed models, model budgets, agents and route profiles. The Gateway › Fallbacks chains do not accept them: to fail over between resources, list them as steps of a route profile.

  • A named resource serves only the deployments listed on it.
  • The name cannot be changed later, because it is part of every model id. To rename a resource, add a new one and remove the old one.
  • A key made under a named resource can call only that resource's models.
  • A route profile step that uses a resource's id does not also name a key.
  • Removing a resource is refused while a profile, key, template or agent still uses it. The error lists what to change first.

Turning a resource off

On an Azure row, Disable stops a resource serving: its models leave every list and a call that names it is refused with provider_connection_unavailable before anything is sent to Azure. Enable brings back exactly the model list the resource had. A named resource can also be retired, which is permanent: it keeps its name and history, nothing can use it, and it is refused while a profile, key, template, agent, budget or pending approval still uses it. The error lists what to change first. A retired resource's endpoint and key can be reused by a new resource, so a replacement is: add the new one, move what used the old one, then retire the old one. The default resource can be disabled but never retired. These controls appear once your administrator has turned them on for the workspace.

Changing a credential's endpoint

A credential serves all of its deployments from one endpoint. If you save it with a different endpoint, Forgebench asks first and shows the deployments that would move. Confirm to replace it, or cancel to keep it and add the new endpoint as another resource instead. Through the API, saving a different endpoint answers 409 with the code azure_endpoint_changed until you send replace_endpoint: true.

Next

Cookie settings

Our Cookie Policy lists every cookie and what it does.