# What is Azure OpenAI, and how is it different from OpenAI's own API?

OpenAI's models run by Microsoft inside Azure, now part of Microsoft Foundry. Same models and SDK as OpenAI's API, but your data stays with Microsoft, under your Azure agreement.

- Page: https://tecyfy.com/concepts/azure-openai
- Subject: How AI works (https://tecyfy.com/concepts)
- Level: beginner
- Also called: Azure OpenAI Service, Azure OpenAI in Foundry Models

OpenAI's models can be reached 2 ways: from OpenAI, or from Microsoft's Azure. Azure OpenAI is the second. The model is the same; who runs it, where your data goes and which contract covers it are not.

## What changes when Microsoft runs it

- **Who sees the data.** Microsoft hosts the models in Azure and, by its own documentation, prompts and answers are not available to OpenAI and are not used to train models.
- **Sign-in.** Calls can be signed with Microsoft Entra ID, the company's existing identities, instead of a shared API key.
- **Networking.** Traffic can stay on a private network in Azure.
- **Where it runs.** A deployment can be global, limited to a data zone (US, EU or Asia Pacific), or one region, and stored data stays in the chosen geography.
- **The agreement.** It is covered by the company's Microsoft agreement, which often already has data protection terms signed.

## Deployments, not model names

On Azure, you first **deploy** a model in your resource and give the deployment a name. Code then asks for the deployment, not the model:

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
    api_key="...",            # or an Entra ID token provider
)
response = client.responses.create(model="my-gpt-deployment", input="Hello")
```

This is the v1 API: the plain OpenAI SDK with a different address, and no dated `api-version`. Older code using `AzureOpenAI(...)` with an `api_version` still works.

## Capacity

Capacity is a quota in tokens per minute, per subscription, region, model and deployment type, which you divide between deployments. Requests per minute follow from it. As on OpenAI, the `max_tokens` you ask for counts toward the [limit](https://tecyfy.com/concepts/rate-limit) when a request is checked, so asking for far more than you need wastes quota. A second region adds quota; a Provisioned deployment reserves throughput.

## Part of Foundry now

Azure OpenAI is now one part of [Microsoft Foundry](https://tecyfy.com/concepts/microsoft-foundry), next to models from Anthropic, Meta and others, agents and their tools. An existing Azure OpenAI resource can be upgraded to a Foundry resource while keeping its address and keys.

Our article [Azure OpenAI vs OpenAI](/blog/azure-openai-vs-openai) puts the 2 side by side, with the code and data rules of each.

## Related

- [Microsoft Foundry](https://tecyfy.com/concepts/microsoft-foundry): Microsoft's Azure platform for AI apps and agents, formerly Azure AI Foundry and Azure AI Studio: one resource to deploy models from many makers, build agents and govern both.
- [Large Language Model](https://tecyfy.com/concepts/large-language-model): A model trained on a huge amount of text to predict the next token. Further training turns it into an assistant that follows instructions.
- [API](https://tecyfy.com/concepts#api): Application Programming Interface - a set of protocols and tools for building software applications
- [Rate Limit](https://tecyfy.com/concepts/rate-limit): The most an API lets you send in a period, counted in requests and tokens per minute. Past it, requests fail with a 429 error until capacity comes back, so code waits and retries.

## Sources

- [Data, privacy, and security for Azure Direct Models in Microsoft Foundry](https://learn.microsoft.com/en-us/azure/foundry/responsible-ai/openai/data-privacy)
- [Azure OpenAI API version lifecycle](https://learn.microsoft.com/en-us/azure/foundry/openai/api-version-lifecycle)
- [Manage Azure OpenAI quota](https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/quota)
- [Deployment types for Microsoft Foundry Models](https://learn.microsoft.com/en-us/azure/foundry/foundry-models/concepts/deployment-types)
