AI Integration Quick Reference
AI Integration Quick Reference
Rate Limits:
- Core Operations: 10,000 requests/minute (login, create/delete user, create/join group)
- Standard Operations: 20,000 requests/minute (all other operations)
- Status Code: 429 (Too Many Requests)
- Headers:
Retry-After,X-Rate-Limit-Reset,X-Rate-Limit,X-Rate-Limit-Remaining
X-Rate-Limit-Remaining header and implement exponential backoff when approaching limits.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. Rate limits can be adjusted on a per-need basis depending on your use case and plan.
What Happens When the Rate Limit Is Reached?
The request isn’t processed and a response is sent containing a 429 response code. Along with the response code, a couple of headers are sent that specify the time in seconds you must wait before you can try the request again.Retry-After: 15
X-Rate-Limit-Reset: 1625143246
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) |
Rate Limit Endpoint
CometChat does not provide a dedicated rate-limit endpoint. Use the response headers below to monitor your current limit and remaining requests:X-Rate-Limit: 700
X-Rate-Limit-Remaining: 699
Handling Rate Limits
When you exceed the rate limit, CometChat returns HTTP429 Too Many Requests. Implement exponential backoff to handle this gracefully:
- Java
- Kotlin
Next Steps
Setup
Configure SDK for optimal API usage
Connection Behaviour
Use WebSocket for real-time updates instead of polling
Real-Time Listeners
Receive updates via WebSocket to reduce API calls
REST API Documentation
Explore REST API endpoints and rate limits