Skip to main content
POST
/
v1
/
extend-video
Extend Video
curl --request POST \
  --url https://api.legnext.ai/api/v1/extend-video \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "videoNo": 1,
  "prompt": "<string>",
  "callback": "<string>"
}
'
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": "e41e5586-dcee-4659-ae56-dbf19d20051a",
    "model": "midjourney",
    "task_type": "extend_video",
    "status": "completed",
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "secret": ""
        }
    },
    "input": null,
    "output": {
        "video_urls": [
            "https://cdn.legnext.ai/temp/1760423128794.mp4",
            "https://cdn.legnext.ai/temp/1760423131363.mp4",
            "https://cdn.legnext.ai/temp/1760423134585.mp4",
            "https://cdn.legnext.ai/temp/1760423137040.mp4"
        ],
        "seed": "2053075314"
    },
    "meta": {
        "created_at": "2025-10-14T06:23:05Z",
        "started_at": "2025-10-14T06:23:06Z",
        "ended_at": "2025-10-14T06:25:39Z",
        "usage": {
            "type": "point",
            "frozen": 480,
            "consume": 480
        }
    },
    "detail": null,
    "logs": [],
    "error": {
        "code": 0,
        "raw_message": "",
        "message": "",
        "detail": null
    }
}

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json
jobId
string<uuid>
required

ID of the original video task

videoNo
integer
required

Video number to extend (0/1/2/3)

Required range: 0 <= x <= 3
prompt
string

Text prompt to guide the extension

Required string length: 1 - 8192
callback
string<uri>

Callback URL for task completion notifications

Response

200

Video extend task created successfully