Documentation Index
Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
CometChat enforces rate limits to ensure fair usage and maintain service quality across all applications. These limits apply to API requests made to CometChat servers.
Global Rate Limits
| Operation Type | Rate Limit | Examples |
|---|
| Core operations | 10,000 requests/min | User connection, create/delete user, create/join/leave group |
| Standard operations | 20,000 requests/min | All operations not classified as core operations (e.g., sending messages, fetching conversations, updating profiles) |
| Build plan (free) | 500 requests/min | Applies to both core and standard operations |
Per-User Rate Limits
| Operation | Rate Limit | Notes |
|---|
| Send message | 30 messages/min | Per user limit for sending messages |
| Mark as unread | 5 requests/min | Per user limit for marking messages as unread |
Data Import Rate Limits
| Operation | Rate Limit | Notes |
|---|
| Data import | 60 requests/min | Rate limit for bulk data import operations |
Handling Rate Limits
When you exceed a rate limit, the API will return the following error:
| Error Code | Description |
|---|
ERR_TOO_MANY_REQUESTS | Too many requests. You have exceeded the rate limit. Please retry after the specified time. |
To handle rate limits gracefully:
- Implement exponential backoff when retrying failed requests
- Monitor your API usage to stay within limits
- Contact support if you need higher limits for your use case
When rate limited, the API returns HTTP 429 with these headers:
| Header | Description |
|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the rate limit window resets |
Retry-After | Seconds to wait before retrying |
Retry Strategy
if response.status == 429:
wait = response.headers['Retry-After'] or 60
sleep(wait)
retry()
Use exponential backoff with jitter for production implementations. Start with the Retry-After value, then double the wait on each subsequent 429 response, up to a maximum of 5 minutes.