Skip to main content

Video Generation Overview

UniAll video models share one default asynchronous task lifecycle. Use each model page for model IDs, input fields, and capability limits; use this page for task polling, status handling, errors, and result retrieval.

Models

Default Endpoints

{BASE_URL} is https://api.uniall.ai.

ActionMethodEndpoint
Create a taskPOST/v1/videos
Query status and resultGET/v1/videos/{task_id}
Download completed contentGET/v1/videos/{task_id}/content

Send Authorization: Bearer sk-*** on every request. A model page may document a compatible creation path or a protocol-specific exception; its model IDs and request body still come from that model page.

Video Task Lifecycle

1. Save The Task ID

A successful create request returns a public id. Some responses also include the same value as task_id for compatibility. Store either value before leaving the request flow.

{
"id": "task_xxxxxxxxxxxxx",
"task_id": "task_xxxxxxxxxxxxx",
"object": "video.generation.job",
"model": "model-name",
"status": "queued",
"progress": 0,
"created_at": 1785801600
}

2. Poll The Task

Query the task every 3 to 10 seconds:

curl "{BASE_URL}/v1/videos/task_xxxxxxxxxxxxx" \
-H "Authorization: Bearer sk-***"

Stop only when status becomes completed or failed. Do not create a duplicate task only because the current task remains queued or in_progress.

StatusTerminalMeaning
queuedNoThe task was accepted and is waiting for processing.
in_progressNoGeneration or result processing is still running.
completedYesThe final result is ready.
failedYesThe task ended without a result; inspect error.

3. Read The Result

A completed task returns the public result in video_url, result.video_url, or result.outputs[0]. These fields can point to the same video.

{
"id": "task_xxxxxxxxxxxxx",
"task_id": "task_xxxxxxxxxxxxx",
"object": "video.generation.job",
"model": "model-name",
"status": "completed",
"progress": 100,
"video_url": "https://example.com/generated-video.mp4",
"result": {
"video_url": "https://example.com/generated-video.mp4",
"outputs": [
"https://example.com/generated-video.mp4"
]
},
"error": null
}

Use the authenticated content endpoint when you need the finalized file:

curl -L "{BASE_URL}/v1/videos/task_xxxxxxxxxxxxx/content" \
-H "Authorization: Bearer sk-***" \
-o output.mp4

Do not call the content endpoint before completion. Download generated media promptly instead of treating a result URL as permanent storage.

4. Handle Failure

{
"id": "task_xxxxxxxxxxxxx",
"object": "video.generation.job",
"model": "model-name",
"status": "failed",
"progress": 100,
"result": null,
"error": {
"code": "task_failed",
"message": "Video generation failed"
}
}

Fix invalid inputs before creating a new task. Retry transient service errors with backoff, but do not repeatedly resubmit the same request while the original task is still active.

Shared Response Fields

FieldTypeDescription
idstringPublic task ID used for polling.
task_idstringCompatible alias of id when present.
objectstringTask object type, commonly video.generation.job.
modelstringPublic model ID used for creation.
statusstringqueued, in_progress, completed, or failed.
progressintegerProgress from 0 to 100 when available; it does not replace status.
video_urlstring or nullPublic result URL after completion.
resultobject or nullCompleted output details, including video_url or outputs.
errorobject or nullPublic code and message for a failed task.
created_atintegerUnix creation timestamp when available.
completed_atintegerUnix completion timestamp when available.

Model-Specific Exceptions

Gemini Omni Flash Preview creates requests through POST /v1beta/interactions. When a follow-up query is needed, use the returned interaction_id with GET /v1/videos/generations/{interaction_id}. Its terminal statuses, error handling, and result fields follow the same rules above.

Protocol-specific pages such as Sora 2 Native OpenAI Format may stream their own response instead of returning a standard video task. Follow the response flow documented on that page.