Rate Limits

To ensure fair usage and protect the platform, the SilentChat API enforces rate limits on all endpoints. Limits are applied per authentication principal (user or API key) and vary by endpoint group.

Limits by Endpoint Group

GroupLimitWindowScope
Auth (/v1/auth/*)10 requests1 minutePer IP address
API (all other /v1/*)100 requests1 minutePer user / API key
Widget (/v1/widget/*)30 requests1 minutePer visitor session

Higher limits are available on the Business and Enterprise plans. Contact support if you need increased limits.

Rate Limit Headers

Every API response includes headers that let you track your current rate-limit status:

HeaderDescription
X-RateLimit-LimitThe maximum number of requests allowed in the current window.
X-RateLimit-RemainingThe number of requests remaining in the current window.
Retry-AfterOnly present on 429 responses. The number of seconds to wait before retrying.

Example Response Headers

HTTP/1.1 200 OK
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
Content-Type: application/json

Handling 429 Too Many Requests

When you exceed the rate limit the API responds with a 429 Too Many Requests status and includes a Retry-After header:

HTTP/1.1 429 Too Many Requests
Retry-After: 23
Content-Type: application/json

{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many requests. Please retry after 23 seconds.",
    "status": 429
  }
}

Recommended Retry Strategy

  1. Read the Retry-After header value (in seconds).
  2. Wait for that duration before retrying the request.
  3. If you continue to receive 429 responses, apply exponential backoff: double the wait time on each subsequent retry, up to a maximum of 60 seconds.

Example (JavaScript)

async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    const response = await fetch(url, options);

    if (response.status !== 429) {
      return response;
    }

    const retryAfter = parseInt(response.headers.get('Retry-After') || '5', 10);
    const delay = Math.min(retryAfter * 1000 * Math.pow(2, attempt), 60000);

    console.warn(`Rate limited. Retrying in ${delay / 1000}s...`);
    await new Promise((resolve) => setTimeout(resolve, delay));
  }

  throw new Error('Max retries exceeded');
}

Best Practices

  • Monitor the headers. Check X-RateLimit-Remaining and slow down when it approaches zero.
  • Batch where possible. Combine multiple operations into fewer API calls.
  • Cache responses. Avoid re-fetching data that has not changed.
  • Use webhooks instead of polling for real-time updates.
Rate Limits - SilentChat Docs