
Groq API 429 Error: How to Find the Limit You Hit and Fix It
Also available in Hindi: यह लेख हिंदी में पढ़ें
Your Groq-powered app works in testing, then real users arrive and calls start failing with 429 Too Many Requests. Blind retries can make it worse. First find out which limit you hit, because each one has a different fix.
Which limit did you hit?
Groq measures several limits at once, and you are blocked by whichever runs out first:
- RPM / RPD: requests per minute and per day.
- TPM / TPD: tokens per minute and per day.
- ASH / ASD: audio seconds per hour and per day, for Whisper models.
Limits are set per model and apply to your whole organization, not to each user of your app. For example, the rate-limits page lists openai/gpt-oss-120b at 30 RPM, 1K RPD, 8K TPM and 200K TPD. Your exact numbers are on the Limits page in your Groq account settings. Cached tokens do not count toward the limits.
Read the headers
Every response carries x-ratelimit-* headers. Note the mix: the requests headers are per day (RPD), while the tokens headers are per minute (TPM). retry-after, in seconds, appears only on a 429.
Retry the right way
For per-minute limits, wait and retry with a little random jitter, so parallel workers do not all retry in the same second:
import os, time, random
from openai import OpenAI, RateLimitError
client = OpenAI(base_url="https://api.groq.com/openai/v1",
api_key=os.environ["GROQ_API_KEY"])
def chat(messages, tries=4):
for n in range(tries):
try:
return client.chat.completions.create(
model="openai/gpt-oss-120b", messages=messages)
except RateLimitError as e:
wait = float(e.response.headers.get("retry-after", 2 ** n))
time.sleep(wait + random.random())
raise RuntimeError("Still rate limited")
If you hit a daily limit, retrying will not help until that window resets.
Fixes for daily limits
- Send fewer tokens: trim chat history and cap
max_tokens. - Use a smaller model for simple steps such as routing or classification.
- Upgrade: the paid Developer plan has higher limits plus Batch and Flex processing.
- Flex: add
"service_tier": "flex"to a request. Paid customers get 10x the on-demand limits at the same price, but when capacity is short the request fails fast with status498(capacity_exceeded). Retry with jittered backoff.
Building a public app? Also limit each of your own users, as in our Upstash rate-limit guide. See how much an AI API costs, our OpenRouter guide for a backup provider, or the Groq tool page.
Sources
- Rate Limits, GroqDocs
- Flex Processing, GroqDocs
- API Error Codes and Responses, GroqDocs
- HTTP 429 rate_limit_exceeded (Groq), Inference APIs
FAQ
Why do I still get 429 after waiting a minute?
You probably hit a daily limit (RPD or TPD). Check the reset headers.
Are Groq limits per user or per account?
Per organization, with separate limits for each model.
Does retry-after appear on every response?
No. It is only set on a 429. The x-ratelimit headers are on every response.
What is error 498?
Flex tier capacity was full. Retry later with backoff.