Skip to main content

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 TypeRate LimitExamples
Core operations10,000 requests/minUser connection, create/delete user, create/join/leave group
Standard operations20,000 requests/minAll operations not classified as core operations (e.g., sending messages, fetching conversations, updating profiles)
Build plan (free)500 requests/minApplies to both core and standard operations

Per-User Rate Limits

OperationRate LimitNotes
Send message30 messages/minPer user limit for sending messages
Mark as unread5 requests/minPer user limit for marking messages as unread

Data Import Rate Limits

OperationRate LimitNotes
Data import60 requests/minRate limit for bulk data import operations

Handling Rate Limits

When you exceed a rate limit, the API will return the following error:
Error CodeDescription
ERR_TOO_MANY_REQUESTSToo many requests. You have exceeded the rate limit. Please retry after the specified time.
To handle rate limits gracefully:
  1. Implement exponential backoff when retrying failed requests
  2. Monitor your API usage to stay within limits
  3. Contact support if you need higher limits for your use case

Rate Limit Response Headers

When rate limited, the API returns HTTP 429 with these headers:
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the rate limit window resets
Retry-AfterSeconds 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.