azureOpenai() uses the openai SDK’s built-in AzureOpenAI class. All OpenAI features — tool calling, streaming, JSON mode, vision, reasoning — work identically to the direct openai() provider.Setup
- Install
- Environment
The Azure OpenAI provider uses the same OpenAI SDK:
Factory
Supported Models
Deploying models on Azure
Deploying models on Azure
You must create a deployment for each model in the Azure AI Studio portal. The deployment name becomes the
modelId (or you can use config.deployment). See Azure OpenAI docs for setup instructions.Config
Azure OpenAI endpoint URL. Falls back to
AZURE_OPENAI_ENDPOINT env var. Format: https://<resource-name>.openai.azure.comAuthentication Methods
Method 1: API Key (Recommended)
Method 2: Explicit Config
Tool Calling
Tool calling works identically to the direct OpenAI provider:Reasoning (GPT-5.6, GPT-6, o-series)
Samereasoning config as openai(). GPT-5.6 + tools uses Azure’s Responses API when your apiVersion supports it; otherwise Agentium falls back to Chat Completions with reasoning_effort: "none".
Multi-Modal Support
Azure OpenAI GPT-4o supports images, audio, and files — same as the direct OpenAI provider:Full Example
The tracker preserves reported usage. A missing tariff or billing field makestotal null. Supply a catalog that matches your billing provider, API, model or deployment, tier, and region; see cost accounting.
Azure OpenAI vs Direct OpenAI
Environment Variables
Cross-References
- OpenAI (Direct) — Direct OpenAI API with API key auth
- Azure AI Foundry — Open-source models (Phi, Llama, Mistral) on Azure
- Reasoning — GPT-5.6 / o-series reasoning and tools
- Multi-Modal — Provider support matrix