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-Limitindicates the request-quota associated with the user in the current time window.
RateLimit-Remainingindicates the remaining requests that you can issue in the current time window.
RateLimit-Resetis the number of seconds until the quota resets.
Let's explore the example of a typical response headers for an image processing request:
RateLimit-Limit: 120, 120;w=60, 4;w=1
Here we can see that we have request limits:
120;w=60which means 120 requests per 60 seconds.
4;w=1which means 4 requests per 1 second.
RateLimit-Limitheader 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.
If you exceed limits, the example of payload with response headers may look like this:
RateLimit-Limit: 4, 120;w=60, 4;w=1
"error_message": "Too Many Requests. Rate limit exceeded."
Here we can see that we've got a
429 status codewhich 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.