Try Bifrost Enterprise free for 14 days.
Request access

[ Provider Guide ]

Azure OpenAI Service on Bifrost

Bifrost routes Azure OpenAI Service with automatic deployment mapping, multi-model support, and flexible authentication. The integration routes both OpenAI and Anthropic models through a unified gateway with parameter conversion.

Azure provider summary

Bifrost manages Azure OpenAI Service with automatic deployment-to-model-name mapping, multi-auth support, and intelligent model family detection.

Azure supports:

  • OpenAI models (GPT-4, GPT-3.5, DALL-E, etc.)
  • Anthropic Claude models (via Azure partnership)
  • Flexible deployment mapping via aliases
  • Multiple authentication methods
PropertyDetails
DescriptionMicrosoft's OpenAI API service with enterprise features and API compatibility.
Provider route on Bifrostazure/<model>
Provider docAzure OpenAI Service
API endpoint patternhttps://<resource>.openai.azure.com
Default API version2024-10-21

Authentication methods

Bifrost supports three authentication methods. Precedence: Entra ID (if configured) → API key → managed identity.

MethodCredentialsUse case
Entra ID (Service Principal)client_id, client_secret, tenant_idRecommended for enterprise
API KeyDirect API key authSimple setup
Default Credential (managed identity)Automatic discoveryCloud native

Supported operations

Azure OpenAI Service supports most OpenAI operations. Batch, text completions, speech (TTS), and image variation are not supported upstream. Responses API uses a preview API version and is available for both OpenAI and Anthropic models.

OperationNon-streamingStreamingUpstream endpoint
Chat CompletionsYesYes/v1/chat/completions
Responses APIYesYes/v1/responses
EmbeddingsYesNo/v1/embeddings
Image GenerationYesYes/openai/v1/images/generations
Image EditYesYes/openai/v1/images/edits
FilesYesNo/openai/v1/files
List ModelsYes-/openai/v1/models
Video GenerationYes-/openai/v1/videos
Image VariationNoNo-
Speech (TTS)NoNo-
BatchNoNo-

Deployment mapping

Azure deployments must be mapped to model names via aliases in your API key configuration. This enables Bifrost to route requests to the correct Azure deployment.

{
  "aliases": {
    "gpt-4o": "my-gpt4o-deployment",
    "gpt-4-turbo": "my-gpt4-turbo-deployment",
    "claude-3-5-sonnet": "my-claude-deployment"
  },
  "azure_key_config": {
    "endpoint": "https://your-org.openai.azure.com",
    "api_version": "2024-10-21"
  }
}

API reference

Standard OpenAI-compatible endpoints routed through Azure OpenAI Service.

1) Chat Completions

Primary chat endpoint. Automatically routes to Azure deployment via alias mapping.

curl -X POST http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_AZURE_API_KEY" \
  -d '{
    "model": "azure/gpt-4o",
    "messages": [{"role": "user", "content": "Hello"}],
    "deployment": "my-gpt4-deployment",
    "endpoint": "https://my-org.openai.azure.com"
  }'

2) Responses API

The Responses API is available for both OpenAI and Anthropic models on Azure. Bifrost routes to upstream /openai/v1/responses using the preview API version (distinct from Chat Completions API version).

ParameterAzure handlingNotes
instructionsBecomes system messageModel-specific conversion
inputConverted to user message(s)String or array support
max_output_tokensModel-specific field mappingOpenAI vs Anthropic conversion
All other paramsModel-specific conversionConverted per underlying provider

OpenAI models (GPT-4, etc.): conversion follows OpenAI's Responses API format.

Anthropic models (Claude): instructions becomes a system message; reasoning maps to the thinking structure.

curl -X POST http://localhost:8080/v1/responses \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_AZURE_API_KEY" \
  -d '{
    "model": "azure/claude-3-sonnet",
    "input": "Hello, how are you?",
    "instructions": "You are a helpful assistant",
    "deployment": "my-claude-deployment",
    "endpoint": "https://my-org.openai.azure.com"
  }'
  • Uses /openai/v1/responses with preview API version
  • Request body conversions are handled automatically by Bifrost
  • Supports raw request body passthrough for advanced use cases

See also OpenAI Responses API (gpt-oss reasoning) and Anthropic Responses API for model-family specifics.

3) Embeddings

Text embeddings via Azure OpenAI Service. Maps to configured deployment.

Embeddings are supported for OpenAI models only (not available for Anthropic models on Azure).

curl -X POST http://localhost:8080/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_AZURE_API_KEY" \
  -d '{
    "model": "text-embedding-3-small",
    "input": ["text to embed"],
    "deployment": "my-embedding-deployment"
  }'

4) Image Generation

Image Generation is supported for OpenAI models on Azure and uses the OpenAI-compatible format. Bifrost routes to upstream /openai/v1/images/generations. Conversion matches OpenAI Image Generation.

ParameterAzure handlingNotes
modelMapped to deployment_idDeployment ID must be configured in aliases
promptDirect pass-throughPrompt text for image generation
All other paramsDirect pass-throughUses OpenAI format via struct embedding
  • bifrostReq.Model maps to deployment ID; bifrostReq.Prompt passes through
  • Additional fields from the request are embedded into the upstream struct (OpenAI-compatible)
curl -X POST http://localhost:8080/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_AZURE_API_KEY" \
  -d '{
    "model": "azure/dall-e-3",
    "prompt": "A sunset over the mountains",
    "size": "1024x1024",
    "n": 1,
    "deployment": "my-image-gen-deployment"
  }'

Response conversion

  • Non-streaming: Azure responses unmarshal into BifrostImageGenerationResponse (superset of OpenAI; fields pass through)
  • Streaming: Server-Sent Events with the same event types as OpenAI image generation streaming

5) Video Generation

Azure routes video generation to OpenAI's Sora models via the Azure OpenAI-compatible endpoint. Parameters match OpenAI Video Generation. Bifrost upstream path: /openai/v1/videos.

OperationSupportedGateway endpoint
GenerateYesPOST /v1/videos
RetrieveYesGET /v1/videos/{id}
DownloadYesGET /v1/videos/{id}/content
DeleteYesDELETE /v1/videos/{id}
ListYesGET /v1/videos
RemixNoNot supported
curl -X POST http://localhost:8080/v1/videos \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_AZURE_API_KEY" \
  -d '{
    "model": "azure/sora",
    "prompt": "A calico cat playing piano on stage"
  }'

6) Files API

Files operations are supported for OpenAI models only (not Anthropic deployments on Azure). Bifrost routes file requests to upstream /openai/v1/files. Files are stored in Azure.

OperationSupport
UploadYes
ListYes
RetrieveYes
DeleteYes
Get ContentYes
curl -X POST http://localhost:8080/v1/files \
  -H "api-key: YOUR_AZURE_API_KEY" \
  -F "file=@document.pdf" \
  -F "purpose=assistants"

Gateway endpoints:

  • POST /v1/files (multipart upload)
  • GET /v1/files
  • GET /v1/files/{file_id}
  • DELETE /v1/files/{file_id}
  • GET /v1/files/{file_id}/content

7) List Models

Lists available models and deployments configured for your Azure key. No request parameters are required. Bifrost routes to upstream /openai/v1/models. The response includes model metadata, capabilities, and lifecycle status.

curl http://localhost:8080/v1/models

Example response shape

{
  "data": [
    {
      "id": "gpt-4",
      "object": "model",
      "created": 1687882411,
      "status": "active",
      "lifecycle_status": "stable",
      "capabilities": {
        "chat_completion": true,
        "embeddings": false
      }
    }
  ]
}

Implementation caveats

CaveatImpactSeverity
Deployment mapping requiredModels must be aliased to Azure deploymentsHigh
Responses API preview versionResponses uses preview API version; may differ from Chat Completions versionMedium
No batch supportBatch operations return UnsupportedOperationErrorMedium
Model auto-detectionBifrost detects OpenAI vs Anthropic and applies conversionLow
Anthropic beta headersValidated per deployment typeLow
Image variation unsupportedImage variation operation not available in AzureLow

Authoritative references

[ BIFROST FEATURES ]

Open Source & Enterprise

Everything you need to run AI in production, from free open source to enterprise-grade features.

01 Governance

SAML support for SSO and Role-based access control and policy enforcement for team collaboration.

02 Adaptive Load Balancing

Automatically optimizes traffic distribution across provider keys and models based on real-time performance metrics.

03 Cluster Mode

High availability deployment with automatic failover and load balancing. Peer-to-peer clustering where every instance is equal.

04 Alerts

Real-time notifications for budget limits, failures, and performance issues on Email, Slack, PagerDuty, Teams, Webhook and more.

05 Log Exports

Export and analyze request logs, traces, and telemetry data from Bifrost with enterprise-grade data export capabilities for compliance, monitoring, and analytics.

06 Audit Logs

Comprehensive logging and audit trails for compliance and debugging.

07 Vault Support

Secure API key management with HashiCorp Vault, AWS Secrets Manager, Google Secret Manager, and Azure Key Vault integration.

08 VPC Deployment

Deploy Bifrost within your private cloud infrastructure with VPC isolation, custom networking, and enhanced security controls.

09 Guardrails

Automatically detect and block unsafe model outputs with real-time policy enforcement and content moderation across all agents.

[ SHIP RELIABLE AI ]

Try Bifrost Enterprise with a 14-day Free Trial

[quick setup]

Drop-in replacement for any AI SDK

Change just one line of code. Works with OpenAI, Anthropic, Vercel AI SDK, LangChain, and more.

1import os
2from anthropic import Anthropic
3
4anthropic = Anthropic(
5 api_key=os.environ.get("ANTHROPIC_API_KEY"),
6 base_url="https://<bifrost_url>/anthropic",
7)
8
9message = anthropic.messages.create(
10 model="claude-3-5-sonnet-20241022",
11 max_tokens=1024,
12 messages=[
13 {"role": "user", "content": "Hello, Claude"}
14 ]
15)
Drop in once, run everywhere.