Extend the duration of existing videos by generating additional frames that continue the motion and narrative. Each extension adds 4 seconds to the video duration, with a maximum of 4 extensions (creating up to 21-second videos).

Endpoint

POST https://api.legnext.ai/api/v1/extend-video

Headers

HeaderTypeRequiredDescription
x-api-keystringYesYour API key

Request Body

ParameterTypeRequiredDescription
jobIdstringYesID of the original video generation task
videoNointegerYesVideo number to extend (0/1/2/3)
promptstringNoText prompt to guide the extension (1-8192 characters)
callbackstringNoCallback URL for task completion notifications

Example Request

curl -X POST "https://api.legnext.ai/api/v1/extend-video" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jobId": "b24ffa07-7b76-49a2-963e-f6c527f7cec7",
    "videoNo": 0,
    "prompt": "Continue with more dynamic movement and effects",
    "callback": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d"
  }'

Response

Returns a task object containing the task information.
{
    "job_id": "542cb643-9b26-4a04-804b-cddf4cabdba5",
    "model": "midjourney",
    "task_type": "extend_video",
    "status": "completed",
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d",
            "secret": ""
        }
    },
    "input": null,
    "output": {
        "video_urls": [
            "https://image.legnext.ai/20250922/01k5r5kd78f84t6kxcy713p6v5_0_0.mp4?Expires=1761118550&Signature=heRp1jwgThSpcFBTIoTiBlsg1ro%3D",
            "https://image.legnext.ai/20250922/01k5r5kd78f84t6kxcy713p6v5_0_1.mp4?Expires=1761118550&Signature=l4mxAciS7eNktdDu7067ceQUd5I%3D",
            "https://image.legnext.ai/20250922/01k5r5kd78f84t6kxcy713p6v5_0_2.mp4?Expires=1761118550&Signature=4DjEkbfN7x4vyCJqnOyFoZKa%2FGM%3D",
            "https://image.legnext.ai/20250922/01k5r5kd78f84t6kxcy713p6v5_0_3.mp4?Expires=1761118550&Signature=Nl%2FnBtgeHWjPvJz1oW7hyzdnxQg%3D"
        ]
    },
    "meta": {
        "created_at": "2025-09-22T07:35:49Z",
        "started_at": "2025-09-22T07:35:50Z",
        "ended_at": "2025-09-22T07:37:40Z",
        "usage": {
            "type": "point",
            "frozen": 00,
            "consume": 00
        }
    },
    "detail": null,
    "logs": [],
    "error": {
        "code": 0,
        "raw_message": "",
        "message": "",
        "detail": null
    }
}