Skip to main content

wan3check

Pre-flight validation for Alibaba Wan 3.0 (wan3.0-video) request bodies. No dependencies, Python 3.9+.

Most of this API's rules fail loudly, which is fine — you get an InvalidParameter and you fix it. Three of them fail silently: the request succeeds, the job is billed, and the result is not what you asked for. Those three are the reason this exists.

Silent failure What actually happens
resolution omitted You get 1080P, four times the 480P rate, with no warning
file or link without enable_thinking: true Request succeeds, is billed, and the model never reads your document
prompt over 20,000 characters Truncated silently — the clip ends mid-idea and nothing says so
pip install wan3check

Use it as a library

from wan3check import check

request = {
    "model": "wan3.0-video",
    "input": {
        "prompt": "A chef plates a dish under a heat lamp, then glances at the ticket rail.",
        "media": [{"type": "reference_video", "url": "https://…/dolly.mp4", "seconds": 4.5}],
    },
    "parameters": {"resolution": "720P", "duration": 5},
}

ok, findings, cost = check(request)
print(ok)      # True
print(cost)    # 1.0  — not 0.5; reference video seconds are billed on top
for f in findings:
    print(f)

Use it from the shell

$ wan3check request.json
WARNING [parameters.resolution] resolution is unset, which means 1080P  four times
        the 480P rate. Set it explicitly and opt up.
ERROR   [media.families] keyframe inputs (first_frame/last_frame) cannot be combined
        with reference inputs  pin the opening shot, or cast the subjects, not both

estimated cost: $6.00 at Alibaba's published list price
spec checked 2026-08-27

Exit code is 1 when there is an error, 0 otherwise. --strict also fails on warnings, which is what you want in CI. --json gives machine-readable output.

What it checks

Combination rules

  • first_frame/last_frame (keyframe family) cannot appear alongside reference_image/reference_video/reference_audio/file/link (reference family)
  • file and link are exclusive with each other — but reference_image plus link is legal, which is the combination most people assume is not
  • Per-type caps: 10 reference images, 5 reference videos, 5 reference audio clips, 1 file, 1 link

Duration budgets

  • duration is 2–30 integer, or -1 for model-decided
  • Reference video and reference audio each cap at 15 seconds in total, not per clip — three 5-second clips pass, two 10-second clips do not
  • Input video seconds + output seconds must total 30 or less

Values that do not exist

  • resolution is 480P/720P/1080P. There is no 4K tier; the error says so
  • ratio is adaptive/16:9/4:3/1:1/3:4/9:16. There is no 21:9; the error says so

Cost

estimate_cost() returns Alibaba's published list price, adding reference-video seconds on top of output seconds and rounding up — reference images, audio, documents and links are free. It returns None for duration: -1, because a job whose length the model chooses cannot be quoted in advance.

Evidence grades

wan3check.spec is the specification as data, with the check date and source URLs on it. Two entries are not from Alibaba's own English reference and are listed separately in spec.GATEWAY_SOURCED:

  • enable_thinking — documented as required for file/link by fal.ai, Picsart, Modellix and WaveSpeed, and present in Alibaba's own console curl examples, but a full-text search of the English API reference returns zero matches for thinking. This package raises it as a warning, not an error, for exactly that reason.
  • Reference-video billing — the formula input video seconds + output seconds appears identically in evolink, APIXO and aivideoapi's docs, and is corroborated by the separate input_video_duration and output_video_duration fields in Alibaba's own usage object.

Everything else comes from Alibaba Cloud's Model Studio API reference, read 2026-08-27. A specification is a fact about a moment, so wan3check.CHECKED carries the date and wan3check.SOURCES carries the URLs.

Tests

python -m unittest discover -s tests -v

Related

I maintain this alongside wan-3.run, a hosted browser interface for Wan 3.0 — the same rules are enforced there before a job is submitted, which is where most of them were learned. The spec table with each row linked to Alibaba's own documentation is the human-readable version of wan3check.spec, dated the same way and including the rows that are unflattering.

If you only want to draft a prompt, the prompt builder is free and needs no account.

Licence

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wan3check-0.1.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wan3check-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file wan3check-0.1.0.tar.gz.

File metadata

  • Download URL: wan3check-0.1.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for wan3check-0.1.0.tar.gz
Algorithm Hash digest
SHA256 42462f2c3efbdc23c152580bc2a22eeba8f2379a80d1e882f19034df95aeac24
MD5 b622ac9aa974fb1494572c7acc9dc547
BLAKE2b-256 4125d7bf78a9af49108b58b188b4b8b3b1c1dc6a1401073f4fce84240bc38d4e

See more details on using hashes here.

File details

Details for the file wan3check-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wan3check-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for wan3check-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 baa62c557342cffbd925d2a0eaaaebc7de544957a22a2b07928bb0d6923f75df
MD5 8179ed73f8e1d4ef1380c0dfe346ba33
BLAKE2b-256 640e5695baf5071df71d17e8aebf8b05a8257fa35c93ab6690a5be0dfadba7bb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page