Default Limits
| Plan | Requests per Minute | Webhooks per Minute |
|---|---|---|
| Free | 60 | 20 |
| Pro | 120 | 40 |
| Enterprise | 300 | 100 |
Rate Limit Headers
When you make an API request, Caret includes several headers in the response to help you track your rate limit usage:| Header | Description |
|---|---|
X-RateLimit-Limit | The maximum number of requests allowed in the current time window |
X-RateLimit-Remaining | The number of requests remaining in the current time window |
X-RateLimit-Reset | The time at which the current rate limit window resets, in Unix time |
Handling Rate Limit Errors
If you exceed the rate limit, the API will respond with a429 Too Many Requests status code. The response body will contain an error message explaining the situation.
Example rate limit error response:
Best Practices for Handling Rate Limits
-
Implement Exponential Backoff: When you receive a 429 response, wait for the time specified in the
retry_afterfield before retrying. - Monitor Your Usage: Track the rate limit headers in each response to monitor your usage and adjust your request rate accordingly.
- Cache Responses: Whenever possible, cache API responses to reduce the number of requests you need to make.
- Batch Operations: If you need to perform multiple operations, use batch endpoints where available to reduce the number of requests.
Example Retry Logic
Here’s an example of how to implement retry logic with exponential backoff in JavaScript:Increasing Rate Limits
If you need higher rate limits than what your current plan provides, consider:- Upgrading Your Plan: Higher-tier plans come with higher rate limits.
- Contact Support: Enterprise customers can contact our support team to discuss custom rate limits based on your specific needs.