AI Integration Quick Reference
AI Integration Quick Reference
- Core Operations (login, create/delete user, create/join group):
10,000requests/min cumulative - Standard Operations (all other):
20,000requests/min cumulative - Rate-limited responses return HTTP
429withRetry-AfterandX-Rate-Limit-Resetheaders - Monitor usage via
X-Rate-LimitandX-Rate-Limit-Remainingresponse headers
Rate Limit Tiers
| Operation Type | Limit | Examples |
|---|---|---|
| Core Operations | 10,000 requests/min | Login, create/delete user, create/join group |
| Standard Operations | 20,000 requests/min | All other operations |
Rate limits are cumulative within each tier. For example, if you make 5,000 login requests and 5,000 create user requests in one minute, you’ve hit the 10,000 core operations limit.
Response Headers
CometChat includes rate limit information in response headers:| Header | Description |
|---|---|
X-Rate-Limit | Your current rate limit |
X-Rate-Limit-Remaining | Requests remaining in current window |
Retry-After | Seconds to wait before retrying (on 429) |
X-Rate-Limit-Reset | Unix timestamp when limit resets (on 429) |
Handling Rate Limits
When you exceed the rate limit, CometChat returns HTTP429 Too Many Requests. Implement exponential backoff to handle this gracefully:
- JavaScript
- TypeScript
Tips for Staying Within Limits
- Batch operations — Space out bulk operations over time instead of firing all at once
- Monitor headers — Check
X-Rate-Limit-Remainingto proactively slow down before hitting limits - Avoid frequent login/logout — Core operations share a lower limit; minimize login cycles
- Use pagination — Fetch data in reasonable page sizes (30-50 items) rather than requesting everything at once
Rate limits can be adjusted based on your use case and plan. Contact CometChat support if you need higher limits.
Next Steps
Setup SDK
Install and configure the CometChat JavaScript SDK
Key Concepts
Learn the core concepts behind CometChat