Wan 2.7 R2V API

Wan 2.7 creates video using up to five mixed image, video, or audio references.

POST /v1/videos/generations

Reference-based video generation: up to 5 images/videos/audio mixed references.

Request parameters

ParameterTypeRequiredDescription
modelstringYesThe model name to be called, fill in the name from the model gallery.
durationintegerYesVideo duration (seconds). ⚠️ Must be placed at the **top level**, and must match the actual value in input/parameters — values placed inside nested structures will not be read.
resolutionstringYesResolution, take 480p / 720p / 1080p. ⚠️ Must also be placed at the **top level**, and must match parameters.size.
inputobjectYesGeneration inputs in the model’s native format. See the input.* fields below for the required inputs for each use case.
parametersobjectNoPass the generation parameters in their native format. Common pixel sizes for size: 480p → 832 × 480; 720p → 1280 × 720; 1080p → 1920 × 1080.
aspect_ratiostringNoAspect ratio, e.g. 16:9 / 9:16
waitbooleanNotrue = block until result (up to 60 seconds), false/omitted = immediately return task_id and then poll yourself (recommended).
callback_urlstringNoCallback URL after task completion.
idempotency_keystringNoIdempotency key, repeated submissions with the same key return the same task and do not incur additional charges.
input.promptstringYesPrompt, describing the scene to be generated.
input.ref_imgsarrayYesArray of reference material URLs, up to 5 items (can mix images/videos/audio references)
input.functionstringNoinput.function can be omitted — when omitted, automatically inferred from model name; when provided, uses the provided value.
parameters.sizestringNoPixel dimensions, e.g. 1280*720. Must be consistent with the top-level resolution.

Request example

curl https://api.router.ai/v1/videos/generations \
  -H "Authorization: Bearer sk-你的令牌" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan2.7-r2v",
    "duration": 5,
    "resolution": "720p",
    "input": {
      "prompt": "保持人物一致,走在雨后的街道上",
      "ref_imgs": ["https://example.com/ref1.png",
                   "https://example.com/ref2.png"]
    },
    "parameters": {"size": "1280*720"}
  }'

Endpoint reference: Aliyun Wan video generation