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
| Group | Limit | Window | Scope |
|---|---|---|---|
Auth (/v1/auth/*) | 10 requests | 1 minute | Per IP address |
API (all other /v1/*) | 100 requests | 1 minute | Per user / API key |
Widget (/v1/widget/*) | 30 requests | 1 minute | Per 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:
| Header | Description |
|---|---|
X-RateLimit-Limit | The maximum number of requests allowed in the current window. |
X-RateLimit-Remaining | The number of requests remaining in the current window. |
Retry-After | Only 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/jsonHandling 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
- Read the
Retry-Afterheader value (in seconds). - Wait for that duration before retrying the request.
- If you continue to receive
429responses, 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-Remainingand 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.