Skip to content
Эта страница пока недоступна на вашем языке, поэтому она отображается на английском.

Wan3.0 Video Generation

Alibaba Cloud Wanxiang 3.0 all-in-one reference video model

Вся документация
POST/v1/videos/generations
  • Text-to-video / first frame / first+last frame / multi-modal reference / file or link reference
  • Resolution 480P / 720P / 1080P, duration 2–30 seconds, or -1 for model-chosen length
  • Supports images, video, audio, documents, and public web pages as references

Примеры запросов

curl --request POST \
  --url https://api.apisea.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "wan3.0-video",
    "prompt": "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
    "resolution": "720P",
    "size": "21:9",
    "duration": 5,
    "prompt_extend": false,
    "seed": -1
  }'

Authorization

Authorizationstringrequired

All endpoints require Bearer Token authentication

Get your API Key from the API Key Management Page:

text
Authorization: Bearer YOUR_API_KEY

Generation Modes

Model name is wan3.0-video or wan3.0-video-prime (same parameters). Modes are selected by request fields:

ModeTypical inputs
Text-to-videoprompt only
First-frame videoone item in image_urls (frame family)
First + last frametwo items in image_urls, or image_with_roles with first_frame / last_frame
Reference videoreference images / videos / audio; prompt may use “图1 / 视频1 / 音频1” style labels
File / page referencefile_url or link_url (prompt optional)

Request Parameters

Basics

modelstringrequired

Video generation model name. Allowed values:

  • wan3.0-video
  • wan3.0-video-prime

Both models accept exactly the same request parameters.

nsfw_checkbooleandefault: false

Whether to run content moderation before submitting the video task.

  • true: use omni-moderation-latest to review prompts and input images
  • false or omitted: do not send a moderation request, adding no moderation cost or latency (default)
promptstring

Text description. Required unless media fields are provided (at least one of prompt or media).

  • Max 20,000 characters; overflow is truncated automatically (no error)
  • In reference mode, use “图N / 视频N / 音频N” to address assets; indices follow order within each media type
prompt_extendbooleandefault: true

Enable intelligent prompt rewriting. true or omission enables it (upstream default); false disables it. Rewriting can improve short prompts but may increase latency.

With file_url or link_url, prompt_extend must be true or omitted. false returns HTTP 400 at submission without creating a task or charging.

resolutionstringdefault: 1080P

Output resolution (case-insensitive)

  • 480P
  • 720P
  • 1080P (default, highest price)

Warning

Omitting resolution bills at 1080P. Pass 480P or 720P explicitly when cost matters.

sizestringdefault: adaptive

Aspect ratio. aspect_ratio is also accepted.

  • adaptive (default)
  • 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16

If both size and aspect_ratio are supplied, they must match; otherwise submission returns HTTP 400. For first-frame, first/last-frame, and reference-media tasks, adaptive is recommended to follow the media, but explicit ratios including 21:9 are also supported.

durationintegerdefault: 5

Duration in seconds:

  • 2–30: fixed output length (default 5)
  • -1: model decides the duration

Note

With reference video input, total input video duration + output duration must be ≤ 30 seconds. When duration is -1, the model chooses the length, which must still satisfy this constraint.

audiobooleandefault: true

Whether the output includes an audio track. Default true. Price is the same with or without audio.

seedinteger

Integer random seed: -1 or [0, 2147483647]. -1 is equivalent to omission and selects a random seed. Out-of-range values such as -2 or 2147483648 return HTTP 400 at submission.

watermarkbooleandefault: false

Whether to add a watermark. Default false

generation_typestring

How bare image_urls are classified:

  • frame — first/last frame family
  • reference — reference family

If omitted, classification is automatic (see mutual exclusion rules).

Media inputs

image_urlsstring[]

Image URL array. Role assignment follows mutual exclusion rules.

Public URLs only.

image_with_rolesobject[]

Images with explicit roles. Each item:

  • url: image address
  • role: first_frame / last_frame / reference_image (common aliases accepted)
video_urlsstring[]

Reference videos, up to 5 clips; each 1–15s, total ≤ 15s

audio_urlsstring[]

Reference audio, up to 5 clips; each 1–15s, total ≤ 15s

audio_urlstring

Single reference audio (single-value form of audio_urls)

file_urlstring

Reference document URL, at most 1. Cannot be combined with link_url.

Formats include docx / doc / xlsx / xls / pptx / ppt / pdf / txt / key / pages / numbers / md, ≤100MB, ≤50 pages.

With file_url or link_url, prompt_extend must be true or omitted. false returns HTTP 400 at submission without creating a task or charging.

link_urlstring

Public web page URL, at most 1. Login-free pages only. Cannot be combined with file_url.

With file_url or link_url, prompt_extend must be true or omitted. false returns HTTP 400 at submission without creating a task or charging.

Mutual Exclusion of Media Families

Media belongs to one of two families and must not be mixed (validated before submit → 400, no task, no charge):

FamilyMembersMeaning
Frame familyfirst_frame, last_frameStrict first / last frame of the video
Reference familyreference_image, reference_video, reference_audio, file, linkModel interprets content freely

How bare image_urls are assigned

  1. If generation_type is set → use it (frame / reference)
  2. Else if the request already has reference-family inputs (video_urls / audio_urls / audio_url / file_url / link_url) → treat as reference_image
  3. Else → frame family: first item first_frame, second last_frame (same as wan2.7)

Use image_with_roles when you need explicit control.

Media limits and formats

TypeLimits
First / last frame≤ 1 each
Reference images≤ 10
Reference video≤ 5 clips, 1–15s each, total ≤15s; mp4/mov; edge 240–4096 px, aspect ≤8:1, ≤100MB
Reference audio≤ 5 clips, 1–15s each, total ≤15s; wav/mp3; ≤15MB
ImagesJPEG/JPG/PNG (no alpha) / BMP / WEBP; edge 240–8000 px, aspect ≤8:1, ≤20MB
Documents≤100MB, ≤50 pages
Web pagesPublic, login-free URLs

Request Examples

Text-to-video

json
{
  "model": "wan3.0-video",
  "prompt": "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
  "resolution": "720P",
  "size": "21:9",
  "duration": 5,
  "prompt_extend": false,
  "seed": -1
}

First-frame video

json
{
  "model": "wan3.0-video-prime",
  "prompt": "The person in the frame starts freestyle rapping, camera slowly pushes in",
  "image_urls": ["https://example.com/first.png"],
  "aspect_ratio": "21:9",
  "resolution": "720P",
  "duration": 5
}

First + last frame

json
{
  "model": "wan3.0-video",
  "prompt": "Smile gradually becomes laughter, background light shifts from cool to warm",
  "image_urls": [
    "https://example.com/first.png",
    "https://example.com/last.jpg"
  ],
  "duration": 5
}

Or with image_with_roles:

json
{
  "model": "wan3.0-video",
  "prompt": "Smile gradually becomes laughter",
  "image_with_roles": [
    {"url": "https://example.com/first.png", "role": "first_frame"},
    {"url": "https://example.com/last.jpg", "role": "last_frame"}
  ],
  "duration": 5
}

Multi-modal reference

json
{
  "model": "wan3.0-video",
  "prompt": "视频1抱着图1,在图3的椅子上弹奏一支舒缓的乡村民谣,并说道:\"今天的阳光真好。\"",
  "generation_type": "reference",
  "image_urls": [
    "https://example.com/object1.jpg",
    "https://example.com/object2.png",
    "https://example.com/chair.png"
  ],
  "video_urls": ["https://example.com/role.mp4"],
  "resolution": "480P",
  "duration": 5
}

With video_urls present, bare image_urls auto-classify as reference images; setting generation_type: "reference" is clearer.

File reference video

prompt may be omitted; generation is driven by the document:

json
{
  "model": "wan3.0-video",
  "file_url": "https://example.com/glass.pptx",
  "resolution": "480P",
  "prompt_extend": true,
  "duration": 10
}

Web page reference video

json
{
  "model": "wan3.0-video",
  "prompt": "Turn this article into a short educational video",
  "link_url": "https://example.com/article/123",
  "prompt_extend": true,
  "duration": 15
}

Billing

Per second × resolution (aligned with official list price). Audio on/off does not change price:

ResolutionUnit price5s30s
480P¥0.30 / s¥1.50¥9.00
720P¥0.60 / s¥3.00¥18.00
1080P¥1.20 / s¥6.00¥36.00
  • Default is 1080P (most expensive); pass 480P / 720P when cost-sensitive
  • Billable seconds: for 2–30, use the requested duration; for -1, use the actual output seconds
  • audio: true/false does not affect price
  • size / aspect_ratio, prompt_extend, and seed do not affect pricing. Billing remains based on duration and resolution.

Limits and Notes

ItemNotes
DurationInteger 2–30, or -1 (model decides length)
With video inputInput video total duration + output duration ≤ 30s
LatencyTypically 1–5 minutes; longer for long clips
Result URLMirrored to the platform CDN after success for long-term access
Prompt≤20,000 characters; overflow truncated

Common Errors

All are sync 400 (no task, no charge):

CaseWhat to do
Mixing frame and reference familiesPick one family via generation_type, or set roles with image_with_roles
Both file_url and link_urlChoose one
Invalid durationOnly 2–30 or -1
Unsupported resolution (e.g. 4K)Only 480P / 720P / 1080P
More than 10 reference imagesReduce to ≤10
Empty prompt and empty mediaProvide at least one
Unsupported ratio (e.g. 2:1)Use adaptive / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16
Conflicting size and aspect_ratioSend only one, or use matching values
file_url / link_url with prompt_extend: falseUse true or omit prompt_extend
Out-of-range seedUse integer -1 or [0, 2147483647], or omit it for a random seed

For these new parameter validation failures, error.code and error.type are invalid_request_error; read error.message for details. For wan3.0-video-prime, the model name in the message changes accordingly.

Response

codeinteger

Status code; 200 on success

dataarray

Response data array

Array elements

statusstring

Task status; submitted on create

task_idstring

Task ID for polling

Note

Query results

Video generation is async. Poll Get Task Status or GET /v1/videos/generations/{task_id}.

Recommended interval 5–10 seconds; generation typically takes 1–5 minutes. On success, use URLs in result.videos.

Ответы

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
    }
  ]
}

Нашли ошибку в документации? Напишите на support@apisea.ai.