Wan 3.0 · Per-second API

Alibaba Tongyi Wan 3.0: wan3.0-480p / wan3.0-720p / wan3.0-1080p three models, and the model name fixes the resolution. Each model has four lines (kd, hm, rh, rhp); pick a preferred one with the line parameter. On failure the task automatically moves to the next line; turn that off with auto_switch: false. Text-to-video, first frame, first-last frame, reference image / video / audio, and document / webpage-to-video; audio on by default; 2–30 s. Per-second billing, automatic refund on failure.

01Quick start

Async job: submit and get an id, poll until completed, then download the finished video.

Don't use the wrong endpoint. This family uses POST /v1/videos, and must not use /v1/chat/completions — calling it through the chat endpoint returns 404.

Base URL
https://www.salpx.com/v1
Auth
Authorization: Bearer <SalpX Token>
Submit a task
POST /v1/videos
Query status
GET /v1/videos/{id}
Model name
wan3.0-480p, wan3.0-720p, wan3.0-1080p
Line (optional)
line: kd / hm / rh / rhp, the preferred line; defaults to kd.
Auto line switching (optional)
auto_switch: default true; send false to use only the preferred line without switching (see section 02).
Required params
model, prompt, duration (integer seconds)
Client timeout
Recommended total polling timeout ≥ 900 s

Resolution is fixed by the model name — don't send it. Any size / resolution in the request body is overwritten with the tier implied by the model name.

02Models & pricing

Per-second billing: unit price × billed seconds = total. Prices are in CNY per second.

Model nameResolutionkdhmrhrhp (turbo)
wan3.0-480p480P¥0.18 / s¥0.28 / s¥0.32 / s¥0.65 / s
wan3.0-720p720P¥0.36 / s¥0.56 / s¥0.63 / s¥1.29 / s
wan3.0-1080p1080P¥0.72 / s¥1.11 / s¥1.26 / s¥2.57 / s

Choosing the line line: add a top-level "line": "kd" (or hm, rh, rhp); defaults to kd. rhp is the Wan 3.0 turbo line and renders faster; rh, rhp do not support first / last frame(first_frame / last_frame), only reference images / video / audio and document / webpage assets.

Automatic switching auto_switch (on by default): if the preferred line fails on submit or during generation, the task is re-run on the next line in the order kd → hm → rh → rhp (onwards from the preferred line, then wrapping around), billed at the unit price of the line that actually rendered it (the difference is refunded or charged when switching). Sending "auto_switch": false restricts the task to the preferred line: failures error out with a full refund, and the charge is always that line's unit price.

All lines accept the same parameters and return the same shape (rhp is the turbo line, the rest are standard). Both the response and the usage log report model as wan3.0-*; the log entry names the line that actually ran.

Reference images, reference audio, and document / webpage assets cost nothing extra; audio and silent video cost the same. On the kd and hm lines you pay only for output seconds — reference video is free; billing for reference video on rh / rhp is covered in the next section.

03Billing

Held on submit; fully refunded if the task fails or times out.

CaseFormula
No reference videounit price × output seconds
With reference video (reference_video), kd / hm linesunit price × output seconds (reference video free)
With reference video (reference_video), rh / rhp linesunit price × (output seconds + reference video seconds)

On the rh and rhp lines, reference video seconds are billed at the same unit price as output (upstream rule). The length is unknown at submit time, so the hold assumes the 15-second cap; once the task completes the charge is adjusted to the reference-video seconds reported upstream (rounded up to whole seconds).

Example: wan3.0-720p on the rh line with a 5-second output plus a 6-second reference video → ¥0.63 × (5 + 15) = ¥12.60 is held at submit, the final charge is ¥0.63 × (5 + 6) = ¥6.93, so ¥5.67 comes back.

04Asset rules

Asset typeLimitNotes
first_frame1First frame (a lone first frame means image-to-video from that frame)
last_frame1Last frame, paired with a first frame for first-last-frame mode
reference_image10Reference images, referenced in the prompt as “image 1”, “image 2”, … in order
reference_video5Reference video, ≤ 15 s total, called “video 1”, … (billed per second, see section 03)
reference_audio5Reference audio, ≤ 15 s total, called “audio 1”, …
file1Document-to-video (pdf / docx / pptx / xlsx / txt / md, ≤ 100 MB, ≤ 50 pages)
link1Public webpage-to-video (a page that needs no login)

Combination rules: first_frame / last_frame cannot be mixed with reference_*, file, link; file and link are mutually exclusive, and either one can be combined with reference_*; the three reference_* can be combined freely.

AssetFormat & limits
ImageJPEG / PNG (no alpha) / BMP / WEBP; 240–8000 px per side, aspect ratio ≤ 8:1, ≤ 20 MB
Videomp4 / mov; each clip 1–15 s, ≥ 16 fps, 240–4096 px per side, ≤ 100 MB
Audiowav / mp3; each clip 1–15 s, ≤ 15 MB
Output durationInteger seconds, 2–30; with reference video, reference seconds + output seconds ≤ 30

Media must be hosted at a publicly downloadable URL, or inlined as data:{MIME};base64,.... Private-cloud links, URLs behind a login, and hotlink-protected URLs make the task fail.

05Submit a task

5.1 Request format

Put the text in the top-level prompt; put assets in metadata.media, with each item shaped as {"type": ..., "url": ...}, type; allowed types are listed in section 04.

ParameterWhereNotes
durationtop levelRequired; output seconds, integer 2–30
ratiotop levelOptional: adaptive (default), 16:9, 9:16, 4:3, 3:4, 1:1, 21:9
input_referencetop levelOptional; shorthand for a first-frame URL, same as a single metadata.media entry first_frame
metadata.parameters.audiometadataGenerate audio, default true, same price
metadata.parameters.seedmetadataRandom seed, 0 – 2147483647
metadata.parameters.prompt_extendmetadataSmart prompt rewriting, default true (for document / webpage-to-video it must be true)

5.2 Text-to-video

curl
curl -X POST https://www.salpx.com/v1/videos \
  -H "Authorization: Bearer $SALPX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan3.0-720p",
    "line": "kd",
    "auto_switch": false,
    "prompt": "an orange tabby stretching on a windowsill, sunlight pouring in, slow push-in",
    "duration": 5,
    "ratio": "16:9"
  }'

5.3 First frame / first-last frame

curl
curl -X POST https://www.salpx.com/v1/videos \
  -H "Authorization: Bearer $SALPX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan3.0-720p",
    "prompt": "a smooth transition from the first image into the second",
    "duration": 5,
    "metadata": {
      "media": [
        {"type": "first_frame", "url": "https://your-cdn.com/first.png"},
        {"type": "last_frame",  "url": "https://your-cdn.com/last.png"}
      ]
    }
  }'

For first-frame image-to-video you can also pass a top-level "input_reference": "https://your-cdn.com/first.png".

5.4 Multi-asset reference (image + video + audio)

curl
curl -X POST https://www.salpx.com/v1/videos \
  -H "Authorization: Bearer $SALPX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan3.0-1080p",
    "prompt": "the character from image 1 dances along with video 1, matching the beat of audio 1",
    "duration": 8,
    "ratio": "16:9",
    "metadata": {
      "media": [
        {"type": "reference_image", "url": "https://your-cdn.com/char.png"},
        {"type": "reference_video", "url": "https://your-cdn.com/dance.mp4"},
        {"type": "reference_audio", "url": "https://your-cdn.com/bgm.mp3"}
      ]
    }
  }'

With a reference_video: no surcharge on the kd and hm lines; on rh / rhp the reference-video seconds are billed at the unit price too — see section 03.

5.5 Document / webpage-to-video

curl
curl -X POST https://www.salpx.com/v1/videos \
  -H "Authorization: Bearer $SALPX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan3.0-720p",
    "prompt": "turn this product deck into a 30-second promo video",
    "duration": 30,
    "metadata": {
      "media": [
        {"type": "file", "url": "https://your-cdn.com/intro.pdf"}
      ]
    }
  }'

For webpage-to-video, change type to link, url and put the public page URL there.

5.6 Successful submit response

The response returns the SalpX task ID(task_ prefix); use it for all later queries.

200 response
{
  "id": "task_xeYwLgSoqtHyMKrKDeFcuzfkzFPRB8uu",
  "task_id": "task_xeYwLgSoqtHyMKrKDeFcuzfkzFPRB8uu",
  "object": "video",
  "model": "wan3.0-720p",
  "status": "queued",
  "progress": 0,
  "created_at": 1791960031
}

06Poll & fetch

Poll with GET /v1/videos/{id} at an interval of 15 s.

curl · query status
curl https://www.salpx.com/v1/videos/task_xeYwLgSoqtHyMKrKDeFcuzfkzFPRB8uu \
  -H "Authorization: Bearer $SALPX_KEY"
statusMeaning
queuedQueued
in_progressIn progress
completedCompleted; the video URL is in metadata.url
failedFailed; the reason is in error; already refunded

The video URL is in metadata.url, not at the top level. Read it asresp["metadata"]["url"].

200 response · completed
{
  "id": "task_xeYwLgSoqtHyMKrKDeFcuzfkzFPRB8uu",
  "object": "video",
  "model": "wan3.0-720p",
  "status": "completed",
  "progress": 100,
  "created_at": 1791960031,
  "completed_at": 1791960222,
  "metadata": {
    "url": "https://dashscope-xxxx.oss-accelerate.aliyuncs.com/xxxx.mp4?Expires=..."
  }
}

Video links expire after 24 hours — download and store them promptly.

07Error handling

HTTPTypical messageFix
404bad response status code 404You used /v1/chat/completions; switch to POST /v1/videos
400duration out of rangeInteger seconds, 2–30
400prompt is requiredprompt is required
—Task failed: InvalidParameter … mutually exclusiveFirst / last frame was mixed with reference_* / file / link; see the combination rules in section 04
—Task failed: asset download failedMedia URLs must be publicly downloadable
403token quota is not enoughInsufficient balance (tasks with reference video hold against the 15 s cap) — top up or use another token
503No available channelModel name typo, or the token group has no access

Failed tasks are refunded automatically. If a submit is rejected, the upstream fails, the request times out, or the task enters failed, the charged quota is refunded in full.