Skip to main content

Documentation Index

Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Wan 2.2 Animate is an Alibaba video model for character animation and character replacement. Use this page when you are ready to call the API after trying the model in the APIXO playground.
CapabilityValue
Model IDwan-2-2-animate
Modestandard
Behaviorsanimate, replace
Source imageExactly 1 URL in image_urls
Motion videoExactly 1 public HTTP/HTTPS MP4, MOV, or M4V URL in video_urls
Resolution480p, 720p
Billing durationDetected from video_urls[0], minimum 5 seconds and maximum 120 billable seconds
Seed-1 or 0 to 2147483647

Endpoint and authentication

Base URL:
https://api.apixo.ai/api/v1
MethodEndpointPurpose
POST/generateTask/wan-2-2-animateSubmit a generation task
GET/statusTask/wan-2-2-animate?taskId={taskId}Poll task status and retrieve results
All requests require your APIXO API key:
Authorization: Bearer YOUR_API_KEY
Submit requests also require:
Content-Type: application/json

Copy-paste async quickstart

This minimal request submits an animate task and returns a taskId.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-2-animate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "standard",
      "type": "animate",
      "image_urls": [
        "https://example.com/character.png"
      ],
      "video_urls": [
        "https://example.com/motion.mp4"
      ],
      "resolution": "480p",
      "seed": -1
    }
  }'
Successful response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Save the taskId; you need it to poll for the final result.

Poll for result

curl -X GET "https://api.apixo.ai/api/v1/statusTask/wan-2-2-animate?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Processing response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
Success response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965772317,
    "costTime": 161388
  }
}
Failed response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "PromptInvalid",
    "failMsg": "Prompt is invalid or rejected",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
Parse resultJson after state becomes success:
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;

Request body

Animate

Use type: "animate" to animate the character in the source image with motion from the reference video.
{
  "request_type": "async",
  "input": {
    "mode": "standard",
    "type": "animate",
    "image_urls": [
      "https://example.com/character.png"
    ],
    "video_urls": [
      "https://example.com/motion.mp4"
    ],
    "prompt": "keep the face stable and follow the motion naturally",
    "resolution": "480p",
    "seed": -1
  }
}

Replace

Use type: "replace" to replace the character in the motion video with the character from the source image.
{
  "request_type": "async",
  "input": {
    "mode": "standard",
    "type": "replace",
    "image_urls": [
      "https://example.com/character.png"
    ],
    "video_urls": [
      "https://example.com/motion.mp4"
    ],
    "prompt": "replace the person in the motion video with the provided character",
    "resolution": "720p",
    "seed": 42
  }
}

Parameters

request_type
string
default:"async"
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
callback_url
string
Required when request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.
input
object
required
Wan 2.2 Animate input parameters.

Response format

Submit task response

POST /generateTask/wan-2-2-animate returns a task ID when the task is accepted:
code
integer
API status code. 200 means the task was accepted.
message
string
Human-readable status message.
data.taskId
string
Unique task identifier used with the status endpoint.

Status response fields

taskId
string
Unique task identifier.
state
string
Current task state: pending, processing, success, or failed.
resultJson
string
JSON string containing the generated video URLs. Present when state is success.
failCode
string
Machine-readable failure code. Present when state is failed.
failMsg
string
Human-readable failure message. Present when state is failed.
createTime
integer
Task creation timestamp in Unix milliseconds.
completeTime
integer
Task completion timestamp in Unix milliseconds. Present after completion.
costTime
integer
Processing duration in milliseconds. Present after successful completion when timing data is available.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-2-animate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "standard",
      "type": "replace",
      "image_urls": [
        "https://example.com/character.png"
      ],
      "video_urls": [
        "https://example.com/motion.mp4"
      ],
      "prompt": "replace the person in the motion video with the provided character",
      "resolution": "720p",
      "seed": 42
    }
  }'
See Webhooks for delivery requirements and retry behavior.

Billing

Wan 2.2 Animate is billed per generated video second. The selected resolution determines the unit price, and billable duration is detected from video_urls[0].
ResolutionBilling inputAPIXO price
480pDetected reference video duration, minimum 5 seconds and maximum 120 billable seconds$0.04 / second
720pDetected reference video duration, minimum 5 seconds and maximum 120 billable seconds$0.08 / second
If the reference video is shorter than 5 seconds, billing uses 5 seconds. If it is longer than 120 seconds, billing is capped at 120 seconds. For current route and market comparison pricing, see Pricing.

Latency and polling

Actual latency may vary by reference video duration, resolution, queue load, and current route health.
Request shapeTypical generation timeRecommended first pollPoll interval
Short 480p animationVaries with reference video duration and queue load60s after task creation5s-10s
Short 720p animationVaries with reference video duration and queue load60s after task creation5s-10s
Longer reference videoVaries with reference video duration and queue load60s-120s after task creation10s
Video generation can take several minutes. For production workloads, use callback mode to avoid frequent polling.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

CodeMeaningWhat to do
400Invalid request body, mode, parameter, image URL, or video URLFix the request before retrying
401Missing or invalid API keyCheck the Authorization header
402Insufficient balance or quotaAdd balance or switch account/key
403Key or route cannot access the model, or content was rejectedCheck permissions and revise input content
429Rate limit or concurrency limit reachedRetry with exponential backoff
500Server errorRetry with backoff
502Upstream service errorRetry with backoff
504Upstream timeoutRetry or use callback mode for long-running jobs

Task failure causes

CauseWhat to check
Content policy rejectionRevise the prompt, source image, or motion video
Invalid mode or typeUse mode: "standard" and type: "animate" or "replace"
Invalid media shapeProvide exactly 1 image_urls item and exactly 1 video_urls item
Video URL cannot be probedUse a direct public HTTP/HTTPS MP4, MOV, or M4V URL that supports range reads or full download
Invalid resolutionUse 480p or 720p
Invalid seedUse -1 or an integer from 0 to 2147483647
Upstream rate limit or timeoutRetry with backoff or switch to callback mode

Common fixes

SymptomFix
Request fails with invalid modeSet input.mode to standard
Request fails before task creationCheck that video_urls[0] is publicly reachable and has a supported MP4, MOV, or M4V media type
Billing is higher than expected for a very short videoVideos shorter than 5 seconds are billed as 5 seconds
Billing stops increasing for a long reference videoBillable duration is capped at 120 seconds
No update for several minutesContinue polling with backoff, or use callback mode for production
See Error Codes for the full error reference.