> ## Documentation Index
> Fetch the complete documentation index at: https://docs.profclaw.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure OpenAI

> Use GPT-4o and other OpenAI models via Azure OpenAI Service. Enterprise SLAs, private networking, and data residency.

Azure OpenAI Service provides access to OpenAI's models through Microsoft's Azure infrastructure. It offers enterprise features including private networking, compliance certifications, and data residency guarantees.

## Overview

Azure OpenAI differs from the standard OpenAI API:

* Models are deployed to your own Azure resource
* Access via your Azure resource endpoint, not `api.openai.com`
* Models are referenced by deployment names you define
* Supports both standard resource mode and Azure AI Foundry (custom base URL)

## Supported Models

Any OpenAI model available in Azure can be deployed. Common deployments:

| Deployment | Model | Notes |
| - | - | - |
| `gpt-4o` | GPT-4o | Most common |
| `gpt-4o-mini` | GPT-4o Mini | Cost-efficient |
| `o1` | o1 | Reasoning |
| `gpt-4-turbo` | GPT-4 Turbo | Legacy |

All Azure-deployed models support native tool calling - profClaw assumes tool support for all Azure models.

## Setup

**1. Create an Azure OpenAI resource**

In the Azure Portal, create an Azure OpenAI resource and deploy a model.

**2. Get your credentials**

From your Azure OpenAI resource, copy:

* API key (under **Keys and Endpoint**)
* Endpoint URL or Resource Name
* Deployment name

**3. Set environment variables**

**Option A - Resource Name mode (standard):**

```bash theme={null}
AZURE_OPENAI_API_KEY=your-key
AZURE_OPENAI_RESOURCE_NAME=your-resource-name
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
```

**Option B - Base URL mode (AI Foundry / custom endpoint):**

```bash theme={null}
AZURE_OPENAI_API_KEY=your-key
AZURE_OPENAI_BASE_URL=https://your-resource.openai.azure.com
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
```

**4. Verify**

```bash theme={null}
profclaw doctor --provider azure
```

## Environment Variables

**AZURE\_OPENAI\_API\_KEY** `string` *required*

Your Azure OpenAI API key.

**AZURE\_OPENAI\_RESOURCE\_NAME** `string`

Your Azure OpenAI resource name (e.g., `my-openai-resource`). Used in standard mode.

**AZURE\_OPENAI\_BASE\_URL** `string`

Full endpoint URL (e.g., `https://my-resource.openai.azure.com`). Used in AI Foundry / custom endpoint mode. Takes precedence over `AZURE_OPENAI_RESOURCE_NAME`.

**AZURE\_OPENAI\_ENDPOINT** `string`

Alias for `AZURE_OPENAI_BASE_URL`.

**AZURE\_OPENAI\_DEPLOYMENT\_NAME** `string`

Default deployment name to use when no model is specified.

**AZURE\_OPENAI\_API\_VERSION** `string`

API version to use. Defaults to `2024-10-21`.

## Configuration Example

> [tab] Resource Name mode
>
> ```bash theme={null}
> AZURE_OPENAI_API_KEY=abc123
> AZURE_OPENAI_RESOURCE_NAME=my-openai
> AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
> AZURE_OPENAI_API_VERSION=2024-10-21
> ```

> [tab] Base URL mode
>
> ```bash theme={null}
> AZURE_OPENAI_API_KEY=abc123
> AZURE_OPENAI_BASE_URL=https://my-openai.openai.azure.com
> AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
> ```

> [tab] settings.yml
>
> ```yaml theme={null}
> providers:
>   azure:
>     api_key: "${AZURE_OPENAI_API_KEY}"
>     resource_name: "${AZURE_OPENAI_RESOURCE_NAME}"
>     deployment_name: "${AZURE_OPENAI_DEPLOYMENT_NAME}"
>     api_version: "2024-10-21"
> ```

## Model Aliases

| Alias | Resolves To |
| - | - |
| `azure` | Your configured deployment |
| `azure-gpt` | Your configured deployment |

When using the `azure` or `azure-gpt` alias, profClaw uses the deployment name from `AZURE_OPENAI_DEPLOYMENT_NAME`.

## Usage Examples

```bash CLI theme={null}
# Uses your configured deployment
profclaw chat --model azure "Review this architecture"

# Specific deployment by name
profclaw chat --model azure/gpt-4o "Explain this code"
```

```typescript SDK theme={null}
import { chat } from 'profclaw';

const response = await chat("Analyze this data", {
  model: "azure",
});
```

## Notes

* Azure is ranked 3rd in auto-selection priority after Anthropic and OpenAI.
* All Azure GPT-4+ deployments support native tool calling.
* For private network setups, configure a custom base URL pointing to your private endpoint.
* API version `2024-10-21` is the minimum supported for function calling with structured outputs.

## Related

* [AI Providers Overview](https://docs.profclaw.ai/ai-providers/overview.md) - Compare all 37 supported providers
* [OpenAI](https://docs.profclaw.ai/ai-providers/openai.md) - Direct OpenAI API without Azure infrastructure
* [Amazon Bedrock](https://docs.profclaw.ai/ai-providers/amazon-bedrock.md) - AWS-native alternative for enterprise deployments
* [profclaw provider](https://docs.profclaw.ai/cli/provider.md) - Add and test providers from the CLI


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.