Reliability/14 of 24

Timeouts & retries

How long jobs may run, and when 429 and 503 are safe to retry.

Requests are synchronous. Set your HTTP client timeout to at least 5 minutes for large batches.

  • 120 seconds per image, 240 seconds per request. Over that: 422 processing_timeout.
  • 429 and 503 are safe to retry after Retry-After.
  • If the connection drops mid-process, nothing is charged. If it drops as the response is sent, retrying charges again.
# --retry waits for Retry-After on 429 and 503. It also retries
# timeouts, which can process and charge a batch twice.
curl https://api.comprestack.com/api/v1/convert \
  --retry 2 --max-time 300 \
  -H "Authorization: Bearer $COMPRESTACK_API_KEY" \
  -H "X-Request-Id: order-4417-thumbs" \
  -F "files[]=@photo.jpg" \
  -F "format=webp"