Errors

HTTP status codes, error format, and retry guidance

Errors use a consistent JSON envelope:

{
  "error": {
    "type": "invalid_request_error",
    "code": "unsupported_duration",
    "message": "Duration must be one of: 5, 10.",
    "param": "duration"
  }
}
HTTPMeaningRetry?
400Invalid JSON, parameter, model option, or idempotency keyFix request
401Missing, invalid, or revoked API keyReplace key
402Insufficient creditsAdd credits
413Request body is too largeReduce request size
429API-key rate limit exceededRetry with backoff
404Generation not found for this accountDo not retry
500Unexpected Mistrounter errorRetry with backoff
502Upstream provider rejected submissionSafe to retry with the same idempotency key
503Video provider is not configured or temporarily unavailableRetry later

Retry network errors and 5xx responses with exponential backoff and jitter. Always reuse the original Idempotency-Key; do not automatically retry other 4xx responses.