Video generation runs asynchronously. Use these endpoints to track task progress and retrieve output files.
Task states
| State value | Meaning |
|---|
4 | Processing (in progress) |
1 | Success |
-1 | Failed |
GET /api/v1/tasks
List all tasks with pagination.
curl "http://localhost:8080/api/v1/tasks?page=1&page_size=10"
Query parameters
Number of tasks per page.
Response
{
"status": 200,
"message": "success",
"data": {
"tasks": [ ... ],
"total": 42,
"page": 1,
"page_size": 10
}
}
GET /api/v1/tasks/
Get the status and output of a specific task.
curl http://localhost:8080/api/v1/tasks/6c85c8cc-a77a-42b9-bc30-947815aa0558
Path parameters
The task ID returned by a generation endpoint.
Response
{
"status": 200,
"message": "success",
"data": {
"state": 1,
"progress": 100,
"videos": [
"http://localhost:8080/tasks/6c85c8cc-a77a-42b9-bc30-947815aa0558/final-1.mp4"
],
"combined_videos": [
"http://localhost:8080/tasks/6c85c8cc-a77a-42b9-bc30-947815aa0558/combined-1.mp4"
]
}
}
Task state: 4 = processing, 1 = success, -1 = failed.
Completion percentage, 0–100.
Download URLs for generated video files (final-1.mp4, final-2.mp4, etc.).
URLs for any combined/merged video outputs.
Polling pattern
Poll until state === 1 (success) or state === -1 (failed). While processing, state is 4:
TASK_ID="6c85c8cc-a77a-42b9-bc30-947815aa0558"
while true; do
RESPONSE=$(curl -s "http://localhost:8080/api/v1/tasks/$TASK_ID")
STATE=$(echo $RESPONSE | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['state'])")
if [ "$STATE" = "1" ]; then
echo "Done! $RESPONSE"
break
elif [ "$STATE" = "-1" ]; then
echo "Failed: $RESPONSE"
break
fi
echo "Progress: $(echo $RESPONSE | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['progress'])")%"
sleep 5
done
DELETE /api/v1/tasks/
Delete a task and remove all its generated files from disk.
curl -X DELETE http://localhost:8080/api/v1/tasks/6c85c8cc-a77a-42b9-bc30-947815aa0558
Returns 200 on success. Returns 404 if the task does not exist.
GET /api/v1/stream/
Stream a generated video file with support for HTTP Range requests (seekable playback in browsers).
GET /api/v1/stream/6c85c8cc-a77a-42b9-bc30-947815aa0558/final-1.mp4
GET /api/v1/download/
Download a generated video file as an attachment.
curl -O http://localhost:8080/api/v1/download/6c85c8cc-a77a-42b9-bc30-947815aa0558/final-1.mp4