Wan 2.5 API Reference
Overview
| Property | Value |
|---|---|
| Model ID | wan-2-5 |
| Type | Text-to-Video, Image-to-Video |
| Pricing | 720p: $0.08/second ยท 1080p: $0.13/second |
| Average Time | 100-250 seconds |
Authentication
All API requests require authentication using a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Endpoints
1. Submit Generation Task
POST https://api.apixo.ai/api/v1/generateTask/wan-2-5
2. Query Task Status
GET https://api.apixo.ai/api/v1/statusTask/wan-2-5?taskId={taskId}
Request Parameters
Request Body Structure
{
"request_type": "async",
"callback_url": "https://your-server.com/callback",
"input": {
"mode": "text-to-video",
"prompt": "Your video description",
"resolution": "720p",
"duration": "5",
...
}
}
Top-Level Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request_type | string | Yes | Request mode: async (poll results) or callback (webhook notification) |
callback_url | string | No | Webhook URL for callback mode. Must be publicly accessible |
input | object | Yes | Generation parameters (see below) |
Input Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
mode | string | Yes | text-to-video | Generation mode: text-to-video or image-to-video |
prompt | string | Yes | - | Video description (max 800 characters) |
image_url | string | No | - | Input image URL for image-to-video (max 10MB) |
resolution | string | Yes | 720p | Video resolution: 720p ($0.08/s) or 1080p ($0.13/s) |
duration | string | Yes | 5 | Video duration in seconds: 5 or 10 |
aspect_ratio | string | No | 1:1 | Aspect ratio (text-to-video only): 16:9, 9:16, 1:1 |
negative_prompt | string | No | - | Content to avoid (max 500 characters) |
enable_prompt_expansion | boolean | No | true | Enable LLM prompt rewriting |
seed | integer | No | - | Random seed for reproducibility |
Response Format
Task Submission Response
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678"
}
}
Status Query Response
Processing:
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678",
"state": "processing",
"createTime": 1698765400000
}
}
Success:
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678",
"state": "success",
"resultJson": "{\"resultUrls\":[\"https://example.com/video.mp4\"]}",
"costTime": 150000,
"createTime": 1698765400000,
"completeTime": 1698765550000
}
}
Failed:
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678",
"state": "failed",
"failCode": "CONTENT_VIOLATION",
"failMsg": "Content does not meet safety guidelines",
"createTime": 1698765400000,
"completeTime": 1698765550000
}
}
Response Fields:
| Field | Type | Description |
|---|---|---|
code | integer | HTTP status code (200 = success) |
data.taskId | string | Unique task identifier |
data.state | string | Task state: pending, processing, success, failed |
data.resultJson | string | JSON string with resultUrls array (on success) |
data.costTime | integer | Generation time in milliseconds |
data.failCode | string | Error code (on failure) |
data.failMsg | string | Error message (on failure) |
Callback Response
When the task is completed, the system will send a POST request to your callBackUrl in the following format:
Success Callback
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678",
"state": "success",
"resultJson": "{\"resultUrls\":[\"https://example.com/result.mp4\"]}",
"completeTime": 1698765550000,
"createTime": 1698765400000,
"costTime": 150000
}
}
Failure Callback
{
"code": 400,
"message": "failed",
"data": {
"taskId": "task_12345678",
"state": "failed",
"failCode": "CONTENT_VIOLATION",
"failMsg": "Content does not meet safety guidelines",
"completeTime": 1698765550000,
"createTime": 1698765400000,
"costTime": 150000
}
}
Quick Start
1. Text-to-Video Generation
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 beautiful sunset over the mountains",
"resolution": "720p",
"duration": "5",
"aspect_ratio": "16:9"
}
}'
Response:
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678"
}
}
2. Check Task Status
curl -X GET "https://api.apixo.ai/api/v1/statusTask/wan-2-5?taskId=task_12345678" \
-H "Authorization: Bearer YOUR_API_KEY"
Response (Success):
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678",
"state": "success",
"resultJson": "{\"resultUrls\":[\"https://example.com/video.mp4\"]}"
}
}
3. Image-to-Video with High Resolution
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": "image-to-video",
"prompt": "Add dynamic movement to this scene with flowing water",
"image_url": "https://example.com/input.jpg",
"resolution": "1080p",
"duration": "10"
}
}'
Best Practices
Request Mode Selection
| Mode | Use When |
|---|---|
| Callback | Production environments with public server endpoints |
| Async | Client-side apps or when webhook setup is not feasible |
Performance Tips
- Async Mode: Wait 100 seconds before first poll, then poll every 10 seconds
- Timeout: Set maximum wait time to 10 minutes
- Rate Limiting: Avoid excessive concurrent requests
- Error Handling: Always check
statefield and handle failures gracefully
Resource Management
- Video URLs may be temporary - download and store important results
- Clean up failed tasks appropriately
- Log
taskIdfor debugging and support - Pricing is per-second: 5s at 720p = $0.40, 10s at 1080p = $1.30
aspect_ratioparameter only applies to text-to-video mode