Lesson 1 of 4 Quotas, Cost and Monitoring for AI Workloads

Managing Quotas, Rate Limits and Scaling

This lesson explains quota, which governs model capacity in Azure, the rate limits derived from it, and the scaling patterns that let applications handle load without throttling errors.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain how tokens-per-minute quota and requests-per-minute limits are applied.
  • Choose a scaling pattern for steady or bursty demand.
  • Explain why agent workloads consume quota faster than single calls.
  • Diagnose 429 errors from metrics.

Quota and rate limits

A quota is the maximum amount of model capacity that a subscription may use. Azure sets quotas because model capacity in each region is shared by many customers, and quotas keep one workload from consuming all of it. A rate limit is the enforcement of that capacity on a single deployment: it caps how much traffic the deployment accepts each minute and rejects the excess.

For standard deployment types, quota is granted per subscription, region, model and deployment type in tokens per minute (TPM). When a deployment is created, part of that quota is assigned to it, and a requests-per-minute (RPM) limit is derived from the TPM allocation. Token counting for rate limiting includes the prompt and the maximum output tokens requested, so setting a realistic max_output_tokens lets more requests through. Provisioned deployments are limited by PTU capacity rather than TPM quota.

A request that exceeds the limit receives HTTP 429 Too Many Requests with a retry-after header. The Azure OpenAI client libraries retry automatically a limited number of times; applications should also use exponential backoff with jitter and avoid synchronized retries from many workers.

The following diagram shows how the requested maximum output changes the number of requests that fit in one minute of quota.

Rate limiting counts each request's prompt tokens plus the maximum output tokens it requests. With a 1,500-token prompt and max_output_tokens of 4,000, each request counts 5,500 tokens and 9 fit in a 50,000 TPM allocation. With max_output_tokens of 500, each counts 2,000 and 25 fit.
Rate limiting counts the prompt plus the requested maximum output, even when the model returns fewer tokens. Lowering an unrealistically high max_output_tokens lets more requests through the same quota.

The Quota page in the Foundry portal shows quota by subscription, region, model and deployment type. In the following screenshot, the chat-primary deployment holds 150K of the 1M tokens per minute of gpt-5.4-mini Global Standard quota available in the subscription.

Quota page showing gpt-5.4-mini, deployment chat-primary, Global Standard, shared allocation 150K of 1M TPM
Raising the deployment's rate limit uses more of the shared quota; requesting more quota raises the 1M limit.
Scenario questions

Work within quota

Exam skills 1.3.1

Practise how quota and rate limits work for standard deployments.

Log in to try this activity Interactive activities are free with an account.

Scaling patterns

Retries handle short bursts, but when 429 errors persist the application needs more capacity or less demand. Capacity can be added in several ways. The simplest is a quota increase for the model and region, which Microsoft may or may not approve. Moving to a Global or Data Zone deployment type gives a higher default quota because requests are spread across regions, provided the residency rules allow it. Several deployments, in different regions or resources, can be placed behind Azure API Management, which load-balances requests and fails over when one backend returns 429.

For steady, high volume, a provisioned deployment reserves capacity, and a spill-over configuration sends requests that exceed it to a standard deployment, so peaks are absorbed without errors. Demand can also be reduced: bulk work that does not need an immediate answer can move to a batch deployment, which has its own quota, and simple requests can be routed to a smaller model with its own quota. Steady demand favours provisioned capacity, while bursty demand favours Global Standard or several load-balanced deployments. The following table summarizes the patterns.

PatternHow it helpsConsideration
Request a quota increaseRaises TPM for the model and regionApproval is not guaranteed
Global or Data Zone deploymentHigher default quota, routing across regionsMust meet residency rules
Multiple deployments behind API ManagementLoad balancing and failover across regions or resourcesGateway to operate
Provisioned with spill-overReserved capacity; overflow goes to standardPTU cost whether used or not
Batch deployment for offline workMoves bulk traffic out of interactive quotaAsynchronous results
Smaller model for simple requestsLower tokens and separate quotaNeeds routing logic
Sort into groups

Add capacity

Exam skills 1.3.1

Choose the scaling pattern that fits each situation.

Log in to try this activity Interactive activities are free with an account.

Agent workloads

Agents consume quota faster than single calls because one user request may cause several model calls (planning, tool selection, final answer) and long contexts from conversation history and tool results. Limits on tool calls per run, summarizing long histories, retrieving fewer but better chunks and using a smaller model for routing steps keep agent token use, and therefore throttling, under control.

Worked example

Diagnosing throttling

An application on a Global Standard deployment with 100,000 TPM returns 429 errors at peak, although the Azure Monitor metrics show only about 60,000 tokens processed per minute. Each request sets max_output_tokens to 8,000, but typical answers are 300 tokens.

Rate limiting counts the requested maximum output tokens when the request arrives, so each request reserves far more capacity than it uses. Setting max_output_tokens close to the realistic maximum (for example 800) frees capacity without any quota increase. Adding retries alone would not fix the underlying waste.

Check yourself

Why can a high max_output_tokens setting cause throttling even when answers are short?

Show answer

Rate limiting counts the prompt tokens plus the requested maximum output tokens, so an unrealistically high maximum uses up the tokens-per-minute quota.

Exam Tips

Remember for the exam

  • HTTP 429 with retry-after: back off with jitter, then add or spread capacity.
  • Rate limiting counts prompt tokens plus requested max output tokens; set max_output_tokens realistically.
  • Steady load: provisioned with spill-over. Bursty load: Global Standard or several deployments behind API Management.