Error handling

Error codes and how to handle them

All error responses follow this format:

json
{
  "error": {
    "code": "machine_readable_code",
    "message": "Human-readable description in English."
  }
}

Common codes

StatusCodeMeaning
400invalid_requestInvalid body or malformed fields.
401unauthorizedAPI key missing, invalid or revoked.
402quota_exceededNot enough storage.
403forbiddenKey lacks required scope.
403plan_restrictedFeature requires a higher plan.
404not_foundResource does not exist or is not yours.
429rate_limitedToo many requests. Respect Retry-After.
500internal_errorOur fault. Retry with backoff.

Retry policy

Retry recommendations by status:

  • 4xx (except 429): DO NOT retry. The error is permanent until you change something (fix body, generate new key, buy more storage).
  • 429: respect the Retry-After header. Implement exponential backoff.
  • 5xx: retry with backoff (1s, 2s, 4s, 8s, 16s). If it persists >5 min, open a ticket.
Recommended: log the code (machine-readable) in your system, not the message. Messages are in English and may change; codes are stable.