Developer Docs/Wan Video API

Wan Video API

Build Wan Video integrations with A2E. Review authentication, request parameters, task creation, status, and result endpoints.

Overview

Animate a still image into a video using the Wan 2.5 / 2.6 open-source video diffusion model family. Part of the Wan series known for fluid motion and temporal consistency.

Primary Endpoint

POST/api/v1/userWan25/start

Start a Wan video generation task. This endpoint supports Wan 2.5 image-to-video, Wan 2.6 image-to-video and Wan 2.7 multi-mode video generation. For Wan 2.7, set `model` to `wan2.7-i2v` and select the generation mode with `task_type`: - `text_to_video`: text prompt only. Do not provide image/video material. - `first_frame`: image-to-video from one first-frame image. Requires `image_url`. - `first_last_frame`: image-to-video with first and last frame control. Requires `image_url` and `last_frame_url`. - `reference_image`: reference-to-video. Requires 1 to 5 ordered image/video entries in `reference_media`; legacy pure-image clients may continue using `reference_image_urls`. - `video_extend`: extend an existing video clip. Requires `first_clip_url`; optional `last_frame_url`. - `video_edit`: edit an existing video. Requires `edit_video_url`; optional `reference_image_urls` with up to 3 image URLs. `text_to_video`, `first_last_frame`, `reference_image`, `video_extend` and `video_edit` are only available when `model=wan2.7-i2v`. ### Request - Send a valid bearer token. The server evaluates the operation in the authenticated caller's access context. - Send an `application/json` body. Required fields: `prompt`. - API-token callers may include `webhook_url` and `webhook_token` for best-effort terminal-state notifications; ordinary JWT/cookie calls ignore these fields. ### Behavior - This is an asynchronous operation: a successful submission creates a task and returns before processing finishes. - Persist the returned task identifier and use the corresponding detail or list operation to observe progress. - Treat the detail endpoint as the source of truth even when webhook delivery is enabled. ### Response - A `200` response confirms task acceptance; it does not by itself mean media generation has completed. - Retain the returned identifier and wait for a documented terminal status before using output URLs. - JSON object responses, including error responses, normally carry a top-level `trace_id` string for this request; include it when contacting support. It is not a task identifier. - Do not infer undocumented fields or statuses; clients should tolerate additional response properties. ### Errors - `400` — Bad Request - Invalid parameters. - `401` — Unauthorized - Invalid or missing JWT token. Authentication: set header Authorization: Bearer <token> (supports user JWT or sk_ API token).

Request Parameters

NameTypeRequiredDescription
namestringNoOptional display name for the task
image_urlstringNoSource image URL. Required for `first_frame` and `first_last_frame`.
promptstringYesGeneration prompt
negative_promptstringNoNegative prompt to avoid unwanted features
durationenum: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15NoVideo duration in seconds. Wan 2.6 and Wan 2.7 accept any integer from 2 to 15, except: reference_image drops to 2-10 when a reference video is present, and video_edit uses 5-10. Wan 2.5 only supports 5/10.; default: "5"
resolutionenum: 480p | 720p | 1080pNoVideo resolution; default: "720p"
ratioenum: 16:9 | 9:16 | 1:1 | 4:3 | 3:4NoVideo aspect ratio. Only used by Wan 2.7 `text_to_video` and `reference_image`.; default: "16:9"
enable_prompt_expansionbooleanNoWhether to enable prompt rewriting using LLM; default: false
multi_shotsbooleanNoEnable intelligent multi-shot segmentation (only active when enable_prompt_expansion is true); default: false
modelenum: wan2.5-i2v-preview | wan2.6-i2v | wan2.6-i2v-flash | wan2.7-i2vNoAI model version (wan2.6-i2v and wan2.7-i2v require VIP/Max user, wan2.6-i2v-flash is available to all users); default: "wan2.5-i2v-preview"
task_typeenum: text_to_video | first_frame | first_last_frame | reference_image | video_extend | video_editNoWan 2.7 generation mode. Only used when `model=wan2.7-i2v`.; default: "first_frame"
last_frame_urlstringNoLast-frame image URL. Required for `first_last_frame`; optional for `video_extend`.
first_clip_urlstringNoExisting video clip URL. Required for Wan 2.7 `video_extend`.
edit_video_urlstringNoInput video URL. Required for Wan 2.7 `video_edit`.
reference_image_urlsarray<string>NoLegacy pure-image reference URLs for Wan 2.7 `reference_image`; optional for `video_edit` (up to 3 images).
reference_mediaarray<object>NoOrdered Wan2.7 reference-to-video media. Input videos are billed together with output duration according to the official 5-second input cap.; minItems: 1; maxItems: 5
reference_media[].typeenum: reference_image | reference_videoYes-
reference_media[].urlstringYes-
reference_media[].durationnumberNoReference video duration in seconds. The server probes metadata when omitted.
seednumberNoRandom seed for reproducibility. Value must be in the range [0, 2147483647]. If not specified, system generates a random seed.; minimum: 0; maximum: 2147483647
audiobooleanNoWhether to generate audio for the video; default: true
audio_urlstringNoURL of audio file to use for first-frame/first-last-frame video generation. Supports WAV/MP3, 3-30s duration, max 15MB. If longer than video duration, audio will be truncated.
minor_suspected_skipbooleanNoSet to true when retrying after error code 1004 to confirm and bypass the suspected-minor soft block.; default: false
webhook_urlstringNoHTTPS URL to receive task.completed / task.failed notifications. Best-effort delivery, single attempt, no retries; clients should treat the detail API as the source of truth.; maxLength: 2048
webhook_tokenstringNoOptional plaintext token returned in the X-A2e-Webhook-Token header so receivers can verify the request originated from a2e.; maxLength: 256
Request schema and conditional rules
{
  "allOf": [
    {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Optional display name for the task",
          "example": "My Wan Video"
        },
        "image_url": {
          "type": "string",
          "description": "Source image URL. Required for `first_frame` and `first_last_frame`.",
          "example": "https://example.com/image.jpg"
        },
        "prompt": {
          "type": "string",
          "description": "Generation prompt",
          "example": "Make the person in the image wave their hand"
        },
        "negative_prompt": {
          "type": "string",
          "description": "Negative prompt to avoid unwanted features",
          "example": "blurry, distorted"
        },
        "duration": {
          "type": "string",
          "enum": [
            "2",
            "3",
            "4",
            "5",
            "6",
            "7",
            "8",
            "9",
            "10",
            "11",
            "12",
            "13",
            "14",
            "15"
          ],
          "default": "5",
          "description": "Video duration in seconds. Wan 2.6 and Wan 2.7 accept any integer from 2 to 15, except: reference_image drops to 2-10 when a reference video is present, and video_edit uses 5-10. Wan 2.5 only supports 5/10."
        },
        "resolution": {
          "type": "string",
          "enum": [
            "480p",
            "720p",
            "1080p"
          ],
          "default": "720p",
          "description": "Video resolution"
        },
        "ratio": {
          "type": "string",
          "enum": [
            "16:9",
            "9:16",
            "1:1",
            "4:3",
            "3:4"
          ],
          "default": "16:9",
          "description": "Video aspect ratio. Only used by Wan 2.7 `text_to_video` and `reference_image`."
        },
        "enable_prompt_expansion": {
          "type": "boolean",
          "default": false,
          "description": "Whether to enable prompt rewriting using LLM"
        },
        "multi_shots": {
          "type": "boolean",
          "default": false,
          "description": "Enable intelligent multi-shot segmentation (only active when enable_prompt_expansion is true)"
        },
        "model": {
          "type": "string",
          "enum": [
            "wan2.5-i2v-preview",
            "wan2.6-i2v",
            "wan2.6-i2v-flash",
            "wan2.7-i2v"
          ],
          "default": "wan2.5-i2v-preview",
          "description": "AI model version (wan2.6-i2v and wan2.7-i2v require VIP/Max user, wan2.6-i2v-flash is available to all users)"
        },
        "task_type": {
          "type": "string",
          "enum": [
            "text_to_video",
            "first_frame",
            "first_last_frame",
            "reference_image",
            "video_extend",
            "video_edit"
          ],
          "default": "first_frame",
          "description": "Wan 2.7 generation mode. Only used when `model=wan2.7-i2v`."
        },
        "last_frame_url": {
          "type": "string",
          "description": "Last-frame image URL. Required for `first_last_frame`; optional for `video_extend`.",
          "example": "https://example.com/last-frame.jpg"
        },
        "first_clip_url": {
          "type": "string",
          "description": "Existing video clip URL. Required for Wan 2.7 `video_extend`.",
          "example": "https://example.com/clip.mp4"
        },
        "edit_video_url": {
          "type": "string",
          "description": "Input video URL. Required for Wan 2.7 `video_edit`.",
          "example": "https://example.com/input-video.mp4"
        },
        "reference_image_urls": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Legacy pure-image reference URLs for Wan 2.7 `reference_image`; optional for `video_edit` (up to 3 images).",
          "example": [
            "https://example.com/reference-1.jpg",
            "https://example.com/reference-2.jpg"
          ]
        },
        "reference_media": {
          "type": "array",
          "minItems": 1,
          "maxItems": 5,
          "description": "Ordered Wan2.7 reference-to-video media. Input videos are billed together with output duration according to the official 5-second input cap.",
          "items": {
            "type": "object",
            "required": [
              "type",
              "url"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "reference_image",
                  "reference_video"
                ]
              },
              "url": {
                "type": "string"
              },
              "duration": {
                "type": "number",
                "description": "Reference video duration in seconds. The server probes metadata when omitted."
              }
            }
          }
        },
        "seed": {
          "type": "number",
          "minimum": 0,
          "maximum": 2147483647,
          "description": "Random seed for reproducibility. Value must be in the range [0, 2147483647]. If not specified, system generates a random seed."
        },
        "audio": {
          "type": "boolean",
          "default": true,
          "description": "Whether to generate audio for the video"
        },
        "audio_url": {
          "type": "string",
          "description": "URL of audio file to use for first-frame/first-last-frame video generation. Supports WAV/MP3, 3-30s duration, max 15MB. If longer than video duration, audio will be truncated.",
          "example": "https://example.com/audio.mp3"
        },
        "minor_suspected_skip": {
          "type": "boolean",
          "default": false,
          "description": "Set to true when retrying after error code 1004 to confirm and bypass the suspected-minor soft block."
        }
      },
      "required": [
        "prompt"
      ],
      "x-duration-options-by-task-type": {
        "text_to_video": [
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15"
        ],
        "first_frame": [
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15"
        ],
        "first_last_frame": [
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15"
        ],
        "reference_image": [
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15"
        ],
        "video_extend": [
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15"
        ],
        "video_edit": [
          "5",
          "6",
          "7",
          "8",
          "9",
          "10"
        ]
      },
      "anyOf": [
        {
          "title": "Wan 2.5 first frame",
          "type": "object",
          "properties": {
            "model": {
              "type": "string",
              "enum": [
                "wan2.5-i2v-preview"
              ]
            },
            "task_type": {
              "type": "string",
              "enum": [
                "first_frame"
              ],
              "default": "first_frame"
            },
            "duration": {
              "type": "string",
              "enum": [
                "5",
                "10"
              ],
              "default": "5"
            }
          }
        },
        {
          "title": "Wan 2.6 first frame",
          "type": "object",
          "properties": {
            "model": {
              "type": "string",
              "enum": [
                "wan2.6-i2v",
                "wan2.6-i2v-flash"
              ]
            },
            "task_type": {
              "type": "string",
              "enum": [
                "first_frame"
              ]
            },
            "duration": {
              "type": "string",
              "enum": [
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15"
              ],
              "default": "5"
            }
          }
        },
        {
          "title": "Wan 2.7 text to video",
          "type": "object",
          "properties": {
            "model": {
              "type": "string",
              "enum": [
                "wan2.7-i2v"
              ]
            },
            "task_type": {
              "type": "string",
              "enum": [
                "text_to_video"
              ]
            },
            "duration": {
              "type": "string",
              "enum": [
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15"
              ],
              "default": "5"
            }
          }
        },
        {
          "title": "Wan 2.7 first frame",
          "type": "object",
          "properties": {
            "model": {
              "type": "string",
              "enum": [
                "wan2.7-i2v"
              ]
            },
            "task_type": {
              "type": "string",
              "enum": [
                "first_frame"
              ]
            },
            "duration": {
              "type": "string",
              "enum": [
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15"
              ],
              "default": "5"
            }
          }
        },
        {
          "title": "Wan 2.7 first and last frame",
          "type": "object",
          "properties": {
            "model": {
              "type": "string",
              "enum": [
                "wan2.7-i2v"
              ]
            },
            "task_type": {
              "type": "string",
              "enum": [
                "first_last_frame"
              ]
            },
            "duration": {
              "type": "string",
              "enum": [
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15"
              ],
              "default": "5"
            }
          }
        },
        {
          "title": "Wan 2.7 reference image",
          "type": "object",
          "properties": {
            "model": {
              "type": "string",
              "enum": [
                "wan2.7-i2v"
              ]
            },
            "task_type": {
              "type": "string",
              "enum": [
                "reference_image"
              ]
            },
            "duration": {
              "type": "string",
              "enum": [
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15"
              ],
              "default": "5"
            }
          }
        },
        {
          "title": "Wan 2.7 video extension",
          "type": "object",
          "properties": {
            "model": {
              "type": "string",
              "enum": [
                "wan2.7-i2v"
              ]
            },
            "task_type": {
              "type": "string",
              "enum": [
                "video_extend"
              ]
            },
            "duration": {
              "type": "string",
              "enum": [
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15"
              ],
              "default": "5"
            }
          }
        },
        {
          "title": "Wan 2.7 video edit",
          "type": "object",
          "properties": {
            "model": {
              "type": "string",
              "enum": [
                "wan2.7-i2v"
              ]
            },
            "task_type": {
              "type": "string",
              "enum": [
                "video_edit"
              ]
            },
            "duration": {
              "type": "string",
              "enum": [
                "5",
                "6",
                "7",
                "8",
                "9",
                "10"
              ],
              "default": "5"
            }
          }
        }
      ]
    },
    {
      "$ref": "#/components/schemas/WebhookInput"
    }
  ]
}

Response Fields

code: integer
data: object
data._id: string
data.name: string
data.image_url: string
data.current_status: string
data.coins: number
trace_id: string
Trace ID of this HTTP request. Include it when contacting support about this request. It is generated per request and is not a task identifier; use the returned task `_id` to query results.

Request Example

curl -X POST "https://www.a2e.com.cn/api/v1/userWan25/start" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "My Wan 2.7 Reference Video",
  "model": "wan2.7-i2v",
  "task_type": "reference_image",
  "reference_image_urls": [
    "https://example.com/reference-1.jpg",
    "https://example.com/reference-2.jpg"
  ],
  "prompt": "Create a cinematic video matching the subject and visual style of the reference images",
  "negative_prompt": "blurry, distorted",
  "duration": "5",
  "resolution": "720p",
  "ratio": "16:9",
  "enable_prompt_expansion": false
}'

Related Endpoints

Responses

200

Wan video task started successfully

400

Bad Request - Invalid parameters

401

Unauthorized - Invalid or missing bearer token

Wan Video API Documentation