Skip to content
API reference

Create a video task

Reference for POST /v2/video_generation, which submits a video generation task.

This page is the reference for submitting a video generation task. It is intended for developers who generate video clips. For a guide, see Video generation.

Endpoint

POST https://api.engy.ai/v2/video_generation

Authentication

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

Parameters

Body parameters

ParameterTypeRequiredDescription
modelStringYesThe video model ID, such as MiniMax-H3. A leading vendor/ segment is ignored.
contentArrayYesThe content items. Must include at least one non-empty text item.
durationIntegerNoThe length of the clip, in whole seconds, from 4 to 15. Defaults to 5.
ratioStringNoadaptive, 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16. Defaults to adaptive.
resolutionStringNo768P, which is the only supported value. Defaults to 768P.
seedIntegerNoA seed for generation.

The callback_url parameter is not supported. A request that sets it fails with status 400.

Content items

ItemFieldsDescription
Texttype: text, textPart of the prompt. Engy joins all text items into one prompt of at most 7,000 characters.
Imagetype: image_url, image_url.url, roleA frame, as a Base64 data URI. Set role to first_frame or last_frame. An image without a role is the first frame.

Frames must be JPEG, PNG, or WebP, from 256 to 5,760 pixels per side, with an aspect ratio from 0.4 to 2.5, and at most 30 MB each. You can send at most one first frame and one last frame.

Response

Response fields

FieldTypeDescription
task_idStringThe ID of the new task.
statusStringAlways queued.
base_resp.status_codeInteger0 on success.
base_resp.status_msgStringsuccess on success.

When Engy accepts the task, it reserves credit for the full requested duration.

Errors

StatusCause
400The request is invalid. For example, the prompt is missing or too long, a value is out of range, or an image is a URL instead of a data URI.
401The API key is missing or invalid.
402The available balance does not cover the requested duration.
404The model is not offered.
413A frame exceeds 30 MB, or the request body is too large.
429The account has 20 queued or running tasks. The response includes a Retry-After header.
503Too many uploads are in progress. Retry after the time in the Retry-After header.

Example

curl https://api.engy.ai/v2/video_generation \
  -H "Authorization: Bearer $ENGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-H3",
    "content": [{"type": "text", "text": "A red fox trots across fresh snow at dawn"}],
    "duration": 6,
    "ratio": "16:9"
  }'

Response:

{
  "task_id": "9f1c2b7e4d6a4f0b8e3c5a7d9b1f2e4c",
  "status": "queued",
  "base_resp": {"status_code": 0, "status_msg": "success"}
}