LLM Gateway
Integrations

Azure Integration

Connect Azure to LLM Gateway for enterprise-grade OpenAI models

Azure provides access to OpenAI's powerful language models through Microsoft's enterprise cloud infrastructure. This guide shows how to create an Azure resource, deploy models, and integrate them with LLM Gateway.

Use azure with the AI Foundry deployment type for OpenAI-compatible models on Microsoft Foundry. Claude uses the separate azure-anthropic Messages API integration described below.

The legacy azure-ai-foundry mappings deactivate on 2026-11-07 at 00:00 UTC. Migrate to Azure before then. Existing legacy requests keep working during the notice period.

Prerequisites

  • An Azure account with an active subscription
  • LLM Gateway account or self-hosted instance

Overview

Azure provides enterprise-grade access to OpenAI models with enhanced security, compliance, and regional availability. LLM Gateway integrates seamlessly with Azure deployments.

Create Azure Resource

Create an Azure OpenAI Resource

  1. Log into the Azure Portal (https://portal.azure.com)
  2. Click Create a resource
  3. Search for Azure OpenAI and select it
  4. Click Create
  5. Configure the resource:
    • Subscription: Select your Azure subscription
    • Resource group: Create new or select existing
    • Region: Choose a region (e.g., East US, West Europe)
    • Name: Enter a unique resource name (this will be your <resource-name>)
    • Pricing tier: Select Standard S0
  6. Click Review + create, then Create
  7. Wait for deployment to complete

Important: Note your resource name - it will be used in the base URL: https://<resource-name>.openai.azure.com

Deploy Models

  1. Navigate to your Azure resource in the Azure Portal
  2. Click Go to Azure OpenAI Studio or visit https://oai.azure.com
  3. In Azure Studio, select Deployments from the left sidebar
  4. Click Create new deployment
  5. Configure your deployment:
    • Model: Select a model listed for Azure on the models page
    • Deployment name: Use the upstream deployment name expected by the Azure mapping; it can differ from the canonical gateway model ID
    • Model version: Select the latest version
    • Deployment type: Global Standard
  6. Click Create
  7. Repeat for additional models you want to use

Get API Key

  1. In the Azure Portal, go to your Azure resource
  2. Click Keys and Endpoint in the left sidebar
  3. Copy Key 1 or Key 2
  4. Note your Endpoint URL (should be https://<resource-name>.openai.azure.com)

Important: Keep your API key secure - it provides access to your Azure deployments.

Add to LLM Gateway

  1. Log into LLM Gateway Dashboard
  2. Select your organization and project
  3. Go to Provider Keys in the sidebar

Add Azure Provider Key

  1. Click Add for Azure
  2. Enter your API Key from Azure Portal
  3. Enter your Resource Name (the name from your Azure endpoint URL)
    • Example: If your endpoint is https://my-openai-resource.openai.azure.com, enter my-openai-resource
  4. Select your preferred type (Azure OpenAI or AI Foundry)
  5. Adapt the Validation Model to a model that you already deployed and is available This is a one time check to ensure the API key is valid and the model can be accessed.
  6. Click Add Key

The system will validate your key and confirm the connection.

Test the Integration

Test your integration with a simple API call:

curl -X POST https://api.llmgateway.io/v1/chat/completions \
  -H "Authorization: Bearer YOUR_LLMGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "azure/gpt-4.1-mini",
    "messages": [
      {
        "role": "user",
        "content": "Hello from Azure!"
      }
    ]
  }'

Replace YOUR_LLMGATEWAY_API_KEY with your LLM Gateway API key.

Available Models

Browse the Azure models page for currently available mappings. Only models deployed in your Azure resource can serve requests. Deployment names must match the Azure mapping's upstream ID; gateway requests still use the canonical model ID.

Azure availability varies by model and resource region, even for Global Standard deployments. If the portal reports an unsupported region, deploy in a supported region and configure that resource's provider key. A catalogue mapping alone does not create a deployment or make Azure available for automatic fallback.

The same key also serves embeddings (/v1/embeddings), text-to-speech (/v1/audio/speech), and realtime speech and transcription sessions (/v1/realtime) for Azure-mapped models. The gateway calls the resource's v1 API (https://<resource>.openai.azure.com/openai/v1) for these endpoints regardless of the key's deployment type. A key with a base URL instead of a resource uses that base URL for every Azure endpoint, including these.

Azure uses the same gateway parameters for speech formats, speed, delivery instructions, realtime voices, audio codecs, turn detection, noise reduction, input transcription, and function calling as OpenAI. Availability still depends on the upstream model: some Azure speech deployments expose fewer voices. Use the provider mapping's supported_voices from GET /v1/models rather than assuming OpenAI's voice list applies.

Speech generation streams audio as it arrives and supports SSE on compatible mappings. Realtime sessions support image input and native MCP tools with authorization and usage accounting. Stored provider prompt references and native WebRTC/SIP remain outside the gateway's supported API for both providers.

Migrate from Azure AI Foundry

The legacy azure-ai-foundry provider uses the Azure Model Inference API. Its replacement is the existing azure provider in AI Foundry mode, which uses Azure's OpenAI-compatible v1 API. See the legacy models page for affected mappings.

  1. Confirm that the same deployments are available in your Foundry resource.
  2. Add an Azure provider key using that resource's API key and resource name. Select AI Foundry, not the legacy deployment-based Azure OpenAI type. Set the validation model to an existing upstream deployment name; it may differ from the canonical gateway model ID. Do not apply a single-deployment override to a key intended to serve several models.
  3. Change explicit request prefixes from azure-ai-foundry/<model-id> to azure/<model-id>, keeping the canonical model ID unchanged. Update provider restrictions and saved routing configurations that name the legacy provider.
  4. Test the new key before removing the legacy credential. Scope keys to the models actually deployed in their resource; do not replace an existing Azure credential belonging to a different resource.

Self-hosted configurations must explicitly configure LLM_AZURE_API_KEY and exactly one of LLM_AZURE_RESOURCE or LLM_AZURE_BASE_URL. The legacy LLM_AZURE_AI_FOUNDRY_* variables are not aliases. Existing legacy credentials and provider IDs remain supported until the scheduled cutoff; azure-anthropic is unchanged.

Priority processing

Azure sells a low-latency Priority processing tier, requested per request via the OpenAI-compatible service_tier field:

curl -X POST https://api.llmgateway.io/v1/chat/completions \
  -H "Authorization: Bearer YOUR_LLMGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "azure/gpt-5.1",
    "service_tier": "priority",
    "messages": [
      {
        "role": "user",
        "content": "Hello from Azure!"
      }
    ]
  }'

Requirements:

  • A Global Standard or Data Zone (US) deployment. Regional standard and EU data zone deployments are not supported. Not every priority-capable model is offered on both — some are Global Standard only, so check Microsoft's availability tables for the model you deploy.
  • Model version 2025-12-01 or later, on a model that offers the tier — see the provider card on the models page.
  • A subscription entitled to priority processing.

Both provider key types work — the v1 (AI Foundry) and the legacy deployment-based surfaces each accept service_tier and report the tier they served.

Azure serves a priority request at standard when the entitlement is missing, during peak load, on ramp-rate limits, and for long-context prompts on some models. It reports the tier it actually served, so a downgraded request is billed at standard rates and used_service_tier comes back null. See service tiers for the full behaviour.

Claude models on Microsoft Foundry

Claude models are served by Microsoft Foundry through Anthropic's Messages API rather than an OpenAI-compatible endpoint, so they use their own azure-anthropic provider in LLM Gateway.

  1. In the Foundry portal, deploy the Claude model you want. The deployment name is what you pass as the model at inference time, so keep the default (the model ID) unless you have a reason to rename it.
  2. Add an Azure Anthropic provider key in LLM Gateway with your Foundry API key and the resource name from https://<resource-name>.services.ai.azure.com.
  3. Call it with the azure-anthropic/<model> model string:
curl -X POST https://api.llmgateway.io/v1/chat/completions \
  -H "Authorization: Bearer YOUR_LLMGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "azure-anthropic/claude-opus-4-8",
    "messages": [
      {
        "role": "user",
        "content": "Hello from Microsoft Foundry!"
      }
    ]
  }'

If a request returns DeploymentNotFound, the model has not been deployed in that Foundry resource, or the deployment name does not match the model string you sent. Browse the Claude models routed through this provider at llmgateway.io/models.

Troubleshooting

"Deployment not found" error

  • Verify you've created a deployment in Azure Studio
  • Ensure the deployment name matches the Azure mapping's upstream ID or the key's explicit deployment override
  • Check that the deployment is in the same resource as your API key

"Resource not found" error

  • Verify the resource name is correct (check your Azure Portal endpoint URL)
  • Ensure your API key belongs to the correct Azure resource
  • Confirm the resource is in an active state in Azure Portal

Rate limiting

  • Azure has Tokens Per Minute (TPM) quotas per deployment
  • Monitor usage in Azure Studio under Quotas
  • Request quota increases through Azure Portal if needed for high-volume workloads

Region availability

  • Not all models are available in all Azure regions
  • Check Azure model availability for your region
  • Consider creating resources in multiple regions for better availability

How is this guide?

Last updated on

On this page

Ready for production?

Ship to production with SSO, audit logs, spend controls, and guardrails your security team will approve.

Explore Enterprise