Errors

One error shape, with a stable code for each case.

{
  "error": {
    "type": "invalid_request",
    "code": "invalid_param",
    "message": "`size` must be one of \"1K\", \"2K\", \"4K\".",
    "param": "size",
    "request_id": "req_eTC1oUA_deunDPR2"
  }
}

Match on code; message is for people and may change. param names the field at fault. Include request_id (also in the Luce-Request-Id header) when you contact us.

codeHTTPMeaning
missing_api_key401No Authorization: Bearer header.
invalid_api_key401The key is malformed, unknown or revoked.
api_not_enabled403The developer API isn't switched on for this studio.
scope_missing403The key lacks the scope this endpoint needs.
team_suspended403The studio's account is suspended.
mode_unavailable403This mode isn't offered on the API.
invalid_body400The body isn't valid JSON or misses a required field.
invalid_param400A field has a wrong type or an out-of-range value; param names it.
invalid_input400An input image or video can't be used (unreachable, too large, wrong type, or an upload not completed).
file_too_large400The direct upload is over 4 MB: use POST /v1/files/uploads instead.
invalid_idempotency_key400The Idempotency-Key header isn't 1–255 printable characters.
not_found404No such job, file or webhook for this studio.
idempotency_conflict409The Idempotency-Key was used before with a different body.
not_cancellable409The job has started; only queued jobs can be cancelled.
insufficient_balance402Prepaid AI Credits can't cover the job and pay as you go is off.
monthly_cap_reached402The job would pass this month's pay-as-you-go cap.
payment_past_due402Pay as you go is paused after a failed payment.
rate_limited429Too many requests; wait for Retry-After seconds.
maintenance503Luce is briefly down for maintenance; retry shortly.
internal_error500Something went wrong on our side; safe to retry with the same Idempotency-Key.