Video Generation
Video Series
Video Generation
POST
Video Generation
Introduction
The video generation API supports text-to-video, image-to-video, video-to-video, and more. Through a unified API interface, you can call multiple mainstream video generation models including Sora 2, Veo, Ali Wanxiang, and Doubao Seedance. Important Note: Video generation is an asynchronous task. You need to first submit a task to get a task ID, then poll the task status until it succeeds.Supported Models and Features
Feature Description:
- Text-to-Video (T2V): Generate video from text prompts only
- Image-to-Video (I2V): Generate video based on reference images
- First Frame Mode: Use first frame image as starting scene
- First/Last Frame Mode: Use first and last frame images to control video start and end scenes
- Reference Image Mode: Use reference images as style reference (only supported by some models)
- Video-to-Video (Remix): Regenerate based on existing video (only Sora 2 supports)
Authentication
string
required
Bearer Token, e.g.
Bearer sk-xxxxxxxxxxAPI Endpoints
Submit Video Task
POST/v1/video/generations
Submit a video generation task and return a task ID for subsequent queries.
Query Video Task
GET/v1/video/generations/{task_id}
Query the status and results of a video generation task by task ID.
Path Parameters
string
required
Video generation task ID returned by the submit task interface
Response Examples
Task Status Description:
Response Example (Queued):
Usage Example
Download Video
GET/v1/video/generations/download?id={videoId}
Download completed video files (Sora 2 only).
Query Parameters
string
required
Video ID returned by the query task interface (task_id)
Response Example
Usage Example
Submit Video Task
POST/v1/video/generations
Submit a video generation task and return a task ID for subsequent queries.
Usage Examples
- Sora 2
- Veo
- Ali Wanxiang
- Doubao Seedance
1. Text-to-Video (Basic Example)2. Text-to-Video (Landscape, 8 seconds)3. Image-to-Video (First Frame Mode)4. Remix Mode (Video-to-Video)
Response Example
Request Parameters
string
required
Model identifier, supported models and features:Sora 2 Series:
sora-2- Supports text-to-video, image-to-video, video-to-video (Remix mode)
veo-3.0-fast-generate-001- Text-to-video (first frame mode)veo-3.1-fast-generate-preview- Text-to-video (first frame mode, first/last frame mode)
wan2.5-t2v-preview- Text-to-videowan2.5-i2v-preview- Image-to-video (first frame mode)
doubao-seedance-1-0-lite-t2v-250428- Text-to-videodoubao-seedance-1-0-lite-i2v-250428- Image-to-video (first frame mode, first/last frame mode, reference image mode)doubao-seedance-1-0-pro-250528- Text-to-video (first frame mode)doubao-seedance-1-5-pro-251215- Text-to-video, Image-to-video (first frame mode, first/last frame mode), with audio, duration 4-12s, resolution 480p/720pdoubao-seedance-1-5-pro-251215-noAudio- Text-to-video, Image-to-video (first frame mode, first/last frame mode), silent video, duration 4-12s, resolution 480p/720p
string
Video generation prompt, describing scene actions and settings. Note: Doubao Seedance series models do not require this field, the prompt should be written directly in the
text field of the metadata.content arraystring
Reference image for image-to-video (supports Base64 or URL format)
integer
default:"5"
Video duration (seconds), different models support different durations
string
default:"720p"
Video resolution:
480p, 720p, 1080p, 4kstring
default:"16:9"
Aspect ratio:
16:9, 9:16, 1:1, 4:3, 3:4, 21:9, adaptive (adaptive, only supported by some models)Model-Specific Parameters
Different models support different specific parameters. Below are detailed descriptions by model series:- Sora 2
- Veo
- Ali Wanxiang
- Doubao Seedance
string|integer
default:"4"
Video duration (seconds), supports:
4, 8, 12string
default:"720x1280"
Video resolution, supports:
720x1280 (portrait), 1280x720 (landscape)string
Reference image (supports URL or Base64 format), for image-to-video
string
Remix mode: Regenerate based on existing video ID (must start with
video_)Complete Examples
Doubao Seedance Series
Doubao Seedance series models use a special parameter passing method: all parameters are passed through special markers in the prompt, and images are passed through themetadata.content array.
1. Text-to-Video (T2V)
2. Image-to-Video - First Frame Mode
3. Image-to-Video - First/Last Frame Mode (Only lite-i2v supports)
4. Image-to-Video - Reference Image Mode (Only lite-i2v supports)
- The
contentarray must be placed in themetadataobject - All parameters must be passed through special markers in the prompt (e.g.,
--ratio 16:9) - Images must be placed in the
metadata.contentarray usingimage_urltype - First/last frame mode requires two images, marked with
role: "first_frame"androle: "last_frame"respectively - Reference image mode requires using
[ĺž1],[ĺž2]etc. in the prompt to reference images, with images markedrole: "reference_image" doubao-seedance-1-0-lite-t2v-250428does not support image input andadaptiveaspect ratiodoubao-seedance-1-0-pro-250528only supports first frame mode
- Sora 2 Complete Example
- Veo Complete Example
- Ali Wanxiang Complete Example
- Doubao Seedance Complete Example
1. Submit Video Generation Task
2. Poll Task Status
Response Example (Queued):
- When task status is
queuedorin_progress, you need to poll regularly (recommended every 3-5 seconds) - When status becomes
succeeded, you can usetask_idasvideoIdto download the video - When status becomes
failed, you can check theerrorfield for failure reason
3. Download Video (Sora 2 Exclusive)
Use thetask_id returned after successful polling (as videoId) to download the video:id parameter is the task_id returned after successful polling in step 2.Response Example:Supported Models
Sora 2 Series
Model Name:sora-2
Core Capabilities:
- â Text-to-video (pure text description generates video)
- â Image-to-video (single image + text generates video)
- â Remix mode (regenerate based on existing video)
seconds: Video duration (4, 8, 12 seconds), default 4 secondssize: Video resolution (720x1280portrait,1280x720landscape), default720x1280width/height: Video width and height (automatically converted tosizeparameter)input_reference: Reference image (supports URL or Base64 format), for image-to-videoremix_from_video_id: Remix mode, regenerate based on existing video ID (must start withvideo_)
- Video generation is an asynchronous task, need to first submit task to get
task_id, then poll task status - When task status is
succeeded, usetask_idasvideoIdto call download interface to get video - Download interface returns Base64-encoded video data, can be directly used for frontend playback or saved as file
- Image input formats support JPEG, PNG, image size must exactly match
sizeparameter for image-to-video
Veo Series
Model Names:veo-3.1-generate-preview, veo-3.1-fast-generate-preview, veo-3.0-generate-preview, veo-3.0-fast-generate-001
Core Capabilities:
- â Text-to-video
- â Image-to-video (supports first frame and last frame constraints)
- â Audio generation
durationSeconds: Video duration (4, 6, 8 seconds)aspectRatio: Aspect ratio (16:9, 9:16)resolution: Resolution (720p, 1080p)generateAudio: Whether to generate audioimage: First frame reference imagelastFrame: Last frame reference imageseed: Random seed
Ali Wanxiang Series
Model Name:wan2.5-i2v-preview
Core Capabilities:
- â Image-to-video
- â Supports custom audio upload
- â Intelligent prompt expansion
- â Auto-generate synchronized audio with video
duration: Video duration (5, 10 seconds)resolution: Video resolution (480p, 720p, 1080p)smart_rewrite: Whether to enable intelligent prompt expansiongenerate_audio: Whether to generate synchronized audio with videoaudio_url: Custom audio file URLseed: Random seed
Doubao Seedance Series
Model Names:doubao-seedance-1-0-pro-250528- Pro version, supports text-to-video and image-to-video (first frame mode)doubao-seedance-1-0-lite-t2v-250428- Lite version text-to-videodoubao-seedance-1-0-lite-i2v-250428- Lite version image-to-video, supports first frame, first/last frame, reference image three modesdoubao-seaweed-1-0-t2v-250428- Seaweed version text-to-videowan2-1-14b-i2v-250417- Wanxiang version image-to-videowan2-1-14b-flf2v-250417- Wanxiang version first/last frame generation
- â Text-to-video (T2V)
- â Image-to-video - First frame mode (I2V)
- â
Image-to-video - First/last frame mode (only
doubao-seedance-1-0-lite-i2v-250428andwan2-1-14b-flf2v-250417support) - â
Image-to-video - Reference image mode (only
doubao-seedance-1-0-lite-i2v-250428supports)
--rs/--resolution: Resolution (480p,720p,1080p)--ratio: Aspect ratio (16:9,9:16,1:1,4:3,3:4,adaptive)--dur/--duration: Duration (seconds, e.g.5,10)--fps/--framespersecond: Frame rate (e.g.24,30)--seed: Random seed--wm/--watermark: Watermark toggle (true,false)--cf/--camerafixed: Fixed camera (true,false, only lite models support)
- In
metadata.contentarray, image items can be marked viarolefield:first_frame: First frame imagelast_frame: Last frame imagereference_image: Reference image (use[ĺžN]in prompt to reference)
doubao-seedance-1-0-lite-t2v-250428only supports text-to-video, does not support image input- Reference image mode of
doubao-seedance-1-0-lite-i2v-250428does not support1080presolution doubao-seedance-1-0-lite-t2v-250428does not supportadaptiveaspect ratio
Best Practices
Polling Strategy
- Python Polling Example
- JavaScript Polling Example
FAQ
- General Questions
- Sora 2
- Veo
- Ali Wanxiang
- Doubao Seedance
How long does video generation take?
How long does video generation take?
Usually takes 1-5 minutes, depending on video duration, resolution, and server load.
How long are generated videos valid?
How long are generated videos valid?
Video URLs are valid for approximately 24 hours. It is recommended to download and save immediately after receiving the response.
What image input formats are supported?
What image input formats are supported?
Supports PNG, JPEG, JPG, WEBP formats, maximum file size 10MB.
Related Resources
Image Generation
View image generation API documentation
Model List
View all supported model information
