API Reference

Errors & Rate Limits

Error codes, rate limits, and how to handle them.

Error Format

All errors return a consistent JSON structure:

{
  "error": "error_code",
  "message": "Human-readable description"
}

Error Codes

HTTPCodeDescription
401unauthorizedMissing, malformed, or revoked API key
402quota_exceededScan limit reached. Upgrade plan to continue.
402async_not_allowedAsync mode requires a paid plan (API key users)
400empty_fileUploaded file is empty
404not_foundDetection ID not found
413payload_too_largeRequest payload exceeds the size limit
415unsupported_media_typeUnrecognized file type
415content_type_mismatchFile content does not match the declared media type
429rate_limitedToo many requests
500internal_errorServer error. Retry after a moment.

Rate Limits

Each plan has different rate limits:

PlanRequests/MinDaily LimitScans
Free510200 (lifetime)
Starter20None2,000/month
Pro60None10,000/month

Rate Limit Headers

Every API response includes rate limit headers:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed per minute
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetSeconds until the rate limit window resets

Handling Rate Limits

When you receive a 429 response, the body includes a retry_after value in seconds:

{
  "error": "rate_limited",
  "message": "Rate limit exceeded. Retry after 60 seconds.",
  "retry_after": 60
}

Wait for the specified duration before retrying. Implement exponential backoff for production integrations.

Best Practices

  • Use GET /v1/usage to monitor your monthly quota
  • Use async mode for batch processing to avoid timeout issues
  • Implement retry logic with exponential backoff for 429 and 500 errors