HTTP 429 Rate Limit Exceeded — RPM/TPM Throttling Fix
Triggered when requests-per-minute or tokens-per-minute exceed key or upstream thresholds. Recover cleanly with jittered exponential backoff and worker queuing.
Need resilient routing with automatic multi-upstream failover and full request telemetry on API Store Hub?
Error runbook
| HTTP Status | 429 |
|---|---|
| Error type | rate_limit_exceeded |
| Retry policy | Retryable |
Triggered when requests-per-minute or tokens-per-minute exceed key or upstream thresholds. Recover cleanly with jittered exponential backoff and worker queuing.
Metadata & root causes
- Burst traffic from unthrottled parallel workers or batch cron jobs firing simultaneously.
- Oversized repeated prompts hitting tokens-per-minute (TPM) limits even at low RPM.
- Temporary peak load on a single target model lane.
3 steps to resolve
- Immediate diagnosis: Inspect the Retry-After header and log model ID plus request timestamp to measure real concurrency.
- Apply standard fix: Implement exponential backoff with random jitter (400ms → 800ms → 1600ms) capped at 3–4 attempts.
- Prevent recurrence in production: Bound concurrent workers with a semaphore and fail over to an equivalent secondary model on API Store Hub.
Production retry & recovery snippet
cURL
curl -i https://apistorehub.com/v1/chat/completions \
-H "Authorization: Bearer sk-ash-your_key" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"ping"}]}'Python
import random, time
from openai import OpenAI, RateLimitError
def call_with_backoff(client: OpenAI, model: str, fallback: str, messages: list):
for attempt in range(4):
try:
target = model if attempt < 2 else fallback
return client.chat.completions.create(model=target, messages=messages)
except RateLimitError:
if attempt == 3:
raise
time.sleep(min(20.0, (2 ** attempt) * 0.8 + random.uniform(0.1, 0.6)))Frequently asked questions
- Am I billed on API Store Hub when an HTTP 429 (rate_limit_exceeded) error occurs?
- No. Atomic pre-hold settlement on API Store Hub automatically releases any reserved amount for failed requests that return no valid completion.
- How do I tell whether the error originated from my client or upstream?
- 4xx codes (except 429) usually point to auth headers, wallet quota, or request payload formatting; 429/502/504/529 indicate load or transient upstream conditions visible on /status.
- Can I fall back to another model without changing SDKs?
- Yes. Pass the fallback model ID (e.g. across Claude, GPT, DeepSeek, or Gemini) inside your retry catch block using your existing sk-ash- API key.