Skip to content

Commit 9711e4d

Browse files
Merge pull request #5190 from mrbullwinkle/mrb_05_22_2025_release_003
[Azure OpenAI] [Release Branch] API Lifecycle updates
2 parents 3fc48df + 7761d26 commit 9711e4d

File tree

1 file changed

+32
-23
lines changed

1 file changed

+32
-23
lines changed

articles/ai-services/openai/api-version-lifecycle.md

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: cognitive-services
55
manager: nitinme
66
ms.service: azure-ai-openai
77
ms.topic: conceptual
8-
ms.date: 05/22/2025
8+
ms.date: 05/25/2025
99
author: mrbullwinkle
1010
ms.author: mbullwin
1111
recommendations: false
@@ -23,10 +23,10 @@ This article is to help you understand the support lifecycle for Azure OpenAI AP
2323
2424
## API evolution
2525

26-
Historically, Azure OpenAI received monthly updates of new API versions. Taking advantage of new features required constantly updating code and environment variables with each new API release. Azure OpenAI also required the extra step of using Azure specific clients which created overhead when migrating code between OpenAI and Azure OpenAI. Starting in May 2025, you can now opt in to our next generation of Azure OpenAI APIs which add support for:
26+
Historically, Azure OpenAI received monthly updates of new API versions. Taking advantage of new features required constantly updating code and environment variables with each new API release. Azure OpenAI also required the extra step of using Azure specific clients which created overhead when migrating code between OpenAI and Azure OpenAI. Starting in May 2025, you can now opt in to our next generation of v1 Azure OpenAI APIs which add support for:
2727

2828
- Ongoing access to the latest features with no need to update `api-version` each month.
29-
- OpenAI client support with minimal code changes to swap between OpenAI and Azure OpenAI.
29+
- OpenAI client support with minimal code changes to swap between OpenAI and Azure OpenAI when using key-based authentication.
3030

3131
For the initial preview launch we are only supporting a subset of the inference API. While in preview, operations may have incomplete functionality that will be continually expanded.
3232

@@ -62,11 +62,11 @@ from openai import OpenAI
6262

6363
client = OpenAI(
6464
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
65-
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"
65+
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
66+
default_query={"api-version": "preview"},
6667
)
6768

68-
response = client.responses.create(
69-
extra_query={"api-version": "preview"},
69+
response = client.responses.create(
7070
model="gpt-4.1-nano", # Replace with your model deployment name
7171
input="This is a test.",
7272
)
@@ -76,9 +76,9 @@ print(response.model_dump_json(indent=2))
7676

7777
- `OpenAI()` client is used instead of `AzureOpenAI()`.
7878
- `base_url` passes the Azure OpenAI endpoint and `/openai/v1` is appended to the endpoint address.
79-
- `extra_query={"api-version": "preview"}` indicates that the version-less always up-to-date preview API is being used.
79+
- `default_query={"api-version": "preview"}` indicates that the version-less always up-to-date preview API is being used.
8080

81-
Once we release the GA next generation API, we will support two values `latest` and `preview`. If `api-version` is not passed traffic is automatically routed to the `latest` GA version. Currently only `preview` is supported.
81+
Once we release the GA next generation v1 API, we will support two values: `latest` and `preview`. If `api-version` is not passed traffic is automatically routed to the `latest` GA version. Currently only `preview` is supported.
8282

8383
# [Microsoft Entra ID](#tab/entra)
8484

@@ -108,33 +108,34 @@ print(response.model_dump_json(indent=2))
108108

109109
### Next generation API
110110

111+
111112
```python
112-
from openai import OpenAI
113+
from openai import AzureOpenAI
113114
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
114115

115-
token_credential = DefaultAzureCredential()
116-
token = token_credential.get_token('https://cognitiveservices.azure.com/.default')
116+
token_provider = get_bearer_token_provider(
117+
DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default"
118+
)
117119

118-
client = OpenAI(
119-
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
120+
client = AzureOpenAI(
121+
base_url = "https://docs-test-001-resource.openai.azure.com/openai/v1/",
122+
azure_ad_token_provider=token_provider,
123+
api_version="preview"
120124
)
121125

122126
response = client.responses.create(
123-
extra_headers={"Authorization": f"Bearer {token.token}"},
124-
extra_query={"api-version": "preview"},
125-
model="gpt-4.1-nano",
126-
input="This is a test.",
127+
model="gpt-4.1-nano",
128+
input= "This is a test"
127129
)
128130

129131
print(response.model_dump_json(indent=2))
130132
```
131133

132-
- `OpenAI()` client is used instead of `AzureOpenAI()`.
134+
- `AzureOpenAI()` is used to take advantage of automatic token refresh provided by `azure_ad_token_provider`.
133135
- `base_url` passes the Azure OpenAI endpoint and `/openai/v1` is appended to the endpoint address.
134-
- `extra_headers={"Authorization": f"Bearer {token.token}"}` passes the Microsoft Entra ID token to handle secure authentication.
135-
- `extra_query={"api-version": "preview"}` indicates that the version-less always up-to-date preview API is being used.
136+
- `api-version="preview"` indicates that the version-less always up-to-date preview API is being used.
136137

137-
Once we release the GA next generation API, we will support two values `latest` and `preview`. If `api-version` is not passed traffic is automatically routed to the `latest` GA version. Currently only `preview` is supported.
138+
Once we release the GA next generation v1 API, we will support two values: `latest` and `preview`. If `api-version` is not passed traffic is automatically routed to the `latest` GA version. Currently only `preview` is supported.
138139

139140
# [REST](#tab/rest)
140141

@@ -260,11 +261,19 @@ curl -X POST "https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/responses?ap
260261

261262
Azure OpenAI API latest releases:
262263

263-
- [**NEW** Preview API]()
264+
- [**NEW** v1 Preview API](reference-preview-latest.md)
264265
- Inference: [2025-04-01-preview](reference-preview.md)
265266
- Authoring: [2025-04-01-preview](authoring-reference-preview.md)
266267

267-
## Changes between
268+
## Changes between v1 preview release and 2025-04-01-preview
269+
270+
- [v1 preview API](#api-evolution)
271+
- [Video generation support](./concepts/video-generation.md)
272+
- **NEW** Responses API features:
273+
* Remote Model Context Protocol (MCP) servers tool integration
274+
* Support for asynchronous background tasks
275+
* Encrypted reasoning items
276+
* Image generation
268277

269278
## Changes between 2025-04-01-preview and 2025-03-01-preview
270279

0 commit comments

Comments
 (0)