Quotas, Rate Limits, Scaling and Cost
30-second answer
Quota is tokens per minute (TPM) for each model, deployment type and region in a subscription. Each deployment takes a slice of it, and requests per minute (RPM) come with the slice (about 6 RPM per 1,000 TPM for OpenAI models). Go past the limit and the service answers HTTP 429 with a retry-after header. Handle it with exponential backoff and retry, split load across deployments or regions, use Provisioned throughput for steady load with spillover to a standard deployment for peaks, and control spend with token budgets, cost alerts, smaller models, shorter prompts and caching.
Simulate it » No Azure account neededExam objective: 1.3.1 Manage quotas, scaling, rate limits and cost footprints for model and agent workloads. (Skills measured as of April 16, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Open <strong>Operate ➜ Quota</strong>. Quota belongs to the <strong>subscription</strong>, per <strong>region</strong>, per <strong>model</strong>, per <strong>deployment type</strong>, in <strong>tokens per minute</strong>. Each deployment takes a slice.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Open Operate ➜ Quota. Quota belongs to the subscription, per region, per model, per deployment type, in tokens per minute. Each deployment takes a slice.
- Traffic grew, and clients see 429 Too Many Requests. Raise the deployment's TPM from 50K to 120K. RPM rises with it (for older chat models, 6 RPM per 1,000 TPM).
- The 429 spike lines up with lunchtime. Retries smooth short bursts; steady growth needs more TPM or a provisioned deployment.
- For steady, latency-sensitive traffic, buy provisioned throughput units (PTUs) and turn on spillover so peaks go to the standard deployment instead of failing.
- Now cap the spend. Search for Cost Management and open Budgets.
- Type budgets in the search bar and pick Cost Management under Services.
- A budget warns, it doesn't stop anything. Set it on the resource group or filter to the Foundry resource.
- Alert at 80% actual and 100% forecast. Pair it with smaller models, prompt caching and Batch for overnight jobs to bring the number down.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Quotas, 429s, spillover and budgets
Quota is tokens per minute per model, per region, per deployment type. Each deployment gets a slice; RPM comes with it. Go over and you get HTTP 429 with a retry-after header. Provisioned throughput can spill over to a standard deployment, and a cost control can stop a project at its token budget.
🤔 What happens if…
Read this tour as text
- Pick the right model or tool. A router in your app sends each job to the cheapest thing that does it well: a reasoning model for multistep problems, a small language model for high-volume labelling, a multimodal model for photos, and a Foundry Tool such as Content Understanding for invoices.
- Where an agent gets its facts. Curated company content lives in a Foundry IQ knowledge base on Azure AI Search. Files a user drops into the chat go to file search. What the agent learns about the user across sessions goes to memory (user profile, chat summary).
- Resource, projects and deployment types. One Foundry resource holds deployments, networking and keys. Projects inside it isolate teams. Global deployments may process anywhere, Data Zone stays in the EU or US zone, Standard stays in one region. The standard agent setup keeps threads, files and vectors in your own Cosmos DB, Storage and AI Search.
- Configure deployments and agent versions. A deployment pins a model, a model version, a deployment type, capacity (TPM) and a guardrail. An agent gets a new version every time you change it; the endpoint serves the version you choose, so you can roll back.
- CI/CD with an evaluation gate. The agent definition, prompts and Bicep live in Git. The pipeline signs in with workload identity federation (no secret), runs an evaluation on a test set, and only then promotes from dev to test to prod projects.
- Quotas, 429s, spillover and budgets. Quota is tokens per minute per model, per region, per deployment type. Each deployment gets a slice; RPM comes with it. Go over and you get HTTP 429 with a retry-after header. Provisioned throughput can spill over to a standard deployment, and a cost control can stop a project at its token budget.
- Monitor models, agents and search. Azure Monitor metrics show requests, tokens, latency and errors. Application Insights holds traces, and continuous evaluation scores a sample of live answers for groundedness and safety. For Azure AI Search, watch indexer runs, document counts, search latency and throttled queries.
- Keyless and private. The app uses a managed identity and Microsoft Entra ID tokens, with the Foundry User role on the resource. Local (key) auth is turned off. Public network access is disabled and a private endpoint in your VNet is the only way in.
- Guardrails at four intervention points. A guardrail is a set of controls: a risk (hate, violence, prompt attacks, indirect attacks, protected material, PII), the intervention point (user input, tool call, tool response, output) and the action (annotate, or annotate and block).
- Evaluate, red team and trace. Evaluators score answers: groundedness, relevance, coherence, safety, and agent ones like tool call accuracy and task adherence. The AI red teaming agent attacks before launch. Traces in Application Insights record every model call, tool call and approval for audit.
- Govern what the agent may do. Give the agent only the tools it needs (allowed tools), make risky tools require approval from a human, let the tool call guardrail check what it sends, and limit where a hosted agent can connect with network egress controls.
Traffic triples at noon and users see errors. Read quota, reproduce the 429s, fix them three ways, set a token budget, then check metrics, evaluation scores and the search index.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
At lunchtime the chatbot returns 429 errors, and at month end the bill doubles.
😊 THE SOLUTION
Size TPM, retry politely, add provisioned throughput with spillover and set budgets.
- HTTP 429 at peak✓ More TPM, or retry-after with backoff
- Steady high volume✓ PTUs with spillover
- Runaway spend✓ Budgets and project cost controls
Start with a question
Why do users see errors at noon when the app was fine all morning?
The support bot runs on a deployment with 10K tokens per minute, which is about 60 requests a minute. At 9 AM traffic is light. At noon every branch opens at once, the app sends 300 requests a minute, and 240 of them come back with 429 Too Many Requests.
Nothing is broken. The deployment is doing what it was configured to do. The job is to decide whether to wait, to add capacity, or to send the overflow somewhere else.
Explain it like I’m 10
The technical explanation
Quota and the slice per deployment
Quota is assigned per subscription, per region, per model and deployment type, in thousands of tokens per minute. When you create a deployment you choose its TPM, and that comes out of the quota. The matching RPM is about 6 per 1,000 TPM for OpenAI models.
- Portal: Foundry portal → Quota (or Azure portal → Foundry resource → Quotas) shows used and remaining per model and region. Request more with the quota request form.
- CLI:
az cognitiveservices usage list --location eastus.
Deployments share quota. A new deployment shrinks what’s left, and deleting one releases it.
When you exceed the limit
The endpoint returns 429 with a retry-after header. Handle it in the client:
import random, time
from openai import RateLimitError
def call_with_backoff(fn, tries=6):
for n in range(tries):
try:
return fn()
except RateLimitError as e:
wait = float(e.response.headers.get("retry-after", 2 ** n)) + random.random()
time.sleep(wait)
raise RuntimeError("Still throttled after retries")
The Azure SDKs and the OpenAI client already retry a few times. Tune them, and don’t add loops that retry instantly.
Scale options
| Option | Use it when |
|---|---|
| Increase the deployment’s TPM | You have spare quota and the load is persistent |
| Request more quota | The subscription’s quota is the limit |
| Another deployment or region | Quota is exhausted in one region. Load balance in the app or with a gateway such as Azure API Management |
| Provisioned throughput (PTU) | Steady high volume that needs predictable latency |
| Spillover | A provisioned deployment is full. Overflow goes to a standard deployment instead of failing |
| Batch | The work can wait up to 24 hours |
Control cost
- Measure: token counts in Azure Monitor per deployment, and Cost analysis for the resource group.
- Choose smaller models for easy tasks (previous lesson).
- Trim the prompt: shorter system messages, fewer retrieved chunks, summaries of long history.
- Cache: repeated prompt prefixes can be cached by the service.
- Budget and alert: set an Azure budget with alerts at, say, 80%, and a project-level token limit where available. Tags on resources show which team spent what.
Architect level Why sizing PTUs for the peak is a trap
Provisioned throughput is billed for the capacity you reserve, used or not. If the peak is three times the base load, reserving for the peak means you pay for two thirds of it to sit idle most of the day. Size PTUs for the steady base and let spillover handle the peaks on pay-per-token capacity. Re-check the split every month, because both lines move.
Real-world business scenario
Contoso Retail (fictional)
- The problem
- Every lunchtime promotion pushed the shopping assistant into 429 errors, and the monthly bill was a surprise.
- What they used
- Client retry with exponential backoff and jitter, a provisioned deployment sized for the steady base with spillover to a Global Standard deployment, prompt caching for the long product policy prefix, and a budget with alerts at 80% and 100%.
- Why that choice
- Backoff absorbed short bursts, provisioned throughput gave steady latency, spillover covered promotions, and alerts showed the trend before the invoice did.
- The result
- Errors during promotions stopped, and the finance team could see token spend by team every week.
When to use it and when not to
✓ Use it when…
- Load is steady and high, so reserved capacity pays off (provisioned).
- Peaks are short and can overflow to pay-per-token (spillover).
- Several teams share a subscription and need budgets and tags.
✕ Think twice when…
- You retry in a tight loop without backoff.
- You size provisioned capacity for the peak.
- You leave unused deployments holding quota.
↔ Alternatives to consider
- Azure API Management as a gateway to balance across deployments and regions.
- Global Batch for work that can wait.
- A smaller model when the task allows it.
Test yourself with exercises
5 original practice questions in the AI-103 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What does an HTTP 429 from a model endpoint mean?
Model answer
I've gone over the tokens-per-minute or requests-per-minute limit for that deployment. The retry-after header says how long to wait. The fix is to back off and retry, or to give the deployment more capacity.
Intermediate How do you split quota between deployments?
Model answer
Quota is per subscription, model, deployment type and region. Each deployment gets a slice of it, so giving one deployment more leaves less for others. I'd give production the larger slice, keep a small one for tests, and delete unused deployments to release quota.
Experienced developer When would you choose provisioned throughput with spillover?
Model answer
When the base load is steady and high enough that reserved PTUs are cheaper than pay-per-token, and the app needs steady latency. I size the PTUs for the base load, not the peak, and enable spillover so peak requests go to a standard deployment instead of failing.
Scenario Costs doubled after a feature launch and nobody knows why. What do you check?
Model answer
Token metrics per deployment and per project in Azure Monitor and cost analysis, to find which deployment grew. Then the prompts: long system messages, large retrieved context, and loops of tool calls. I'd cut context, cache the stable prefix, move easy tasks to a smaller model, and set a token budget with alerts so the next jump is seen early.
Quick revision
Key points
- Quota is TPM per model, deployment type and region. Deployments take slices of it.
- RPM comes with the TPM slice. Exceeding either gives HTTP 429.
- Handle 429 with retry-after, exponential backoff and jitter.
- Provisioned throughput gives steady latency, and spillover sends peak overflow to a standard deployment.
- Control cost with budgets and alerts, smaller models, shorter context and caching.
Important terminology
- Quota
- The tokens-per-minute allowance a subscription has for a model and deployment type in a region. Deployments are carved out of it.
- TPM and RPM
- Tokens per minute and requests per minute. A deployment has both limits, and a request is throttled when either is exceeded.
- HTTP 429
- The status a Foundry endpoint returns when you exceed a rate limit. The retry-after header says how long to wait.
- Exponential backoff
- A retry pattern that waits longer after each failed attempt, often with random jitter, so clients don't all retry at once.
- Spillover
- A setting that sends overflow requests from a full provisioned deployment to a standard deployment instead of returning 429.
- Prompt caching
- Reusing the processed beginning of a prompt that repeats between requests, which lowers latency and the cost of the repeated input tokens.
Common mistakes
- Retrying instantly in a tight loop, which makes throttling worse.
- Sizing provisioned capacity for the peak and paying for idle PTUs.
- Leaving test deployments running, so they hold quota.
Exam tips
- "Requests fail with 429 at peak" = backoff and retry, more capacity, or spillover.
- "Steady, high volume, predictable latency" = Provisioned.
- "Stop unexpected spend" = budget and alerts.
- "Lower cost per request without changing the model" = shorter prompts and caching.
Five quick revision questions
-
1.What does the retry-after header tell you?Show
How many seconds to wait before retrying.
-
2.What is quota measured in?Show
Tokens per minute.
-
3.What does spillover do?Show
Sends overflow from a provisioned deployment to a standard deployment.
-
4.Which limits can trigger a 429?Show
Either tokens per minute or requests per minute.
-
5.Which retry pattern avoids retry storms?Show
Exponential backoff with jitter.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Monitor Models, Agents and Search Indexes
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.