Skip to content

Commit 1238efa

Browse files
committed
update
1 parent 0d03bc2 commit 1238efa

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

articles/ai-services/openai/quotas-limits.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ The following sections provide you with a quick guide to the default quotas and
5555

5656
<sup>1</sup> Our current APIs allow up to 10 custom headers, which are passed through the pipeline, and returned. Some customers now exceed this header count resulting in HTTP 431 errors. There's no solution for this error, other than to reduce header volume. **In future API versions we will no longer pass through custom headers**. We recommend customers not depend on custom headers in future system architectures.
5757

58-
## Regional quota limits
59-
6058
> [!NOTE]
6159
> Quota limits are subject to change.
6260
@@ -274,6 +272,41 @@ Quota increase requests can be submitted via the [quota increase request form](h
274272

275273
For other rate limits, [submit a service request](../cognitive-services-support-options.md?context=/azure/ai-services/openai/context/context).
276274

275+
## Regional quota capacity limits
276+
277+
You can view quota availability by region for your subscription in the [Azure AI Foundry portal](https://ai.azure.com/resource/quota).
278+
279+
Alternatively to view quota capacity by region you can query the [capacity API](/rest/api/aiservices/accountmanagement/model-capacities/list) for your subscription. Provide a `subscriptionId`, `model_name`, and `model_version` and the API will return the available capacity for that model across all regions, and deployment types for your subscription.
280+
281+
[API Reference](/rest/api/aiservices/accountmanagement/model-capacities/list)
282+
283+
```python
284+
import requests
285+
import json
286+
from azure.identity import DefaultAzureCredential
287+
288+
subscriptionId = "Replace with your subscription ID" #replace with your subscription ID
289+
model_name = "gpt-4o" # Example value, replace with model name
290+
model_version = "2024-08-06" # Example value, replace with model version
291+
292+
token_credential = DefaultAzureCredential()
293+
token = token_credential.get_token('https://management.azure.com/.default')
294+
headers = {'Authorization': 'Bearer ' + token.token}
295+
296+
url = f"https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/modelCapacities"
297+
params = {
298+
"api-version": "2024-06-01-preview",
299+
"modelFormat": "OpenAI",
300+
"modelName": model_name,
301+
"modelVersion": model_version
302+
}
303+
304+
response = requests.get(url, params=params, headers=headers)
305+
306+
print(json.dumps(model_capacities, indent=2))
307+
308+
```
309+
277310
## Next steps
278311

279312
Explore how to [manage quota](./how-to/quota.md) for your Azure OpenAI deployments.

0 commit comments

Comments
 (0)