# Wan 3.0 All-in-One Video Generation > Generate videos with the Wan 3.0 All-in-One model — supports text-to-video, first/last-frame control, multimodal references including images, video, and audio, plus video editing **API:** POST https://toapis.com/v1/videos/generations **Note:** **Note for users in mainland China:** Please use `https://toapis.cn` as the API endpoint (Base URL). Replace `https://toapis.com` with `https://toapis.cn` in the examples in this document. The public model names for Wan 3.0 are `wan3.0-video` and `wan3.0-video-prime`. Both models use the same All-in-One API and support the following generation modes: - Text-to-video - First-frame or first/last-frame control - Joint generation with reference images, reference videos, and reference audio - File or public web page references - Video editing and extension (based on a reference video) The API is asynchronous. A successful submission returns a task ID; use the [Video Task Status](/docs/en/api-reference/tasks/video-status) endpoint to query progress and results. **Warning:** **First/last-frame mode and reference-asset mode are mutually exclusive.** If the request contains `first_frame` or `last_frame`, you cannot also pass reference images, reference videos, reference audio, files, or web links. Reference images, reference videos, and reference audio can be combined with each other. ## Authentication **Authorization (string, required)** Use Bearer Token authentication: ```text Authorization: Bearer YOUR_API_KEY ``` ## Request Parameters **model (string, required)** Default: "wan3.0-video" Model name. Use one of: - `wan3.0-video` - Standard Wan 3.0 All-in-One model - `wan3.0-video-prime` - Wan 3.0 Prime model Both models use the request schema documented on this page. **prompt (string)** Description of the video content, subject motion, camera work, and sound. At least one of `prompt` or media assets must be provided. When using multimodal references, you can write "image 1", "video 1", "audio 1" in the prompt, matching the array order. **duration (integer)** Default: "5" Output duration, supports `2` to `30` seconds. Pass `-1` for smart duration to let the model decide the output length automatically. **ratio (string)** Default: "adaptive" Output aspect ratio, supports: - `adaptive`, adapts to reference assets - `16:9` - `9:16` - `1:1` - `4:3` - `3:4` The compatible field `aspect_ratio` can also be used. Do not pass both fields. **resolution (string)** Default: "1080p" Output resolution, supports `480p`, `720p`, and `1080p`. **audio (boolean)** Default: true Whether to generate audio. Enabled by default. **watermark (boolean)** Default: false Whether to add a watermark. Disabled by default. **prompt_extend (boolean)** Default: true Whether to enable intelligent prompt rewriting. Enabled by default — set to `false` to disable. When enabled, a large language model rewrites and enriches the prompt, which improves results for short prompts but adds latency. Set to `false` to use your prompt verbatim. **seed (integer)** Optional random seed. The same parameters and seed help reproduce similar results. **image_with_roles (object[])** First/last-frame control array. Each item contains: - `url`: publicly accessible image URL - `role`: `first_frame` or `last_frame` Provide at most one first frame and one last frame. `last_frame` requires `first_frame` to be provided as well. **reference_images (string[])** Array of reference image URLs, up to `10` images. Cannot be mixed with first/last frames in `image_with_roles`. **video_list (object[])** Array of reference videos, up to `5` clips with a total duration not exceeding `15` seconds. Each item uses the following structure: ```json { "video_url": "https://example.com/reference.mp4" } ``` **audio_with_roles (object[])** Array of reference audio, up to `5` clips with a total duration not exceeding `15` seconds. Each item contains: - `url`: publicly accessible audio URL - `role`: fixed as `reference_audio` **metadata (object)** File or web page references are passed via `metadata.media`. **Show metadata.media structure** `media` is an array of objects, each containing `type` and `url`: - File: `{ "type": "file", "url": "https://example.com/brief.pdf" }` - Web page: `{ "type": "link", "url": "https://example.com/article" }` A single request accepts at most one file or one web page — they cannot be used together. Files and web pages also cannot be mixed with first/last-frame mode. **disable_nsfw (boolean)** Default: true Controls whether ToAPIs may use an NSFW-capable fallback for this video task. This is a ToAPIs platform parameter and is not forwarded to the upstream provider. - `true` or omitted: disable NSFW fallback - `false`: allow NSFW fallback when the account and sales region are eligible For example, add `"disable_nsfw": false` at the top level of the JSON request. Only an explicit JSON boolean `false` enables the fallback. `null` is treated as omitted. Other value types return `400`. Mainland China users and China sales regions always keep NSFW fallback disabled. **Note:** Local images or videos must be uploaded first to obtain a public URL. Do not pass local file paths or base64 data directly in the generation request. ## Asset Combination Rules | Request content | Supported | Notes | |---|---:|---| | Prompt only | Yes | Text-to-video | | First frame only | Yes | First-frame control | | First and last frame | Yes | Last frame cannot be used alone | | Reference images and reference videos | Yes | Can be combined | | Reference images, videos, and audio | Yes | Can be combined | | First frame and reference video | No | First/last-frame mode and reference-asset mode are mutually exclusive | | First/last frames and reference images | No | First/last-frame mode and reference-asset mode are mutually exclusive | | File and web link | No | Mutually exclusive | If you receive the following error: ```text Wan 3.0 cannot mix first/last frames with reference assets/files/web pages in the same request. ``` Remove the first/last frames and keep the reference assets; or remove all reference assets and keep only the first/last frames. ## Request Examples ### Text-to-Video ```bash curl --request POST \ --url https://toapis.com/v1/videos/generations \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "wan3.0-video", "prompt": "An orange cat running through the streets of Tokyo after rain, cinematic camera work", "duration": 5, "ratio": "16:9", "resolution": "1080p", "audio": true, "watermark": false }' ``` ### First/Last-Frame Video ```bash curl --request POST \ --url https://toapis.com/v1/videos/generations \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "wan3.0-video", "prompt": "The camera pushes in naturally as the person transitions from standing to smiling and waving", "duration": 8, "ratio": "adaptive", "resolution": "1080p", "image_with_roles": [ { "url": "https://example.com/first-frame.png", "role": "first_frame" }, { "url": "https://example.com/last-frame.png", "role": "last_frame" } ] }' ``` ### Reference-Video Generation Do not pass `first_frame` or `last_frame` in this request. ```bash curl --request POST \ --url https://toapis.com/v1/videos/generations \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "wan3.0-video", "prompt": "Use the camera work and movements from video 1 to generate a new street dance video", "duration": 10, "ratio": "adaptive", "resolution": "720p", "audio": true, "video_list": [ { "video_url": "https://example.com/reference-video.mp4" } ] }' ``` ### Video Editing Pass a reference video and include editing intent in the prompt (for example, "edit the video", "remove", "replace", "change to") so the task is classified as video editing: adding/removing/modifying elements, style transfer, lighting edits, dialogue editing, and reference-guided edits. Anything you do not ask to change stays unchanged. Video editing tasks require `ratio` to be `adaptive` and `duration` to be `-1` (automatically keeps the source video's aspect ratio and duration). The input video must be 4-30 seconds long. Requests that violate these constraints fail with a `video_edit_parameters_required` error. ```bash curl --request POST \ --url https://toapis.com/v1/videos/generations \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "wan3.0-video", "prompt": "Edit the video: change the person'\''s outfit to a red evening gown, keep everything else unchanged", "duration": -1, "ratio": "adaptive", "resolution": "720p", "video_list": [ { "video_url": "https://example.com/original.mp4" } ] }' ``` You can combine it with `reference_images` and `audio_with_roles` for reference-guided edits (applying elements from images into the video). Video extension works the same way: include extension intent in the prompt (for example, "extend", "continue"), and set `duration` to `-1` or to the input duration plus the expected extension length (total ≤ 30 seconds). ### Combined Image, Video, and Audio Reference ```bash curl --request POST \ --url https://toapis.com/v1/videos/generations \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "wan3.0-video", "prompt": "Generate a video using the character from image 1, the motion from video 1, and the rhythm of audio 1", "duration": 10, "ratio": "16:9", "resolution": "720p", "audio": true, "reference_images": [ "https://example.com/character.png" ], "video_list": [ { "video_url": "https://example.com/motion.mp4" } ], "audio_with_roles": [ { "url": "https://example.com/music.mp3", "role": "reference_audio" } ] }' ``` ### File Reference ```bash curl --request POST \ --url https://toapis.com/v1/videos/generations \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "wan3.0-video", "prompt": "Generate a concise product introduction video based on the file content", "duration": 10, "ratio": "16:9", "resolution": "1080p", "metadata": { "media": [ { "type": "file", "url": "https://example.com/product-brief.pdf" } ] } }' ``` ## Response **id (string)** Video task ID, used to query task status. **object (string)** Object type, usually `generation.task`. **model (string)** Model name used for this request. **status (string)** Task status: `queued`, `in_progress`, `completed`, or `failed`. **progress (integer)** Task progress, ranging from `0` to `100`. **created_at (integer)** Task creation timestamp. ## Response Examples ```json 200 { "id": "tsk_vid_xxx", "object": "generation.task", "model": "wan3.0-video", "status": "in_progress", "progress": 10, "created_at": 1781577600 } ```