Skip to content
API reference

Get a video task

Reference for GET /v2/query/video_generation/{task_id}, which returns the status of a video task.

This page is the reference for retrieving a video generation task. It is intended for developers who poll tasks until they finish.

Endpoint

GET https://api.engy.ai/v2/query/video_generation/{task_id}

Authentication

Send your API key in the Authorization header as a bearer token. For details, see Inference API overview.

Parameters

Path parameters

ParameterTypeRequiredDescription
task_idStringYesThe task ID.

Response

Response fields

The response contains a task object and a base_resp object. The task object has the following fields:

FieldTypeDescription
task_idStringThe task ID.
modelStringThe video model ID.
statusStringqueued, running, succeeded, failed, or cancelled.
resolutionStringThe resolution, such as 768P.
durationIntegerThe requested duration, in seconds.
ratioStringThe aspect ratio.
created_atNumberThe creation time, as a Unix timestamp in seconds.
updated_atNumberThe time of the last status change, as a Unix timestamp in seconds.
finished_atNumber or nullThe completion time, as a Unix timestamp in seconds.
attemptsIntegerThe number of times the task was started.
usage.video_secondsNumberThe seconds of video produced. You are charged for this value.
content.urlStringA signed download link, valid for 24 hours. Present only if status is succeeded.
content.content_typeStringAlways video/mp4.
content.bytesIntegerThe file size, in bytes.
content.expires_atIntegerThe expiry time of the link, as a Unix timestamp in seconds.
errorObject or nullThe error, with message and type, if status is failed.

Errors

StatusCause
401The API key is missing or invalid.
404The task does not exist or belongs to another account.

Example

curl https://api.engy.ai/v2/query/video_generation/$TASK_ID \
  -H "Authorization: Bearer $ENGY_API_KEY"

Response:

{
  "task": {
    "task_id": "9f1c2b7e4d6a4f0b8e3c5a7d9b1f2e4c",
    "model": "MiniMax-H3",
    "status": "succeeded",
    "resolution": "768P",
    "duration": 6,
    "ratio": "16:9",
    "created_at": 1792281600,
    "updated_at": 1792281780,
    "finished_at": 1792281780,
    "attempts": 1,
    "usage": {"video_seconds": 6.0},
    "content": {
      "url": "https://api.engy.ai/v2/video_generation/9f1c2b7e4d6a4f0b8e3c5a7d9b1f2e4c/content?token=...",
      "content_type": "video/mp4",
      "bytes": 4194304,
      "expires_at": 1792368180
    },
    "error": null
  },
  "base_resp": {"status_code": 0, "status_msg": "success"}
}