Wan 2.1 API Documentation
Wan Image to Video First Frame - Request Code
POST https://gateway.pixazo.ai/wan-i2v/v1/generateImageToVideoRequest Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "model": "wan2.2-i2v-plus", "input": { "prompt": "Banana dancing in a traditional dress", "negative_prompt": "flowers, blur", "img_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana.jpeg" }, "parameters": { "resolution": "1080P", "duration": 5, "prompt_extend": true, "watermark": false, "seed": 12345 } } import requests import json url = "https://gateway.pixazo.ai/wan-i2v/v1/generateImageToVideoRequest" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "model": "wan2.2-i2v-plus", "input": { "prompt": "Banana dancing in a traditional dress", "negative_prompt": "flowers, blur", "img_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana.jpeg" }, "parameters": { "resolution": "1080P", "duration": 5, "prompt_extend": true, "watermark": false, "seed": 12345 } } response = requests.post(url, headers=headers, json=data) print(response.json()) const url = 'https://gateway.pixazo.ai/wan-i2v/v1/generateImageToVideoRequest'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { model: 'wan2.2-i2v-plus', input: { prompt: 'Banana dancing in a traditional dress', negative_prompt: 'flowers, blur', img_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana.jpeg' }, parameters: { resolution: '1080P', duration: 5, prompt_extend: true, watermark: false, seed: 12345 } }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); curl -v -X POST "https://gateway.pixazo.ai/wan-i2v/v1/generateImageToVideoRequest" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "model": "wan2.2-i2v-plus", "input": { "prompt": "Banana dancing in a traditional dress", "negative_prompt": "flowers, blur", "img_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana.jpeg" }, "parameters": { "resolution": "1080P", "duration": 5, "prompt_extend": true, "watermark": false, "seed": 12345 } }' import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class ApiClient { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/wan-i2v/v1/generateImageToVideoRequest"; String json = """ { "model": "wan2.2-i2v-plus", "input": { "prompt": "Banana dancing in a traditional dress", "negative_prompt": "flowers, blur", "img_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana.jpeg" }, "parameters": { "resolution": "1080P", "duration": 5, "prompt_extend": true, "watermark": false, "seed": 12345 } } """; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } <?php $url = 'https://gateway.pixazo.ai/wan-i2v/v1/generateImageToVideoRequest'; $data = json_encode([ 'model' => 'wan2.2-i2v-plus', 'input' => [ 'prompt' => 'Banana dancing in a traditional dress', 'negative_prompt' => 'flowers, blur', 'img_url' => 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana.jpeg' ], 'parameters' => [ 'resolution' => '1080P', 'duration' => 5, 'prompt_extend' => true, 'watermark' => false, 'seed' => 12345 ] ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]); $response = curl_exec($ch); curl_close($ch); echo $response; ?> Output
Successful API response:
{ "request_id": "ae89146e-7d12-XXXX-XXXX-XXXXXXXXXXXXXX", "output": { "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXXX", "task_status": "IN_PROGRESS" } } Request Body - Wan Image to Video First Frame
Parameters for /generateImageToVideoRequest:
| Parameter | Required | Type | Description |
|---|---|---|---|
| model | Yes | string | Model to use. Available values: "wan2.2-i2v-flash", "wan2.2-i2v-plus" (recommended), "wan2.1-i2v-plus", "wan2.1-i2v-turbo". |
| input.img_url | Yes | string | URL of the first frame image. Must be publicly accessible HTTP/HTTPS URL. Supports JPEG, JPG, PNG, BMP, WEBP. Max size: 10MB. Image resolution: 360-2000 pixels. |
| input.prompt | No | string | Default: null. Text description to guide video generation. Supports English and Chinese, up to 800 characters. |
| input.negative_prompt | No | string | Default: null. Elements to exclude from the video. Up to 500 characters. |
| parameters.resolution | No | string | Default varies by model:- wan2.2-i2v-plus: "480P" or "1080P" (default: "1080P")- wan2.2-i2v-flash: "480P" or "720P" (default: "720P")- wan2.1-i2v-plus: only "720P"- wan2.1-i2v-turbo: "480P" or "720P" (default: "720P") |
| parameters.duration | No | integer | Default: 5. Video duration in seconds. For wan2.1-i2v-turbo: 3, 4, or 5. Other models fixed at 5. |
| parameters.prompt_extend | No | boolean | Default: true. When enabled, uses LLM to enhance the prompt. Improves quality but adds processing time. |
| parameters.watermark | No | boolean | Default: false. When true, adds "Generated by AI" watermark at bottom-right. |
| parameters.seed | No | integer | Default: null. Random seed for reproducible results. Range: 0-2147483647. |
Example Request - Wan Image to Video First Frame
JSON
{ "model": "wan2.2-i2v-plus", "input": { "prompt": "Banana dancing in a traditional dress", "negative_prompt": "flowers, blur", "img_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana.jpeg" }, "parameters": { "resolution": "1080P", "duration": 5, "prompt_extend": true, "watermark": false, "seed": 12345 } } Response - Wan Image to Video First Frame
JSON
{ "request_id": "ae89146e-7d12-XXXX-XXXX-XXXXXXXXXXXXXX", "output": { "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXXX", "task_status": "IN_PROGRESS" } } Request Headers
| Header | Description |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| Ocp-Apim-Subscription-Key | Your API subscription key for authentication |
Response Handling
The Wan Image to Video returns specific HTTP status codes and response bodies to indicate the success or failure of a request. Developers should implement error handling in their applications to manage these responses effectively.
Common Status Codes and Responses
| Status Code | Description | Response Body |
|---|---|---|
| 200 | Success - The request was successfully processed. | { "success": true, ... } |
| 400 | Bad Request - The request contains invalid parameters or missing fields. | { "error": "Invalid request parameters" } |
| 401 | Unauthorized - The provided subscription key is missing or invalid. | { "error": "Invalid or missing authentication" } |
| 403 | Forbidden - The subscription does not have access to this API or action. | { "error": "Access denied for this operation" } |
| 404 | Not Found - The requested resource or endpoint could not be found. | { "error": "Endpoint not found" } |
| 429 | Too Many Requests - The request rate limit has been exceeded. | { "error": "Rate limit exceeded, please retry later" } |
| 500 | Internal Server Error - An unexpected error occurred on the server. | { "error": "An unexpected error occurred, please try again later" } |
Example Error Response
{ "error": "Invalid parameters" } Retrieving Results
After submitting your request, use this endpoint to check status and retrieve results.
Endpoint
POST https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult
Request Body
{ "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXXX" } Code Examples
POST https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXXX" } import requests import json url = "https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXXX" } response = requests.post(url, headers=headers, json=data) print(response.json()) const url = 'https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { task_id: '19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXXX' }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); curl -v -X POST "https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXXX" }' import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class PollingClient { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult"; String json = """ { "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXXX" } """; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } <?php $url = 'https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult'; $data = json_encode([ 'task_id' => '19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXXX' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]); $response = curl_exec($ch); curl_close($ch); echo $response; ?> Example Success Response
{ "request_id": "9b07c1f1-8032-XXXX-XXXX-XXXXXXXXXXXXX", "output": { "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXX", "task_status": "SUCCEEDED", "submit_time": "2025-09-06 18:03:09.999", "scheduled_time": "2025-09-06 18:03:10.017", "end_time": "2025-09-06 18:04:56.637", "video_url": "https://example.com/video/12345.mp4", "orig_prompt": "A kitten running in the moonlight", "actual_prompt": "A cute kitten running gracefully under the moonlight" }, "usage": { "video_duration": 5, "video_ratio": "1920*1080", "video_count": 1 } } Wan 2.1 API Pricing
| Model | Resolution | Seconds | Price (USD) |
|---|---|---|---|
| wan2.2-t2i-flash | 720P | 5 | $0.2 |
| wan2.2-t2i-plus | 1080p | 5 | $0.75 |
| wan2.1-t2i-turbo | 1280*720 | 5 | $0.2 |
| wan2.1-t2i-plus | 1280*720 | 5 | $0.75 |