API DocsAI Model APIsVideosVidu

Reference-to-Video

Generate subject-consistent video from subjects or reference images/videos. Async task API: submit a request, receive a task_id, then poll the [Query Creations endpoint](./creations) for the result.

Generate subject-consistent video from a subject library or reference images/videos. The same endpoint supports two calling modes:

  • Subject-based call: Define image/video/text subjects via subjects, reference them in the prompt with @subjectname
  • Non-subject call: Pass images / videos directly as references

This is an async task-based API: submit a request to receive a task_id, then poll the Query Creations endpoint for the result.

Base URL

  • https://api.autorouter.top — Production

Authentication

BearerAuth: http (bearer) Authenticate using a Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Endpoints

POST /vidu/ent/v2/reference2video

Create Reference-to-Video Task

Subject-Based Call

Example:

{
  "model": "viduq3",
  "subjects": [
    {
      "name": "your_subject1_name",
      "images": ["your_image_url1", "your_image_url2", "your_image_url3"],
      "voice_id": ""
    },
    {
      "name": "your_subject2_name",
      "images": ["your_image_url4", "your_image_url5", "your_image_url6"],
      "voice_id": ""
    }
  ],
  "prompt": "@your_subject1_name 和 @your_subject2_name 在一起吃火锅,并且旁白音说火锅大家都爱吃。",
  "duration": 8,
  "audio": true
}

Properties:

NameTypeRequiredDescription
modelstringYesModel name. Available values: viduq3-turbo, viduq3, viduq2-pro, viduq2, viduq1, vidu2.0. viduq3-mix does not support subjects
auto_subjectsbooleanNoWhether to use the smart subject library, default false
subjectsarrayYesSubject list. q3 / q2 / q1 / 2.0: up to 7 image or text subjects; q2-pro: up to 4 image or text subjects, up to 2 video subjects (up to 1 temporary video subject)
subjects[].namestringYesSubject ID, referenced in the prompt via @subjectname
subjects[].imagesstring[]NoSubject images; one of images or videos is required. Up to 3 images; supports URL or Base64; formats png/jpeg/jpg/webp; aspect ratio less than 1:4 or 4:1; ≤ 20 MB after decode
subjects[].videosstring[]NoSubject videos, supported only on viduq2-pro. One of images or videos is required. Images and videos share 3 slots per subject; supports 1 five-second video; formats mp4/avi/mov; pixels ≥ 128×128
subjects[].voice_idstringNoVoice ID. Not effective in q3 reference-to-video models
subjects[].server_idstringNoSubject ID from an existing subject library; required when using an existing subject
promptstringYesText prompt, up to 5,000 characters. Reference subjects via @subjectname
audiobooleanNoWhether to output audio and video together. Default false; default true for viduq3 / viduq3-turbo
audio_typestringNoAudio type, required when audio is true, default all. Available: all, speech_only, sound_effect_only
durationintegerNoVideo duration. viduq3-turbo / viduq3: default 5, range 3–16; viduq2-pro: default 5, range 0–10 (0 means auto-detect); viduq2: default 5, range 1–10; viduq1: only 5; vidu2.0: only 4
seedintegerNoRandom seed. Uses a random value if omitted or set to 0
aspect_ratiostringNoAspect ratio, default 16:9. Available: 16:9, 9:16, 1:1. q2 models support arbitrary aspect ratios
resolutionstringNoResolution, default depends on model
movement_amplitudestringNoMotion amplitude, default auto. Not effective on q2 and q3
payloadstringNoPassthrough parameter, up to 1,048,576 characters
off_peakbooleanNoOff-peak mode. Supported on q3 when audio=true; supported on q2 / q1 / 2.0 when audio=false
watermarkbooleanNoWhether to add a watermark, not added by default
wm_positionintegerNoWatermark position: 1 top-left, 2 top-right, 3 bottom-right (default), 4 bottom-left
wm_urlstringNoCustom watermark image URL
meta_datastringNoMetadata identifier, JSON format string
callback_urlstringNoCallback URL (POST) when task status changes

Non-Subject Call (Video Generation)

Example:

{
  "model": "viduq3-mix",
  "images": [
    "https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-1.png",
    "https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-2.png",
    "https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-3.png"
  ],
  "prompt": "Santa Claus and the bear hug by the lakeside.",
  "duration": 5,
  "seed": 0,
  "aspect_ratio": "3:4",
  "resolution": "720p"
}

Properties:

NameTypeRequiredDescription
modelstringYesModel name. Available values: viduq3-mix, viduq3-turbo, viduq3, viduq2-pro, viduq2, viduq1, vidu2.0
imagesstring[]YesImage references, 1–7 images. viduq2-pro supports 1–7 images if no video is uploaded, or 1–4 if a video is uploaded. Formats png/jpeg/jpg/webp; pixels ≥ 128×128; aspect ratio less than 1:4 or 4:1; size ≤ 50 MB; request body ≤ 20 MB
videosstring[]NoVideo references, supported only on viduq2-pro. Up to 1 eight-second video or 2 five-second videos; formats mp4/avi/mov; size ≤ 100 MB
promptstringYesText prompt, up to 2,000 characters
audiobooleanNoWhether to output audio and video together, default true. Supported only on q3 series for non-subject calls
bgmbooleanNoWhether to add BGM, default false. Not effective on q2 when duration is 9 or 10 seconds; not effective on q3
durationintegerNoVideo duration. viduq3-mix / viduq3-turbo / viduq3: default 5, range 3–16; others same as subject-based call
seedintegerNoRandom seed
aspect_ratiostringNoAspect ratio, default 16:9. Available: 16:9, 9:16, 4:3, 3:4, 1:1. 4:3 and 3:4 supported only on q2 series
resolutionstringNoResolution, default depends on model
movement_amplitudestringNoMotion amplitude, default auto. Not effective on q2 and q3
payloadstringNoPassthrough parameter
off_peakbooleanNoOff-peak mode. viduq3-mix does not support off-peak
watermarkbooleanNoWhether to add a watermark
wm_positionintegerNoWatermark position
wm_urlstringNoCustom watermark image URL
meta_datastringNoMetadata identifier
callback_urlstringNoCallback URL

Responses

200: Task created successfully

Content-Type: application/json

400: Bad request / invalid parameters

Content-Type: application/json

429: Rate limit exceeded

Content-Type: application/json

Request Example

curl -X POST "https://api.autorouter.top/vidu/ent/v2/reference2video" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxxxxx" \
  -d '{
  "model": "viduq3-mix",
  "images": [
    "https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-1.png",
    "https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-2.png",
    "https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-3.png"
  ],
  "prompt": "Santa Claus and the bear hug by the lakeside.",
  "duration": 5,
  "seed": 0,
  "aspect_ratio": "3:4",
  "resolution": "720p"
}'

Response Example

{
  "task_id": "your_task_id_here",
  "state": "created",
  "model": "viduq3-mix",
  "images": [
    "https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-1.png",
    "https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-2.png",
    "https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-3.png"
  ],
  "prompt": "Santa Claus and the bear hug by the lakeside.",
  "duration": 5,
  "seed": 123456,
  "aspect_ratio": "3:4",
  "resolution": "720p",
  "credits": 4,
  "created_at": "2025-01-01T15:41:31.968916Z"
}

Response fields:

NameTypeDescription
task_idstringTask ID
statestringProcessing status: created, queueing, processing, success, failed
modelstringModel name
promptstringPrompt
imagesstring[]Image parameters
videosstring[]Video parameters (non-subject call)
durationintegerVideo duration
seedintegerRandom seed
aspect_ratiostringAspect ratio
resolutionstringResolution
bgmbooleanWhether BGM was used
audiobooleanWhether audio and video were output together
audio_typestringAudio type
movement_amplitudestringMotion amplitude
payloadstringPassthrough parameter
off_peakbooleanWhether off-peak mode was used
creditsintegerCredits consumed
watermarkbooleanWhether a watermark was added
created_atstringCreation time

GET /vidu/ent/v2/tasks/{id}/creations

Query Creations

See the Query Creations endpoint for details.

Request Example

curl -X GET "https://api.autorouter.top/vidu/ent/v2/tasks/{task_id}/creations" \
  -H "Authorization: Bearer sk-xxxxxx"

Error Handling

HTTP 400 Parameter Errors (pre-submit validation, no billing)

ScenarioResponse
Missing prompt{"code":"InvalidParameter","message":"...","request_id":"..."}
Subject call missing subjects / non-subject call missing images{"code":"InvalidParameter","message":"...","request_id":"..."}
Unknown model{"code":"InvalidParameter","message":"unknown model: ...","request_id":"..."}

HTTP 401 / 403 Auth Errors

  • 401 Unauthorized: API Key invalid or expired
  • 403 Forbidden: API Key has no access to this model

HTTP 402 Insufficient Balance

Returns insufficient user quota. Top up at the AutoRouter console.

Task failed Status

See err_code when the task fails. When a task enters failed, AutoRouter automatically refunds the billed quota.

On this page