Skip to main content
Most error responses return a JSON body with:
  • error: human-readable message
  • error_code: machine-readable code for programmatic handling

Common status codes

  • 400 invalid request (for example: image too large, unsupported format)
  • 401 invalid or missing API key (invalid_auth_token)
  • 403 insufficient credits (insufficient_api_credits)
  • 429 rate limit exceeded (rate_limit_exceeded)
  • 500 internal error (retryable)

400 error codes (examples)

Common error_code values include:
  • missing_parameter, invalid_parameter
  • unsupported_image_format, malformed_image
  • file_size_too_large, resolution_too_high
  • unknown_foreground (foreground subject not detected)

Logging recommendations

  • Log: endpoint, status code, error_code, and a request timestamp
  • Redact: API keys, signed URLs, and user PII

Rate limits & retries