wan3.0-video-prime

wan3.0-video-prime is a high-speed version. The input method and parameters are consistent with wan3.0-video : it supports the editing and extension of text, first frame, first and last frame, picture/video/audio reference, file, web page, and reference video. When calling, just replace model in the standard version example with wan3.0-video-prime; the two models are priced separately, please refer to the model list on this site.

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). Submit POST /v1/videos, query GET /v1/videos/{task_id}, and download through GET /v1/videos/{task_id}/content after completion. Each request carries the site token; Content-Type: application/json is also required when submitting.

request parameters

Parameter Type Required Description
model string is fixed to wan3.0-video-prime
prompt string Condition required Video description, up to 20000 characters; provide at least one item with media
media array Conditions required material list, each item contains type and url ;Do not pass
seconds integer No Output seconds, default 5; 2 ~ 30 or -1 indicates smart duration; when there is a reference video, the total duration of the input video and output video does 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 an audio track, the default is true; use it when uploading reference audio media
prompt_extend boolean No Smart rewrite description, default true; file and web page input must be true
watermark boolean No Whether to add watermark, default false
seed integer No -1 or 0 ~ 2147483647; omit or -1 is a random seed

This site is also compatible with duration to indicate duration. It is recommended to use seconds uniformly; auto_duration: true can also be used for smart duration. Materials and descriptions can also be written to metadata.input.media and metadata.input.prompt, and processing parameters can be written to metadata.parameters. Do not duplicate conflicting values ​​at the top level and in these objects.

Materials and combinations

media[].type Quantity Purpose
first_frame Up to 1 picture First frame of video
last_frame Up to 1 The last frame of the video must match the first frame
reference_image Up to 10 pictures Reference pictures
reference_video Up to 5 segments, totaling no more than 15 seconds Reference, edit or extend the video
reference_audio Up to 5 segments, the total length does not exceed 15 seconds Reference audio, can be used alone
file Up to 1 reference file; cannot be used with link
link Up to 1 Public webpage without login; cannot be used with file

The first frame/first and last frames cannot be mixed with reference pictures, videos, audios, files or web pages. Reference pictures, videos, and audios can be combined freely, or combined with files or web pages. "Picture 1", "Video 1" and "Audio 1" in the description respectively refer to the order in which reference materials of the same type appear. When you need to reference sounds and fixed characters, please use reference_image + reference_audio instead of first frame + audio.

Pictures support JPEG, JPG, PNG (without transparent channel), BMP, and WEBP; each picture should not exceed 20 MB, width and height should be 240 to 8000 pixels each, and the aspect ratio should not exceed 8:1. The video supports MP4 and MOV; each segment is 1 to 15 seconds, no more than 100 MB, the frame rate is at least 16, the width and height are 240 to 4096 pixels each, and the aspect ratio does not exceed 8:1. Audio supports WAV and MP3; each segment is 1 to 15 seconds and no more than 15 MB. Files support DOCX, DOC, XLSX, XLS, PPTX, PPT, PDF, TXT, KEY, PAGES, NUMBERS, MD, no more than 100 MB; applicable formats such as PDF, documents and presentations no more than 50 pages. The picture url can be a readable address or data:image/...;base64,...; for other materials, please use a directly readable address instead of a local path or an address that requires login.

Request Example

The commands below are for Bash (Linux, macOS, or Git Bash). example.com is a placeholder address and must be replaced with a real accessible address.

text generation

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

first frame, first and last frame

Delete the last_frame item when there is only the first frame; the last frame cannot be used alone.

{
  "model": "wan3.0-video-prime",
  "prompt": "从起始画面自然过渡到结束画面。",
  "media": [
    { "type": "first_frame", "url": "https://example.com/start.png" },
    { "type": "last_frame", "url": "https://example.com/end.png" }
  ],
  "seconds": 5,
  "ratio": "adaptive"
}

Picture, video, audio reference

You can keep only one item reference_audio plus description; you can also combine three references. To edit or extend a video, clearly state your intention to edit or extend it in prompt and provide reference_video.

{
  "model": "wan3.0-video-prime",
  "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",
  "seed": -1
}

file or web page

Change file to link and fill in the public web page address to generate a web page; you can also add reference pictures, videos or audios. file and link are not available at the same time.

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

Query and download

id in the submission response is the task number, replace TASK_ID below. Continue querying when queued and in_progress; read error and stop when failed; download after completed. When the submission times out and the number is not obtained, first check the existing tasks on this site and do not resend immediately.

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 address generating the result may be valid for a limited time, please save it in time. When using reference videos, billing involves the total duration of input and output videos; ultimately, the consumption records of this site shall prevail. If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, task number and error message.