Extend video duration
Extend a video by generating additional frames at the beginning or end. The model uses context frames from the input to produce a seamless continuation with consistent motion and audio.
The output video is 1080x1920 for portrait input and 1920x1080 otherwise. Inputs with other aspect ratios are center-cropped to 9:16 or 16:9.
Responds immediately with the job id and created_at timestamp. Poll GET /v2/extend/{id} until the status is completed, then download from result.video_url.
Requests that violate the content policy fail the job with content_filtered_error. An account without enough credit fails the same way, with insufficient_funds_error.
Billed per second, based on the extended portion plus the context frames used from the input video. See Pricing.
Authentication
Headers
A unique value per job, 1 to 255 characters, not counting quotes. Resending the request with the same Idempotency-Key returns the same job. See Idempotent Requests.
Request
Input video for extending. See Input Formats for supported formats and codecs.
- Maximum resolution: 3840x2160 (4K)
- Minimum frame count: 73 (around 3 seconds at 24fps)
Duration in seconds to extend the video. Minimum 2 seconds, maximum 20 seconds (480 frames at 24fps).
Where to extend the video:
end(default): Extends the video at the end.start: Extends the video at the beginning.
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, uses as much of the input video as fits within the 505-frame limit.
Response headers
true when an earlier request with the same Idempotency-Key created this job. Not sent otherwise.