Skip to main content
Swarms API responses include rate limit headers whenever the rate limiter runs on the request. These headers let you monitor your usage programmatically — build retry logic, display quota dashboards, or throttle requests before hitting limits.
Rate limit headers are present on every response where the rate limiter ran — including 429 rate-limit rejections and /v1/rate/limits itself. Errors returned before rate limiting runs (such as 402 insufficient-credit or 403 premium-required rejections from the authentication layer) do not carry these headers.

Headers

Rate-limited responses include these headers:

Example Response Headers


Example 429 Response

When you exceed a rate limit, the response includes a Retry-After header:

Limits by Tier


Code Examples


Retry Logic

Use the Retry-After header to implement automatic retry on 429 responses:

Best Practices

  1. Check Remaining-Minute before sending requests — if it’s low, slow down or queue requests.
  2. Use Retry-After on 429s — don’t guess the wait time, the header tells you exactly how long.
  3. Log your tier — use X-RateLimit-Tier to confirm your account is on the expected plan.
  4. Build dashboards — track Remaining-Day over time to understand your usage patterns and plan upgrades.