Skip to main content

Errors

Errors use one shape.
{
  "error": {
    "code": "invalid_request",
    "message": "duration_seconds must be between 5 and 120.",
    "request_id": "req_abc123"
  }
}

Common codes

CodeMeaning
invalid_requestThe request body, parameters, or uploaded file are invalid.
authentication_failedThe API key is missing, invalid, or expired.
permission_deniedThe key does not have access to the requested resource.
not_foundThe requested resource does not exist.
rate_limitedThe request exceeded the current rate limit.
provider_unavailableA generation provider is temporarily unavailable.
internal_errorAn unexpected error occurred.

Retrying requests

Retry transient 429, 502, 503, and 504 responses with exponential backoff. For billable creation endpoints, always include an Idempotency-Key header before retrying.