vidu1.5
Before use, press Access Basics to set
SHANHAI_BASE_URL(this site’s root address) andSHANHAI_API_KEY(this site’s token). The following command is suitable for Bash; the material example address must be replaced with a real address that can be downloaded directly.
This is an older model. When this site omits parameters, the default request values are 5 seconds and 1080p; these two default values do not represent complete model specifications. Before accessing, please contact the site’s customer service to confirm the currently available duration, resolution, and mode combinations, and fill in the confirmed values explicitly; do not apply the Q2 or Q3 range.
Basic information
Submit POST /v1/videos, query GET /v1/videos/{task_id}, and download GET /v1/videos/{task_id}/content. After creation, save the id returned by this website.
request parameters
| Parameter | Type | Required | Meaning |
|---|---|---|---|
model |
string | Yes | Fixed filling in vidu1.5 |
prompt |
string | Depends on mode | Vincent video required; picture mode describes movement, shots and content to be retained |
images |
array of string | No | One represents the first frame, and two are processed by default as the first and last frames; the reference picture mode must clearly specify action |
seconds |
integer | No | The example and default value is 5; for other values, please confirm first |
resolution |
string | No | Default 1080p |
metadata |
object | No | Extended settings, see the table below for details; do not fill in |
Location of extended fields
The extended fields of these old models are placed in metadata. seconds and duration have the same purpose, it is recommended to only use seconds; if you also fill in duration in metadata, it will overwrite the top-level settings, so do not fill it in again.
| Field | Type | Usage |
|---|---|---|
metadata.seed |
integer | Random seed; random when omitted or 0, fixed value can reduce changes, but does not guarantee complete consistency every time |
metadata.aspect_ratio |
string | Vincent video ratio, available 16:9, 9:16, 1:1; picture mode gives priority to the input frame |
metadata.action |
string | Clear generation mode: text_to_video, image_to_video, first_tail_to_video, reference_to_video; the mode supported by the current model must be selected |
metadata.movement_amplitude |
string | Movement range, default auto; if not sure, keep the default |
metadata.payload |
string | Custom service mark, does not participate in the screen description; the corresponding relationship between the site id and the service number should also be saved locally |
images Fill in the image address that can be directly downloaded; do not pass the web page, local path or address that can only be accessed after logging in. A single local image can be submitted through the input_reference file field. For details, see Vidu Q3 Pro. It is recommended to use a JSON address array for multiple pictures. The order of pictures determines the first and last frames and reference numbers.
Request Example
First frame picture generation video
curl --fail-with-body "$SHANHAI_BASE_URL/v1/videos" \
-H "Authorization: Bearer $SHANHAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "vidu1.5",
"prompt": "镜头缓缓向前,画面中的主体自然移动,保持主体外观一致。",
"images": [
"https://example.com/first-frame.png"
],
"seconds": 5,
"resolution": "1080p",
"metadata": {
"seed": 42
}
}'
Pure text generation
{
"model": "vidu1.5",
"prompt": "清晨的湖面上,小船平稳驶过,镜头缓缓推进。",
"seconds": 5,
"resolution": "1080p",
"metadata": {
"aspect_ratio": "16:9",
"seed": 42
}
}
first and last frames and reference pictures
When you need to transition from the first frame to the last frame, change images to two addresses, in order of first frame and last frame. When you need to constrain the subject of multiple images together instead of transitioning from beginning to end, you must set action:reference_to_video in metadata; if you only pass two images without writing an action, they will be processed according to the beginning and end frames. The modes and picture limits of different models of the old version may be different. Please contact the site customer service for confirmation before using the reference mode.
Query tasks and downloads
The submission interface is POST /v1/videos. Save id in the response and use GET /v1/videos/{task_id} to query; successful task creation does not mean that the video has been generated.
curl --fail-with-body "$SHANHAI_BASE_URL/v1/videos/TASK_ID" \
-H "Authorization: Bearer $SHANHAI_API_KEY"
queued is queued, in_progress is being generated, and the query will continue after a few seconds; use GET /v1/videos/{task_id}/content to download after completed. Check the returned error cause when failed is reached and stop polling. Downloads must first check the status code to avoid saving error messages as videos.
curl --fail-with-body "$SHANHAI_BASE_URL/v1/videos/TASK_ID/content" \
-H "Authorization: Bearer $SHANHAI_API_KEY" -o result.mp4
Replace TASK_ID with the real task number. After the network times out, existing tasks will be queried first to avoid repeated submissions. For a complete polling example, see General Description of Video Interface.
encountered a problem
If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, task number, error time and error message. Do not provide the complete token.