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.5 generates short videos from a text prompt or from one reference image plus a prompt. Use this page when you are ready to call the API after trying the model in the APIXO playground.
CapabilityValue
Model IDwan-2-5
Modestext-to-video, image-to-video
Prompt length1-800 characters
Reference imagesExactly 1 URL for image-to-video
Resolutions720p, 1080p
Duration5 or 10 seconds
Text-to-video aspect ratios16:9, 9:16, 1:1
Prompt expansionEnabled by default

Endpoint and authentication

Base URL:
https://api.apixo.ai/api/v1
MethodEndpointPurpose
POST/generateTask/wan-2-5Submit a generation task
GET/statusTask/wan-2-5?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 a text-to-video task and returns a taskId.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-5" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a cinematic shot of clouds drifting over a quiet mountain lake",
      "resolution": "720p",
      "duration": 5,
      "aspect_ratio": "16:9"
    }
  }'
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-5?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://r2.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965752317,
    "costTime": 141388
  }
}
Failed response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "CONTENT_VIOLATION",
    "failMsg": "Content does not meet safety guidelines",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
Parse resultJson after state becomes success:
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;

Request body

Text-to-video

{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a serene mountain landscape with moving clouds and gentle breeze",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9",
    "negative_prompt": "low quality, blurry",
    "enable_prompt_expansion": true
  }
}

Image-to-video

{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "prompt": "turn this photo into a smooth cinematic shot with a slow push-in camera move",
    "image_urls": [
      "https://example.com/reference.png"
    ],
    "resolution": "1080p",
    "duration": 5,
    "enable_prompt_expansion": true
  }
}

Parameters

request_type
string
default:"async"
required
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.5 input parameters.

Response format

Submit task response

POST /generateTask/wan-2-5 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.

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-5" \
  -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": "text-to-video",
      "prompt": "a polished product demo video with gentle camera movement",
      "resolution": "720p",
      "duration": 5,
      "aspect_ratio": "16:9"
    }
  }'
See Webhooks for delivery requirements and retry behavior.

Billing

Wan 2.5 is billed per generated video. The selected resolution and duration determine the unit price.
ResolutionDurationAPIXO price
720p5 seconds$0.40 / video
720p10 seconds$0.80 / video
1080p5 seconds$0.65 / video
1080p10 seconds$1.30 / video
For current route and market comparison pricing, see Pricing.

Latency and polling

Video generation is long-running. Actual latency may vary by prompt complexity, mode, selected resolution, and current queue load.
Request shapeTypical generation timeRecommended first pollPoll interval
720p60s-180s60s after task creation10s
1080p90s-250s90s after task creation10s
For high-concurrency production workloads, use callback mode to avoid frequent polling.
Practical notes:
  • Use aspect_ratio only with text-to-video; image-to-video uses the reference image as the visual anchor.
  • Use negative_prompt to reduce blur, jitter, distortion, and unwanted visual artifacts.
  • Enable prompt expansion for short prompts; disable it when you need tighter control over an already detailed prompt.
  • Result URLs are temporary. Download important outputs promptly.
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, or image URL shapeFix the request before retrying
401Missing or invalid API keyCheck the Authorization header
402Insufficient balance or quotaAdd balance or switch account/key
403Key or account cannot access the modelCheck account permissions
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 codes

Fail codeMeaningWhat to do
CONTENT_VIOLATIONPrompt or reference image failed safety checksChange the prompt or input image
INVALID_IMAGE_URLA reference image URL could not be fetched or decodedUse a public, direct image URL
INVALID_PARAMETERA model parameter is unsupported or malformedCheck mode, resolution, duration, aspect_ratio, and image_urls
INSUFFICIENT_BALANCEThe account does not have enough balance for the taskAdd balance before retrying
UPSTREAM_ERRORUpstream service failureRetry with backoff
TIMEOUTGeneration did not finish in timeRetry, reduce input complexity, or use callback mode

Parameter troubleshooting

  • prompt is required for both text-to-video and image-to-video.
  • image_urls is required only for image-to-video and must contain exactly one URL.
  • resolution and duration are required; they are not filled in automatically by the API.
  • aspect_ratio supports 16:9, 9:16, and 1:1, and only applies to text-to-video.
  • negative_prompt must be 500 characters or fewer.
See Error Codes for the full error reference.