Rate limits

The Claid API uses a number of safeguards against bursts of incoming traffic to help maximize its stability. Image processing requests that come with relatively high intensity can be temporarily limited.

By default, users may issue up to 120 requests per minute and 4 requests per second. if you need to expand the limits to process even more images, or use image batch processing to efficiently process multiple images, please contact us.

To explore the remaining restrictions, every image processing response contains relevant headers:

  • RateLimit-Limit indicates the request-quota associated with the user in the current time window.

  • RateLimit-Remaining indicates the remaining requests that you can issue in the current time window.

  • RateLimit-Reset is the number of seconds until the quota resets.

Example of a typical response headers

Let's explore the example of a typical response headers for an image processing request:

HTTP/2 200
Content-Type: application/json
RateLimit-Limit: 120, 120;w=60, 4;w=1
RateLimit-Remaining: 118
RateLimit-Reset: 32

Here we can see that we have request limits:

  • 120;w=60 which means 120 requests per 60 seconds.

  • 4;w=1 which means 4 requests per 1 second.

Besides, the RateLimit-Limit header indicates that we got under the first limit of 120 requests per minute. This leaves us with 118 remaining request that we can send in the next 32 seconds. When this time passes - the limits will be reset.

Example of a limits exceed response

If you exceed limits, the example of payload with response headers may look like this:

HTTP/2 429
Content-Type: application/json
RateLimit-Limit: 4, 120;w=60, 4;w=1
RateLimit-Remaining: -1
RateLimit-Reset: 1

  "detail": {
    "error_code": "2001",
    "error_type": "general",
    "error_message": "Too Many Requests. Rate limit exceeded."

Here we can see that we've got a 429 status code which indicates that we exceeded the 4 requests per second rate limit. Since we don't have any remaining allowed requests, we will be able to process new images again in 1 second, when the limit will be reset.

Last updated