API guide

Errors

Errors on /v1/* use the OpenAI format. Branch on the HTTP status and error.code; the human-readable message may change.

Format

type is a coarse class and is not identical on every endpoint, so rely on code and the status.

{
  "error": {
    "message": "...",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_api_key"
  }
}

Codes

StatuscodeWhen
400invalid_requestBad JSON or parameters, or a key whose budget is used up.
400model_not_foundThe model is not available, or is not a supported video or music model.
400content_policy_violationA video or music task was blocked by content rules.
401invalid_api_keyMissing, invalid, disabled or expired key.
402insufficient_quotaNot enough balance for the call or task.
403model_not_allowedThe model is not in the key's allowlist.
403permission_deniedThe caller IP is not in the key's IP allowlist.
404not_foundUnknown task id, or one that belongs to another account. Also video_not_ready for a video that is not finished.
413invalid_requestRequest body too large.
429rate_limit_exceeded, task_limit_reachedToo many requests, or the task limit was reached when submitting an async task.
5xxserver_error, upstream_error, upstream_auth_error, no_provider, audio_fetch_failed, transcription_failed, transcript_unavailable, upload_failedA server or provider problem. 503 no_provider means no provider matched the request.

Async tasks

For video, music and ffmpeg, a task that fails after being accepted is not an HTTP error: the poll call returns 200 with status: failed and an error object.