infrastructure

Rate Limits

Understand API rate limits by account tier and how to handle them.

Rate limits protect the API from abuse and ensure fair access for all users. Limits are applied per API key.

Where limits come from

Rate limits are configured per API key, not by a fixed plan. When a key is issued we include its RPM (requests per minute), TPM (tokens per minute) and concurrency ceiling; the values depend on your actual usage and how you are connected.

To adjust them, write to support@linkwo.com with your current QPS and peak pattern — there is no plan to switch.

RPM and TPM are independent — you may hit either one first.

Rate Limit Headers

Every API response includes headers indicating your current usage:

HeaderDescription
x-ratelimit-limit-requestsMax requests per minute
x-ratelimit-limit-tokensMax tokens per minute
x-ratelimit-remaining-requestsRemaining requests in current window
x-ratelimit-remaining-tokensRemaining tokens in current window
x-ratelimit-reset-requestsSeconds until request limit resets
x-ratelimit-reset-tokensSeconds until token limit resets

Handling Rate Limits

429 Response

When you exceed a rate limit, the API returns a 429 Too Many Requests response:

{
  "error": {
    "message": "Rate limit exceeded",
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded"
  }
}

Retry Strategy

Implement exponential backoff when receiving 429 errors:

import time

def api_call_with_retry(client, max_retries=5, **kwargs):
    for attempt in range(max_retries):
        try:
            return client.chat.completions.create(**kwargs)
        except Exception as e:
            if "rate_limit" in str(e) and attempt < max_retries - 1:
                wait_time = (2 ** attempt) + 1
                time.sleep(wait_time)
            else:
                raise

Best Practices

  • Monitor headers — Track x-ratelimit-remaining-* to anticipate limits
  • Batch requests — Reduce the number of API calls by batching where possible
  • Cache responses — Avoid duplicate requests for the same content
  • Upgrade tier — Contact sales for higher limits
  • Use streaming — Streaming responses consume tokens gradually, reducing burst TPM

Model-Specific Limits

Some high-demand models may have lower effective rate limits during peak usage. Check the response headers for real-time limits.

Upgrading

To increase your rate limits, contact support@linkwo.com to upgrade to a higher tier. Enterprise customers can request custom limits.