Wan Video Generation
Wan provides text-to-video, image-to-video, first-and-last-frame, and reference-video generation through the same asynchronous video API.
Supported Models
| Model | Mode | Description |
|---|---|---|
| wan2.5-t2v-preview | Text-to-video | Wan 2.5 preview model |
| wan2.6-t2v | Text-to-video | Wan 2.6 model |
| wan2.7-t2v | Text-to-video | Wan 2.7 model |
| wan2.5-i2v-preview | Image-to-video | Wan 2.5 preview model |
| wan2.6-i2v | Image-to-video | Wan 2.6 model |
| wan2.1-kf2v-plus | First/last frames | Wan 2.1 keyframe model |
| wan2.6-r2v | Reference-to-video | Wan 2.6 character-reference model |
Overview
All modes use POST /v1/video/generations. Select a mode with the model and its input fields: text-to-video uses a prompt alone, image-to-video adds input_reference, first-and-last-frame generation uses two URLs under metadata.input, and reference-to-video uses metadata.input.reference_video_urls.
Generation is asynchronous: submit a task, poll it by ID, and retrieve the result URL when it succeeds.
Task Status Flow
queued → in_progress → completed
↓
failedAPI List
| Method | Path | Description |
|---|---|---|
| POST | /v1/video/generations | Submit a video generation task |
| GET | /v1/video/generations/{task_id} | Query task status and retrieve its result |
Model and Mode Differences
| Capability | Text-to-video | Image-to-video | First/last frames | Reference-to-video |
|---|---|---|---|---|
| Input | Prompt | First-frame URL or data URI | First- and last-frame URLs | 1–3 reference-video URLs |
| Resolution field | parameters.size | parameters.resolution | Fixed at 720P | parameters.size |
| Duration | 5, 10; 15 on 2.6 | 5, 10; 15 on 2.6 | Fixed at 5 | 5 or 10 |
| Audio | Wan 2.5/2.6 | Wan 2.5/2.6 | Not supported | Character voice from references |
| Multi-shot | Wan 2.6 with prompt extension | Wan 2.6 with prompt extension | Not supported | Supported |
1. Submit Video Generation Task (/v1/video/generations)
Choose the example matching your input assets and model family.
Usage Examples
{
"prompt": "A marble hand statue stands in a shallow pool as vines move in the breeze.",
"model": "wan2.6-t2v",
"metadata": {
"input": {
"negative_prompt": "trees, animals"
},
"parameters": {
"size": "1920*1080",
"duration": 10,
"audio": true,
"prompt_extend": true
}
}
}Provide the first frame as an HTTP(S) URL or an image data URI in
input_reference. Plain, unprefixed base64 is not accepted.
{
"prompt": "The light turns red and water begins overflowing around the statue.",
"model": "wan2.5-i2v-preview",
"input_reference": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"metadata": {
"input": {
"negative_prompt": "blurry, low quality, distorted"
},
"parameters": {
"resolution": "1080P",
"duration": 5,
"audio": true,
"watermark": false
}
}
}wan2.1-kf2v-plus accepts URL inputs only. Resolution is fixed at 720P,
duration at five seconds, and audio and shot controls are unavailable.
{
"prompt": "The hand-shaped statue cracks and collapses into the water.",
"model": "wan2.1-kf2v-plus",
"metadata": {
"input": {
"first_frame_url": "https://example.com/first-frame.png",
"last_frame_url": "https://example.com/last-frame.png",
"negative_prompt": "blurry, low quality"
},
"parameters": {
"watermark": false,
"prompt_extend": false,
"seed": 12345
}
}
}Reference a character's appearance and voice with one video. In the prompt,
refer to it as character1.
{
"prompt": "character1 drinks bubble tea while dancing to the music.",
"model": "wan2.6-r2v",
"metadata": {
"input": {
"reference_video_urls": [
"https://example.com/reference-video.mp4"
]
},
"parameters": {
"size": "1280*720",
"duration": 5,
"shot_type": "multi"
}
}
}Reference videos map by array position to character1, character2, and
character3 in the prompt.
{
"prompt": "character1 and character2 talk to each other in an office.",
"model": "wan2.6-r2v",
"metadata": {
"input": {
"reference_video_urls": [
"https://example.com/character1.mp4",
"https://example.com/character2.mp4"
],
"negative_prompt": "white walls"
},
"parameters": {
"size": "1280*720",
"duration": 10,
"shot_type": "multi",
"watermark": true
}
}
}Complete Request
curl -X POST "https://www.unodetech.xyz/v1/video/generations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer API_KEY" \
-d @request-body.jsonRequest Headers
| Header | Required | Value |
|---|---|---|
Content-Type | Yes | application/json |
Authorization | Yes | Bearer API_KEY |
Request Body Fields
Audio priority is
metadata.input.audio_urlovermetadata.parameters.audio. Omit both (or setaudiotofalse) for silent video, setaudiototruefor generated audio, or provideaudio_urlfor custom synchronized audio.
Response Example
{
"id": "TASK_ID",
"object": "video",
"model": "wan2.6-t2v",
"status": "queued",
"progress": 0,
"created_at": 1765328779
}Response Body Fields
2. Query Task Status (/v1/video/generations/{task_id})
Complete Request
curl -X GET "https://www.unodetech.xyz/v1/video/generations/TASK_ID" \
-H "Authorization: Bearer API_KEY"Request Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer API_KEY |
Path Parameters
Response Examples
{
"code": "success",
"message": "",
"data": {
"task_id": "TASK_ID",
"action": "textGenerate",
"status": "IN_PROGRESS",
"fail_reason": "",
"submit_time": 1765328779,
"start_time": 1765328794,
"finish_time": 0,
"progress": "30%",
"data": {
"output": {
"task_id": "TASK_ID",
"task_status": "RUNNING"
},
"request_id": "REQUEST_ID"
}
}
}{
"code": "success",
"message": "",
"data": {
"task_id": "TASK_ID",
"action": "textGenerate",
"status": "SUCCESS",
"fail_reason": "<OUTPUT_URL>",
"submit_time": 1765328779,
"start_time": 1765328794,
"finish_time": 1765328947,
"progress": "100%",
"data": {
"output": {
"actual_prompt": "<EDITED_PROMPT>",
"orig_prompt": "<ORIGINAL_PROMPT>",
"task_id": "TASK_ID",
"task_status": "SUCCEEDED",
"video_url": "<OUTPUT_URL>"
},
"request_id": "REQUEST_ID",
"usage": {
"video_count": 1,
"video_duration": 10,
"video_ratio": "1920*1080"
}
}
}
}Prefer data.data.output.video_url when retrieving the result. The upstream
API also places the URL in data.fail_reason on success.
{
"code": "success",
"message": "",
"data": {
"task_id": "TASK_ID",
"action": "textGenerate",
"status": "FAILURE",
"fail_reason": "task failed, code: InvalidParameter",
"progress": "100%",
"data": {
"output": {
"code": "InvalidParameter",
"message": "The request parameters are invalid.",
"task_id": "TASK_ID",
"task_status": "FAILED"
},
"request_id": "REQUEST_ID"
}
}
}Response Body Fields
Important Notes
- Image data in
input_referencemust be an HTTP(S) URL or a complete data URI; plain base64 is not accepted. wan2.1-kf2v-plusfirst/last-frame inputs accept URLs only.- Task IDs and output URLs are retained for 24 hours.
- Reference-to-video accepts one to three reference videos. Each should contain one character; array order defines
character1,character2, andcharacter3. - Reference-to-video billing uses the combined input and output duration. Truncated input durations contribute at most five billable seconds, and failed generations are not billed.
- Prompts, input assets, and output videos undergo content moderation.
Related Links
Last updated on
