Alibaba
Wan 2.2 Animate
wan-2.2-animate/replace
Alibaba's Wan video-driven character animation model: simply input a reference video and a character image to transfer motion and expressions. It offers two modes — move animation and replace character replacement — and is suited for post-production character replacement and virtual avatar content creation.
Try wan-2.2-animate/replace
Input
Showcases
View all showcasesOutput
videoPricing
wan-2.2-animate/replace per second
| Specifications | Unit Price |
|---|---|
| 580P | $0.0679 |
| 720P | $0.0893 |
Introduction coming soon
A detailed guide for this model is being prepared. Pricing, parameters and the API docs below are already available.
What's new
View changelog →- New model wan-2.2-animate/replace is now live: video generation (video-to-video)
- New model wan-2.2-animate/move model now available: video generation (video-to-video)
Frequently asked questions
View all FAQs →-
Can this model generate a video from only a text prompt?
No. The motion and facial expressions are provided by the reference video, so you must supply both a reference video and a character image; neither can be omitted. It is video-driven, not text-driven.
-
How do I choose between the animation and replacement modes?
To keep the original video's scene and composition and only replace the person in it with a specified character, use replacement; to make a static background or character image move according to a reference performance, use move (animation). move only has two inputs, video and image, while replacement also offers an optional resolution setting.
-
How should I set the resolution for replacement mode?
Replacement mode offers three tiers: 480p, 580p, and 720p, with 480p as the default. If you want a clearer final video and also need a longer reference video, first confirm the duration limit; 720p consumes more resources, so if you just want to preview the effect, the default tier is sufficient.
-
What is the maximum length of a reference video?
Reference videos are capped at 30 seconds; when unspecified, estimate at 5 seconds. Input is billed by video duration, so overly long clips must be trimmed externally before submission.
Create a generation task
https://api.hiapi.ai/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: wan-2.2-animate/replace
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for wan-2.2-animate/replace and route default — see the parameter table below.
image_urlstringRequiredpattern ^https://Character image as a public HTTPS URL.
video_urlstringRequiredpattern ^https://Reference video as a public HTTPS URL.
resolutionstringOptionalDefault: "480p"480p580p720pcallbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan-2.2-animate/replace",
"input": {
"image_url": "…",
"video_url": "…",
"resolution": "480p"
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "wan-2.2-animate/replace",
input: {
"image_url": "…",
"video_url": "…",
"resolution": "480p"
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "wan-2.2-animate/replace",
"input": {
"image_url": "…",
"video_url": "…",
"resolution": "480p"
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.ai/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →-
Tutorial
Wan-2.2 Animate/Replace in Practice: 5 High-Value Video Replacement Use Cases and Integration Essentials
From scenario judgment to cost accounting: a developer guide to implementing video-to-video capabilities
-
Guide
Wan 2.2 Animate/Replace Getting Started Guide: Video-to-Video Capability Boundaries, Pricing, and Integration Practices
From capability assessment to cost estimation: a video-to-video integration checklist for developers
-
Comparison
wan-2.2-animate/replace Side-by-Side Comparison: How to Choose a Video-to-Video Model and Key Migration Points
A developer's selection decision guide, from capability boundaries and per-second billing to migration costs
Related Models
View all models →Same Type
-
Grok Imagine 1.5 Lite xAI $0.029 /second -
PixVerse V6 Max PixVerse $0.030 /second -
FLUX 3 Max Black Forest Labs $0.243 /second -
Kling 3.0 Kuaishou $0.100 /second -
MiniMax H3 Max Turbo MiniMax $0.027 /second -
HeyGen Avatar IV HeyGen $0.150 /second -
Creatify Boreal Creatify $0.015 /second -
Gemini Omni 1.1 Google $0.450 /video -
Vidu Q4 Preview Vidu $0.051 /second -
Vidu Q3 Vidu $0.149 /second -
Kling 4.0 Kuaishou $0.204 /second -
Seedance 2.5 ByteDance $0.121 /second
Same Provider
-
Wan 3.0 Video Alibaba $0.040 /second -
Z-Image Alibaba $0.008 /image -
Qwen Image 2.1 Alibaba $0.020 /image -
Wan 2.7 Video Alibaba $0.100 /second -
Qwen Image 2.0 Alibaba $0.042 /image -
Qwen Image 3.0 Alibaba $0.036 /image -
HappyHorse 1.1 Alibaba $0.160 /second -
HappyHorse 1.0 Alibaba $0.168 /second -
Qwen Audio 3.0 TTS Alibaba $0.030 /1,000 characters -
Wan 2.7 Image Alibaba $0.035 /image -
Wan 2.6 Flash Alibaba $0.029 /second