API Rate Limit Response
This page documents the rate limiting behavior of our API and explains how to handle different types of rate limit errors.
Overview
Our API implements rate limiting to ensure fair usage and maintain service stability. There are three types of rate limits:
- Daily rate limit
- Burst rate limit
- Chat-based rate limit
When a rate limit is exceeded, the API returns a 429 status code along with specific headers that provide information about the limit, remaining requests/tokens, and reset time.
You can learn more about QStash plans and their limits on the QStash pricing page.
Daily Rate Limit
This is a daily limit applied to publish-related API endpoints (new message requests like publish, enqueue, or batch). Other API requests, such as fetching events or messages, do not count toward this limit.
Headers:
RateLimit-Limit
: Maximum number of requests allowed per dayRateLimit-Remaining
: Remaining number of requests for the dayRateLimit-Reset
: Time (in unix timestamp) when the daily limit will reset
Burst Rate Limit
This is a short-term limit per second to prevent rapid bursts of requests. This limit applies to all API endpoints.
Headers:
Burst-RateLimit-Limit
: Maximum number of requests allowed in the burst window (1 second)Burst-RateLimit-Remaining
: Remaining number of requests in the burst window (1 second)Burst-RateLimit-Reset
: Time (in unix timestamp) when the burst limit will reset
Chat-based Rate Limit
This limit is applied to chat-related API endpoints.
Headers:
x-ratelimit-limit-requests
: Maximum number of requests allowed per dayx-ratelimit-limit-tokens
: Maximum number of tokens allowed per dayx-ratelimit-remaining-requests
: Remaining number of requests for the dayx-ratelimit-remaining-tokens
: Remaining number of tokens for the dayx-ratelimit-reset-requests
: Time (in unix timestamp) until the request limit resetsx-ratelimit-reset-tokens
: Time (in unix timestamp) when the token limit will reset
Example Rate Limit Error Handling
Was this page helpful?