Video / Wan

Wan 2.2 Video Generation

Overview

Wan 2.2 endpointVideo GenerationCapability:Text-to-Video, Image-to-Video (Plus / Flash ), First/Last Frame to Video, image, video./ image / last frame output 5 secondsvideo; image and video DurationReference video (2~ 30 seconds).

localized example text:
- 🎬 / image:video, or first frame image as video
-🖼️ last frame:first frame and last frame, video
-🕺 image:Reference video and image
-🔄 videolocalized example text:Reference video in the image, videoScenario, and
-⚡ localized example text:Image-to-VideoOptional Plus () or Flash (, 720P)
-🇨🇳 localized example text:asLimit:
- ⚠️ / image / last frame Duration 5 seconds, can
-⚠️ image / video supported Prompt,mode -⚠️ supported audio input, Generate Sound ( use Wan 2.5 Preview)
- ⚠️ Image-to-Video, last frame, image, video input asset, Aspect ratioBase URL: https://mm-internal-cn.leonecloud.com ()

---## Authentication

All endpoints require a token in the request header for authentication:

Authorization: Bearer {YOUR_AUTH_TOKEN}

Supported Scenarios

Scenario 1: Text-to-Video

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/wan-2.2" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "prompt": "in,",
 "resolution": "1080P",
 "ratio": "16:9"
 }'

Scenario2:Text-to-Video (dimensions )size output width and height,「Resolutionand dimensions」.

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/wan-2.2" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "prompt": "when, in height",
 "size": "1080*1920"
 }'

Scenario3:Image-to-Video (Plus, )

first frame image, Modelimage as video, imageAspect ratio.

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/wan-2.2" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "prompt": ",",
 "firstFrameImage": "https://example.com/girl.png",
 "resolution": "1080P"
 }'

Scenario4:Image-to-Video (Flash, )modelName localized example textwan2.2-i2v-flash Flash,, 720P.

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/wan-2.2" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "modelName": "wan2.2-i2v-flash",
 "prompt": ",",
 "firstFrameImage": "https://example.com/rapper.png",
 "resolution": "720P"
 }'

Scenario5:First/Last Frame to Video

first frame and last frame, image video.last frame can.

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/wan-2.2" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "genType": "kf2v",
 "prompt": ", after",
 "firstFrameImage": "https://example.com/first.png",
 "lastFrameImage": "https://example.com/last.png",
 "resolution": "720P"
 }'

Scenario6:image

images image and reference video, video and imagecharacter.

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/wan-2.2" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "genType": "move",
 "firstFrameImage": "https://example.com/character.jpeg",
 "videoUrl": "https://example.com/performance.mp4",
 "mode": "std"
 }'

Scenario7:videoimages image and video, video in the character as image in the character, video Scenario, and.

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/wan-2.2" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "genType": "mix",
 "firstFrameImage": "https://example.com/character.jpeg",
 "videoUrl": "https://example.com/source.mp4",
 "mode": "pro"
 }'
image and video input asset, mustgenType (move / mix), If omittedwill return ParameterError.

Query Task Status

curl -X GET "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/{taskId}" \
 -H "Authorization: Bearer your_auth_token_here"

Endpoint details

1. create Wan 2.2 task

POST /api/v2/open/aigc/wan-2.2

Content-Type: application/json

Request Parameters

ParameterTypeRequiredDescription
genTypestringConditionally requiredGeneration type:t2v / i2v / kf2v / move / mix.If omittedwhen asset;localized example textvideoUrl when Required
modelNamestringNoonlyImage-to-Video:wan2.2-i2v-plus (default, )/wan2.2-i2v-flash ()
promptstringConditionally requiredPrompt, maximum 800 characters.Text-to-VideoRequired; Image-to-Video, last frame Optional; image / video supported
negativePromptstringNoPrompt, in in the, maximum 500 characters.image / video supported
firstFrameImagestringConditionally requiredfirst frame image URL; image / video in as image.Text-to-VideoRequired
lastFrameImagestringNolast frame image URL, onlyFirst/Last Frame to Video supported
imageUrlsstring[]Nofield, 1 images, as first frame use.andfirstFrameImage localized example text
videoUrlstringConditionally requiredReference video URL, image / videoRequired
resolutionstringNoResolution, Capability,「Resolutionand dimensions」.image / video supported
ratiostringNoonlyText-to-Video:16:9 (default)/ 9:16 / 1:1 / 4:3 / 3:4.480P supported4:3 / 3:4
sizestringNoonlyText-to-Video:localized example textwidthheight, localized example text19201080.andratio,「Resolutionand dimensions」
modestringNoonlyimage / video:std (default, height )/pro (, when and height )
durationintNovideoDuration (seconds)./ image / last frame5, return ParameterError; image / videoReference video, Parameter
promptExtendboolNoPrompt, defaulttrue.Prompt after, when.image / video supported
watermarkboolNoin lower-right corner AI watermark, defaultfalse
seedintNorandom seed, localized example text0 ~ 2147483647, If omittedlocalized example text.image / video supported
checkImageboolNoonlyimage / video: in first input image, defaulttrue
taskNicknamestringNoTask label, in
callbackUrlstringNoCallback notification URL after the task is complete
Description:
- resolution size can (720P / 720p); size in the* canx
- whensize andresolution when, must, return ParameterError> - Image-to-Video, last frameratio / size, automatically follows first frame image> - first frame / last frame image:JPEG / JPG / PNG ( supported )/ BMP / WEBP, width and height 240~ 8000,≤10MB
- image / video image:JPG / JPEG / PNG / BMP / WEBP, width and height 200~ 4096, Aspect ratio 1:3~ 3:1, ≤5MB
- image / video Reference video:MP4 / AVI / MOV, Duration 2~ 30 seconds, width and height 200~ 2048, Aspect ratio 1:3~ 3:1, ≤200MB

Response Example

{
 "code": 0,
 "msg": "success",
 "data": {
 "taskId": "task_20261119172239_gfdt2jgl",
 "status": "processing",
 "createdAt": "2026-11-19 17:22:39"
 }
}

2. Query Task Status

GET /api/v2/open/aigc/{taskId}

Response Parameters

ParameterTypeDescription
codeintStatus Code, 0 indicates success
data.taskIdstringTask ID
data.statusstringTask Status:processing / success / failed
data.resultstring[]video URL (Successreturned when applicable)
data.pointConsumestringtask
data.currencystringlocalized example text
data.errorMsgstringError Message (Failurereturned when applicable)
data.createdAtstringCreated Time
data.updatedAtstringUpdated Time
validity period 24 hours:data.result in the video as when, in after and store.

Response Example

Success

{
 "code": 0,
 "msg": "success",
 "data": {
 "taskId": "task_20261119172239_gfdt2jgl",
 "status": "success",
 "result": [
 "https://example-video-store.com/output/ae7388d8b777.mp4?Expires=1795152273&Signature=xxx"
 ],
 "pointConsume": "0.700000",
 "currency": "CNY",
 "createdAt": "2026-11-19 17:22:40",
 "updatedAt": "2026-11-19 17:23:21"
 }
}

Failure

{
 "code": 0,
 "msg": "success",
 "data": {
 "taskId": "task_20261119172239_gfdt2jgl",
 "status": "failed",
 "errorMsg": "Video GenerationFailure, localized example text",
 "createdAt": "2026-11-19 17:22:40",
 "updatedAt": "2026-11-19 17:23:00"
 }
}

3. Batch Query Task Status

POST /api/v2/open/aigc/batch

ParameterTypeRequiredDescription
taskIdsstring[]YesTask ID list, up to 100

Callback Notification

Create TaskwhencallbackUrl, taskcomplete (Success or Failure) after the system will POST Request.

Headers

Content-Type: application/json
X-Funcloud-Event: task.completed
X-Funcloud-Signature: {localized example text}

Body

{
 "event": "task.completed",
 "taskId": "task_20261119172239_gfdt2jgl",
 "status": "success",
 "result": ["https://example-video-store.com/output/ae7388d8b777.mp4"],
 "errorMsg": "",
 "timestamp": "2026-11-19T17:23:21+08:00",
 "signature": "a1b2c3d4e5f6..."
}

Parameter Value Ranges

Generation type (genType)

localized example textDescriptionassetDuration
t2vText-to-Videoprompt5 seconds
i2vImage-to-VideofirstFrameImage5 seconds
kf2vFirst/Last Frame to VideofirstFrameImage (+ lastFrameImage)5 seconds
moveimagefirstFrameImage + videoUrlReference video 2~ 30 seconds
mixvideolocalized example textfirstFrameImage + videoUrlReference video 2~ 30 seconds

genType If omittedwhen asset: with last frame→ kf2v, with first frame→ i2v, with→ t2v.localized example textvideoUrl when mustmove ormix, asset,.

Capability supported Resolution| Capability | modelName | Optionallocalized example text| default | |------|-----------|----------|------| | Text-to-Video | wan2.2-t2v-plus | 480P / 1080P | 1080P | | Image-to-Video Plus | wan2.2-i2v-plus | 480P / 1080P | 1080P | | Image-to-Video Flash | wan2.2-i2v-flash | 480P / 720P / 1080P | 720P | | First/Last Frame to Video | wan2.2-kf2v-flash | 480P / 720P / 1080P | 720P | | image / video| — | supportedresolution, localized example textmode localized example textstd / pro | std |

Text-to-Videoand Image-to-Video Plus with 720P,720P will return ParameterError and Optional.

Resolutionand dimensions (onlyText-to-Video)| (resolution)| 16:9 | 9:16 | 1:1 | 4:3 | 3:4 | |----|----|----|----|----|----| | 480P | 832480 | 480832 | 624624 | — | — | | 1080P | 19201080 | 10801920 | 14401440 | 16321248 | 12481632 |

  • Text-to-Video:localized example textresolution + ratio, or in thesize; If omitted when as1920*1080
  • Image-to-Video / last frame:resolution, output Aspect ratio and first frame imageconsistent,### (mode)
only image / video supported:localized example textDescription
std(default),, height, and
pro, height,, when and

Billing

  • Per-second billing:secondsCapability and,= seconds× videoDuration
  • / image / last frame 5 seconds,= seconds× 5
  • image / video DurationReference video, Create Task when 30 seconds,taskSuccessafter Duration,
  • Create Taskwhen, taskSuccess after, Failure
  • query endpoint returnpointConsume as,

---## Error Codes

codeDescription
0Success
10002Parametermissing or malformed (Duration 5, Text-to-Video 720P,videoUrl notgenType)
10005API Key invalid or missing
30003Task not found
40001Insufficient balance
40004, after
60001can use
90003Internal server error

Best Practices

1. Polling Strategy

  • First 30 seconds:query every 3 seconds
  • 30 seconds ~ 2 minutes:query every 5 seconds
  • After 2 minutes:query every 10 seconds

2. Processing Time Reference

  • 480P Text-to-Video:Usually 1 ~ 2 minutes
  • image / video:Reference video,mode aspro when, Usually 2~ 5 minutes
  • Resolutionheight, Reference video, when### 3. Prompt Tips
  • Prompt = subject+ localized example text+ Scenario + - last frame Scenario,, recommended (「localized example text」「first」)
  • localized example textnegativePrompt,「Resolution,,」
  • PromptwhenpromptExtend,### 4. image / video asset recommended
  • Reference videoResolution and frame rate height, output
  • imagerecommended subject,,or can
  • -std, image and no afterpro ---## FAQ

Q1: asduration localized example text?

A: / image / last frame Duration 5 seconds,5 will return ParameterError; image / video DurationReference video,duration.

Q2: Image-to-Video Plus and Flash?

A: Plus, with 480P / 1080P; Flash,, 720P.localized example textmodelName, If omitteddefault Plus.

Q3: image and video with?

A: image Reference video and imagecharacter, and Scenario; videoReference video Scenario,and, in the imagecharacter.

Q4: videotask will 30 seconds?

A: will.Create Taskwhen 30 seconds, taskSuccess after Duration,,pointConsume.

Q5: video with?

A: with.Wan 2.2 Generate Soundaudio input.use Wan 2.5 Preview.

Q6: supported image reference or Reference video?

A: supported.Image-to-Video1 images first frame, last frame up to images.image reference, Reference video use wan 3.0.


Technical Support

If you have any questions, please contact our technical support team.

Updated 2026-11-19