Errors

The Scavio API uses standard HTTP status codes and returns structured error responses to help you debug issues quickly.

Error Response Format

{
  "error": {
    "code": "error_code_string",
    "message": "Human-readable error description"
  }
}

Status Codes

StatusCodeDescription
400bad_requestInvalid request body or missing required parameters
401unauthorizedMissing or invalid API key
403forbiddenAPI key does not have permission for this action
402insufficient_creditsNo credits remaining. Top up or upgrade your plan.
429rate_limit_exceededToo many requests. Wait and retry.
500internal_errorServer error. Retry after a short delay.

Common Errors

Missing query parameter

// Status: 400
{
  "error": {
    "code": "bad_request",
    "message": "The 'query' field is required"
  }
}

Invalid API key

// Status: 401
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}

Out of credits

// Status: 402
{
  "error": {
    "code": "insufficient_credits",
    "message": "No credits remaining. Please upgrade your plan or purchase additional credits."
  }
}

Rate limited

// Status: 429
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Retry after 30 seconds."
  }
}

Best Practices

  • Always check the HTTP status code before parsing the response body
  • Use the error.code field for programmatic error handling
  • Use the error.message field for logging and debugging
  • Implement retry logic with exponential backoff for 429 and 500 errors
  • Do not retry 400 or 401 errors -- fix the request first