concurrent-burst-rate-limit · EN · 2026-10-28

Firing a Burst of 50 Parallel Calls on One Key: Which Backend Returns 429 First and How to Queue Around It

When sending 50 parallel requests through a single API key, different backends (OpenAI, Anthropic, DeepSeek, etc.) will throttle at different points, often returning HTTP 429. This guide explains how to map each backend's rate-limit behavior under a burst and implement a client-side queue that respects each provider's limits, helping you avoid errors and maximize throughput.

Understanding Rate-Limit Responses

When you fire a burst of 50 parallel calls using one API key, each backend may enforce its own rate limits. A 429 (Too Many Requests) status is the standard signal that you've exceeded a limit. The exact threshold and recovery time vary by provider, model, and account tier.

Common rate-limit dimensions include:

  • Requests per minute (RPM) – total calls in a sliding window.
  • Tokens per minute (TPM) – input + output tokens processed.
  • Concurrent requests – some backends limit simultaneous connections.

Because your API aggregator routes to multiple backends (Claude, GPT, DeepSeek, Qwen, GLM, Kimi), each may return 429 independently. The first backend to throttle depends on which model you call and its current load.

Which Backend Returns 429 First?

There is no universal answer—it depends on the model and provider. However, you can empirically map behavior by sending controlled bursts and recording:

  • The response status and headers (e.g., Retry-After, X-RateLimit-* if present).
  • The time to first 429.
  • The number of successful requests before throttling.

Run a small test script that sends 50 parallel requests to each backend you plan to use. Log the results and note patterns. Some backends may throttle aggressively at low concurrency, while others allow bursts but enforce strict token limits.

Building a Client-Side Queue

A robust client should not blindly retry on 429; instead, it should proactively queue requests to stay within each backend's limits. Implement a per-backend queue with these features:

  • Concurrency limiter – cap the number of in-flight requests per backend.
  • Rate limiter – track requests and tokens over a sliding window.
  • Backoff and retry – on 429, pause the queue and retry with exponential backoff, honoring Retry-After if provided.
  • Priority handling – allow critical requests to jump the queue if needed.

Example Queue Logic (Pseudo-code)

class BackendQueue:
    def __init__(self, max_concurrent, rpm_limit, tpm_limit):
        self.semaphore = Semaphore(max_concurrent)
        self.rpm_limiter = SlidingWindow(rpm_limit)
        self.tpm_limiter = SlidingWindow(tpm_limit)

    async def submit(self, request):
        await self.rpm_limiter.acquire()
        await self.tpm_limiter.acquire(estimate_tokens(request))
        async with self.semaphore:
            response = await call_backend(request)
            if response.status == 429:
                await self.handle_429(response)
            return response

This ensures you never exceed the configured limits and gracefully handle unexpected throttling.

Handling 429 Responses Gracefully

When a 429 does occur:

  1. Check for Retry-After – if present, wait that many seconds before retrying.
  2. Use exponential backoff – start with a short delay and increase up to a maximum.
  3. Reduce concurrency – temporarily lower the concurrency limit for that backend.
  4. Log and monitor – track 429 rates to adjust your queue parameters over time.

Avoid immediate retries, as they can worsen throttling.

Best Practices for Multi-Backend Bursts

  • Separate queues per backend – each provider has distinct limits; don't mix them.
  • Start conservative – begin with low concurrency and gradually increase while monitoring 429s.
  • Use token estimation – estimate tokens before sending to avoid TPM limits.
  • Implement circuit breakers – if a backend consistently returns 429, pause and retry later.
  • Leverage aggregator features – some aggregators provide unified rate-limit headers or dashboards; use them if available.

Conclusion

Firing 50 parallel calls on one key requires understanding each backend's rate-limit behavior. By mapping 429 responses and building a client-side queue that respects per-backend limits, you can achieve high throughput without errors. Remember that your aggregator charges official price × 1.3 for usage, and contributors earn official price × 1.1 (or × 1.2 for premium models) in USDC—so efficient queuing also optimizes your cost.