Get started

Errors

Every error has the same shape:

{"error": {"code": "invalid_request", "message": "duration_min: required unless `script` is given (whole minutes)."}}
  • code is stable; branch on it.
  • message is for humans and names the field that failed.
  • Some errors add fields: credits (new price), balance, queued, detail (extra context for our support team).
  • Every response carries an x-request-id header. Quote it when you contact support.

Codes

StatusCodeMeaning
400invalid_requestA field is missing, unknown or out of range. message names the field and the allowed values.
400invalid_jsonThe body is not valid JSON.
400image_requiredVideo models need a start frame: send image: {mime_type, base64}.
401unauthorizedMissing, wrong or revoked key.
402insufficient_creditsNot enough credits. Nothing was reserved; balance shows what you have.
403access_requiredThis account cannot order yet. Sign in to the app once to finish setting up the account.
404not_foundNo such video or generation on this account.
409price_changedThe price moved since your estimate. Send the new credits value returned in the error.
409not_readyThe video or file is not finished yet. Keep polling.
409conflictThe action does not fit the job's current state (for example a decision for a stop it is not waiting at).
413payload_too_largeBody over 300 KB. Shrink the start frame.
429rate_limitedToo many requests. 120 requests per minute per key; ordering has its own lower limit.
500internal_errorSomething broke on our side. Retry; if it keeps failing, contact support with the x-request-id.
503service_unavailableProduction is paused or unreachable. Nothing was charged; retry in a few minutes.
503model_unavailableThat model is temporarily down. Nothing was charged; try again later or pick another model.

Common 400s on estimate

Most invalid_request errors are a field that the endpoint does not accept:

  • Sending credits or stops to /videos/estimate: leave them out; they are for the order only.
  • Leaving out duration_min without a script.
  • A seconds, aspect_ratio or resolution the model does not support: check the model page.
  • count on video or music models (use seconds), or seconds on image models (use count).

Unknown fields are always rejected, so a typo never gets silently ignored.