wan3.0-video

wan3.0-video supports text, first frame, first and last frame, picture/video/audio reference, file and web page to generate video, and can also be edited or extended based on the reference video. Submit the task first, then check the status and download the results. Before use, press Access Basics to set SHANHAI_BASE_URL (this site’s root address, excluding /v1) and SHANHAI_API_KEY (this site’s token).

request parameters

Purpose Local interface
Submit POST /v1/videos
Query GET /v1/videos/{task_id}
Download GET /v1/videos/{task_id}/content

Carry Authorization: Bearer YOUR_API_KEY and Content-Type: application/json when submitting. You must also carry the site token when querying and downloading.

Parameter Type Required Description
model string is fixed to wan3.0-video
prompt string Condition required Video description, up to 20000 characters; provide at least one item with media. Reference video editing or extension intention is written here
media array Conditions required material list; each item contains type and url , see table below. If not passed, pure text will be generated
seconds integer No Output seconds, default 5; 2 ~ 30, or -1 indicates that the duration is determined intelligently by the model. When there is a reference video, the sum of the input video duration and the output duration shall not exceed 30 seconds
resolution string No 480P , 720P , 1080P; default 1080P
ratio string No adaptive (default), 21:9, 16:9, 4:3, 1:1, 3:4, 9:16
audio boolean No Whether to generate audio tracks, the default is true; false It is a video without audio track, which is not equivalent to uploading reference audio
prompt_extend boolean No Whether to intelligently rewrite the description, the default is true; it must be when using files or web pages true
watermark boolean No Whether to add watermark, default false
seed integer No -1 or 0 ~ 2147483647; omitted or -1 is a random seed. The same seed does not guarantee that the result will be completely consistent

This site also accepts duration as the duration field, and it is recommended to use seconds uniformly; smart duration can also be used auto_duration: true. media can also be written in metadata.input.media, the corresponding description can be written in metadata.input.prompt, and the processing parameters can be written in metadata.parameters; the following examples all use top-level fields to avoid repeated filling.

material type

type Quantity url and Limitations
first_frame Up to 1 picture First frame picture
last_frame Up to 1 last frame picture, must be used together with the first frame
reference_image Up to 10 pictures Reference subject, style or frame
reference_video Up to 5 reference, edited or extended videos; no more than 15 seconds in total
reference_audio Up to 5 segments reference sound; the total does not exceed 15 seconds, can be used as input alone
file Up to 1 document file; cannot be used simultaneously with link
link Up to 1 Public webpage without login; cannot be used simultaneously with file

Do not pass media when generating text only. The first frame/first and last frames can only be combined with each other, and cannot be mixed with any reference media, files or web pages; reference pictures, videos, and audios can be combined in any way, and files or web pages can also be combined with these reference media. Reference materials are numbered from 1 by type, and the materials can be specified in the description as "Picture 1", "Video 1", and "Audio 1". It is also possible to generate a video with only reference audio; to fix the start screen and refer to the sound, use reference_image + reference_audio instead, do not use first_frame + reference_audio.

material file restrictions

Material Format File size Other restrictions
Picture JPEG, JPG, PNG (transparent channel is not supported), BMP, WEBP Each picture does not exceed 20 MB Width and height are 240~8000 pixels each, and the aspect ratio does not exceed 8:1
Video MP4, MOV Each segment does not exceed 100 MB Each segment 115 seconds, the total does not exceed 15 seconds; frame rate is at least 16, width and height are 2404096 Pixels, aspect ratio not exceeding 8:1
Audio WAV, MP3 Each segment does not exceed 15 MB Each segment 1~15 seconds, the total does not exceed 15 seconds
document DOCX、DOC、XLSX、XLS、PPTX、PPT、PDF、TXT、KEY、PAGES、NUMBERS、MD No more than 100 MB Applicable formats such as PDFs, documents and presentations must not exceed 50 pages

url can be used to directly read the address of the material; data:image/...;base64,... can also be used for pictures. Web pages must be publicly accessible. Do not fill in local paths, pages that require login, or addresses that are temporarily expiring; assets should remain available while the task is being processed.

Request Example

The following JSON are independent requests. All example.com addresses are placeholders only and must be replaced with real accessible addresses.

text generation

curl "$SHANHAI_BASE_URL/v1/videos" \
  -H "Authorization: Bearer $SHANHAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan3.0-video",
    "prompt": "晨光下,一只红色纸船在平静的池塘上缓缓漂动。",
    "seconds": 5,
    "resolution": "720P",
    "ratio": "16:9",
    "audio": true
  }'

The above command works with Bash (Linux, macOS, or Git Bash).

first frame and first and last frame

When there is only the first frame, just delete the second item last_frame; only the last frame cannot be submitted.

{
  "model": "wan3.0-video",
  "prompt": "纸船从左侧缓缓驶向桥下,画面自然过渡。",
  "media": [
    { "type": "first_frame", "url": "https://example.com/start.png" },
    { "type": "last_frame", "url": "https://example.com/end.png" }
  ],
  "seconds": 5,
  "ratio": "adaptive"
}

Reference pictures, video and audio

You can keep only one of the reference media. Only sending reference_audio plus description is also a valid request. If the prompt says "Edit the background of video 1" or "Extend the end of video 1", use reference_video as well, and comply with the total duration limit of the input video and output video.

{
  "model": "wan3.0-video",
  "prompt": "图 1 中的人物出现在视频 1 的场景里,沿用音频 1 的节奏。",
  "media": [
    { "type": "reference_image", "url": "https://example.com/character.png" },
    { "type": "reference_video", "url": "https://example.com/scene.mp4" },
    { "type": "reference_audio", "url": "https://example.com/music.mp3" }
  ],
  "seconds": 8,
  "resolution": "1080P",
  "ratio": "adaptive",
  "seed": -1
}

file or web page

Use file to generate it based on the document content; change file to link and provide a public web page address, which is how the web page is generated. Documents or web pages can be added with reference images, videos or audio.

{
  "model": "wan3.0-video",
  "prompt": "根据文件里的产品资料制作一段简洁的展示视频。",
  "media": [{ "type": "file", "url": "https://example.com/product.pdf" }],
  "seconds": -1,
  "prompt_extend": true
}

Query and download

Save the real id in the commit response and use it to replace TASK_ID below. Continue querying when queued and in_progress, read error information when failed; download again after completed. When the submission times out and no number is received, check the tasks on this site first to avoid repeated submission and billing.

curl "$SHANHAI_BASE_URL/v1/videos/TASK_ID" \
  -H "Authorization: Bearer $SHANHAI_API_KEY"
curl --fail --location "$SHANHAI_BASE_URL/v1/videos/TASK_ID/content" \
  -H "Authorization: Bearer $SHANHAI_API_KEY" \
  -o result.mp4

The video address in the completion result may be valid for a limited time, please save it in time. When using reference videos, the billing time involves the total duration of the input and output videos; the specific cost is based on the model list and consumption records of this site. If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, task number and error message.