Skip to main content
Every error response is JSON with the same shape:
boolean
Always false for errors.
object
string
Time of the response.
A 429 response also has top-level limit, retry_after and reset_at fields. See Rate Limit.

Error codes

The exact messages for the 401 errors are:
  • api_key_required: “Please provide an API key in the ApiKey header”
  • invalid_api_key: “The provided API key is invalid or inactive”
Image requirements: formats JPG, PNG, WEBP, BMP or GIF; size 1 KB to 10 MB; content type image/jpeg, image/png, image/webp, image/bmp or image/gif. Anything else returns 400 invalid_image.

What counts against your quota

  • Counts: successful requests, and 4xx errors produced while processing: missing_image, invalid_image, invalid_parameter, and 4xx errors returned by the image processor.
  • Doesn’t count: 401, 402, 403 and 429 rejections; any 5xx error; calls to /v2/account/usage/. Retrying after a 429 is free.
  • 429: wait the number of seconds in the Retry-After header, then retry.
  • 5xx and timeouts (including 504): retry with exponential backoff: wait 1 s, then 2 s, then 4 s.
  • 400, 401, 402, 403: never retry. Fix the request, key, plan or billing first.
Python