Extend video duration

Extend a video by generating additional frames at the beginning or end using AI generation.

Audio is generated for the extended portion if the input video has audio

Authentication

AuthorizationBearer
API key authentication

Request

This endpoint expects an object.
video_uristringRequired
Input video for extending. See [Input Formats](/input-formats#video-input) for supported formats and codecs. - Maximum resolution: 3840x2160 (4K) - Minimum frame count: 73 (around 3 seconds in 24fps)
durationdoubleRequired2-20

Duration in seconds to extend the video. Minimum 2 seconds, maximum 20 seconds (480 frames at 24fps).

promptstringOptional<=5000 characters
Description of what should happen in the extended portion of the video.
modeenumOptionalDefaults to end
Where to extend the video: - `end` (default): Extends the video at the end. - `start`: Extends the video at the beginning.
Allowed values:
resolutionenumOptional
The resolution of the generated extension in WIDTHxHEIGHT format. The extension is generated at this resolution and then composited onto the original video using content-aware fill, so the final output matches the input video's resolution. When omitted, the resolution is automatically determined based on the input video orientation — portrait videos produce a 1080x1920 extension, landscape videos produce a 1920x1080 extension.
Allowed values:
modelenumOptionalDefaults to ltx-2-3-pro
Model to use for video generation.
Allowed values:
contextdoubleOptional1-20
**Advanced parameter:** Number of seconds from the input video to use as context for the extension (maximum 20 seconds). The model uses context frames from the input video to generate a more coherent extension. The sum of `context` + `duration` (converted to frames using the input video's FPS) cannot exceed 505 frames (~21 seconds at 24fps). For higher-FPS inputs, the maximum total duration in seconds will be proportionally lower; for lower-FPS inputs, it will be proportionally higher. If not provided, defaults to maximize available context within the 505 frame limit while respecting the 20-second cap.

Response

Video extended successfully

Errors