Wan2.6 API Documentation
Wan 2.6 Image to Video generate request - Request Code
POST https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request HTTP/1.1 Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "prompt": "A serene mountain lake at sunrise, with gently flowing water and birds flying overhead", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png", "aspect_ratio": "16:9", "resolution": "1080p", "duration": "10", "enable_prompt_expansion": true, "multi_shots": true, "enable_safety_checker": true } import requests url = "https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "prompt": "A serene mountain lake at sunrise, with gently flowing water and birds flying overhead", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png", "aspect_ratio": "16:9", "resolution": "1080p", "duration": "10", "enable_prompt_expansion": True, "multi_shots": True, "enable_safety_checker": True } response = requests.post(url, json=data, headers=headers) print(response.json()) const url = 'https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request'; const data = { prompt: 'A serene mountain lake at sunrise, with gently flowing water and birds flying overhead', image_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png', aspect_ratio: '16:9', resolution: '1080p', duration: '10', enable_prompt_expansion: true, multi_shots: true, enable_safety_checker: true }; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); curl -X POST "https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "prompt": "A serene mountain lake at sunrise, with gently flowing water and birds flying overhead", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png", "aspect_ratio": "16:9", "resolution": "1080p", "duration": "10", "enable_prompt_expansion": true, "multi_shots": true, "enable_safety_checker": true }' 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 ApiExample { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request"; String json = """ { "prompt": "A serene mountain lake at sunrise, with gently flowing water and birds flying overhead", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png", "aspect_ratio": "16:9", "resolution": "1080p", "duration": "10", "enable_prompt_expansion": true, "multi_shots": true, "enable_safety_checker": true } """; HttpClient client = HttpClient.newHttpClient(); 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") .timeout(Duration.ofSeconds(10)) .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-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request'; $data = [ 'prompt' => 'A serene mountain lake at sunrise, with gently flowing water and birds flying overhead', 'image_url' => 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png', 'aspect_ratio' => '16:9', 'resolution' => '1080p', 'duration' => '10', 'enable_prompt_expansion' => true, 'multi_shots' => true, 'enable_safety_checker' => true ]; $payload = json_encode($data); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?> Output
Successful API response:
{ "status": "IN_QUEUE", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "message": "Video generation request accepted and queued" } Request Body - Wan 2.6 Image to Video generate request
Parameters for https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request:
| Parameter | Required | Type | Description |
|---|---|---|---|
| prompt | Yes | string | Text prompt describing the desired motion, mood, or style for the generated video. Enhances visual storytelling. |
| image_url | Yes | string | Publicly accessible URL of the source image to convert into video. Must be reachable by the API server. |
| aspect_ratio | No | string | Aspect ratio of the output video. Supported values: "16:9", "9:16", "1:1", "4:3", "3:4". |
| resolution | No | string | Resolution of the output video. Supported values: "720p", "1080p". |
| duration | No | string | Duration of the generated video in seconds. Supported values: "5", "10", "15". |
| enable_prompt_expansion | No | boolean | When true, the API will enhance and expand the provided prompt for richer, more descriptive video generation. |
| multi_shots | No | boolean | When true, enables multiple camera shots and transitions within the video for dynamic, cinematic output. |
| enable_safety_checker | No | boolean | When true, activates content safety filtering to block inappropriate or harmful outputs. |
Example Request - Wan 2.6 Image to Video generate request
JSON
{ "prompt": "A serene mountain lake at sunrise, with gently flowing water and birds flying overhead", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png", "aspect_ratio": "16:9", "resolution": "1080p", "duration": "10", "enable_prompt_expansion": true, "multi_shots": true, "enable_safety_checker": true } Response - Wan 2.6 Image to Video generate request
JSON
{ "status": "IN_QUEUE", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "message": "Video generation request accepted and queued" } Request Headers
| Header | Description |
|---|---|
| Content-Type | Must be set to application/json |
| Cache-Control | Must be set to no-cache |
| Ocp-Apim-Subscription-Key | Your API subscription key for authentication |
Response Handling
The Wan 2.6 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-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request-result
Request Body
{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } Example Polling Request
curl -X POST "https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request-result" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" }' HTTP Example
POST https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request-result HTTP/1.1 Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } Python Example
import requests url = "https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request-result" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } response = requests.post(url, json=data, headers=headers) print(response.json()) JavaScript Example
const url = 'https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request-result'; const data = { request_id: 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8' }; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); Java Example
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 PollingExample { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request-result"; String json = """ { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } """; HttpClient client = HttpClient.newHttpClient(); 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") .timeout(Duration.ofSeconds(10)) .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } PHP Example
<?php $url = 'https://gateway.pixazo.ai/wan-2-6-image-to-video-477/v1/wan-2-6-image-to-video-request-result'; $data = [ 'request_id' => 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8' ]; $payload = json_encode($data); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?> Response States
| Status | Description |
|---|---|
| IN_QUEUE | Request is queued and awaiting processing. |
| IN_PROGRESS | Video generation is actively in progress. |
| COMPLETED | Video generation completed successfully. Result URL is available. |
| FAILED | Generation failed. Check the error_message field for details. |
Example Success Response
{ "status": "COMPLETED", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "video": { "url": "https://storage.pixazo.ai/output/a1b2c3d4.mp4", "width": 1920, "height": 1080, "duration": 10, "format": "mp4", "resolution": "1080p", "content_type": "video/mp4" }, "metadata": { "aspect_ratio": "16:9", "prompt_expanded": "A serene mountain lake at sunrise, with gently flowing water, birds flying overhead, and soft golden light reflecting off the surface", "multi_shots_enabled": true, "safety_checked": true } } Example In-Progress Response
{ "status": "IN_PROGRESS", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "progress_percentage": 45, "estimated_remaining_time": 23 } Example Failed Response
{ "status": "FAILED", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "error_message": "Image URL is inaccessible or malformed", "error_code": "INVALID_IMAGE_URL" } 