Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

AI and LLM integration · Comparison

Amazon Bedrock returns ThrottlingException 429 under load

Short answer

Bedrock's ThrottlingException (HTTP 429) with Your request rate is too high, Too many requests or Too many tokens means your account went over a per-model quota in that Region. Token quotas count input tokens plus the full max_tokens when a request starts, so lower max_tokens first, add adaptive retries in boto3, then request a higher quota through AWS Support.

  • Applies to Amazon Bedrock Runtime (bedrock-runtime endpoint), boto3 1.44, AWS CLI v2
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Bedrock returns the same exception class, ThrottlingException with HTTP 429, for several different limits. The sentence after the colon tells you which quota you hit, and the right fix is different for each. Retrying harder against a quota that is simply too small, or against tokens reserved by an oversized maxTokens, wastes time.

The table lists the messages and the first thing to change. The sections below explain the two that surprise people most: how tokens are reserved at the start of a call, and what the default retry policy does in a burst.

At a glance

Bedrock throttling messages and the first fix for each
MessageWhat ran outFirst fix
Your request rate is too high. Reduce the frequency of requests.Requests per minuteAdaptive retries, spread the calls
Too many requests, please wait before trying again.Requests per minuteAdaptive retries, spread the calls
Too many tokens, please wait before trying again.Tokens per minuteLower maxTokens to the real reply size
Too many tokens per day, please wait before trying again.Tokens per dayQuota increase through AWS Support

Find the quota values that apply to you

Note which message you got, then list the numbers for the Region you call. Bedrock can assign an account a lower value than the published default, depending on the Region and on account age and usage history, so the table in your account is the truth, not the documentation page.

Per-minute and per-day quotas in one Region

aws service-quotas list-service-quotas --service-code bedrock --region us-east-1 \
  --query "Quotas[?contains(QuotaName, 'per minute')].[QuotaName,Value]" --output table
aws service-quotas list-service-quotas --service-code bedrock --region us-east-1 \
  --query "Quotas[?contains(QuotaName, 'per day')].[QuotaName,Value,Adjustable]" --output table

Tokens are reserved before the reply exists

When a request starts, Bedrock deducts the input tokens plus the whole max_tokens value from the tokens-per-minute quota, and returns the unused part when the call ends. If you leave maxTokens unset in Converse, the model's maximum is used, so a few parallel calls can fill the quota even though each reply is short. For some models, output tokens also count several times against the quota (the burndown rate), so short replies help twice.

Size maxTokens just above the longest reply you really need. The OutputTokenCount metric per model, in CloudWatch, shows the real distribution.

An explicit maxTokens on Converse

import boto3

client = boto3.client("bedrock-runtime", region_name="us-east-1")
resp = client.converse(
    modelId="your-model-or-inference-profile-id",
    messages=[{"role": "user", "content": [{"text": "Summarise this ticket"}]}],
    inferenceConfig={"maxTokens": 800},   # near the real reply size
)

Bursts and the default retry policy

Request-rate throttles come from how often you call, usually when a batch job, a thread pool or several workers start at the same moment. boto3's default retry mode makes only three attempts in total, which a burst uses up quickly. Adaptive mode adds client-side rate limiting on top of backoff, and the attempt count can be raised.

Share one client per process rather than creating many in worker threads, since the rate limiter works per client. Spread scheduled jobs across the minute instead of starting them on the hour.

Adaptive retry mode with a higher attempt count

import boto3
from botocore.config import Config

config = Config(retries={"total_max_attempts": 10, "mode": "adaptive"})
client = boto3.client("bedrock-runtime", region_name="us-east-1", config=config)

When the quota is simply too small

Increases are not granted automatically, and some quotas are fixed. If the numbers in your account are below what the workload needs, ask AWS Support or your account manager, and file the request before a launch or a backfill. Give them the facts they need to decide: the quota name, the current and required value, the model ID, the Region, and expected steady and peak usage.

While you wait, a cross-Region inference profile, if the model offers one, can spread load across Regions.

What to put in the increase request

Quota name:          <row from the quota table>
Current / required:  <value> / <value>
Model ID:            <model or inference profile ID>
Region:              us-east-1
Use case:            <one line>
Steady / peak:       <tokens and requests per minute, from CloudWatch>
Average per request: <input tokens> in, <output tokens> out

A 503 or 529 is a different problem

ServiceUnavailable (503) or an overloaded error means the model's shared capacity is busy, not that your own quota is used up. Retry with jitter there, and consider cross-Region inference.

Which to pick

  • Read the message: requests, tokens per minute or tokens per day.
  • Set maxTokens close to the real reply size; the whole value is reserved at the start.
  • Use adaptive retries and one shared client for request-rate throttles.
  • A quota that is too small needs a support request, not more retries.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Next step

Want a second pair of eyes on it?

Send me the error and what changed before it started. I reply within 24 hours.