Wan 2.5 API Documentation

Generate Text To Video Request - Request Code

POST https://gateway.pixazo.ai/wan-video-2-5/v1/generateTextToVideo2-5Request Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "prompt": "A beautiful sunset over a calm ocean with gentle waves", "size": "832*480", "duration": 5, "audio": false, "prompt_extend": true, "watermark": false }
import requests url = "https://gateway.pixazo.ai/wan-video-2-5/v1/generateTextToVideo2-5Request" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "prompt": "A beautiful sunset over a calm ocean with gentle waves", "size": "832*480", "duration": 5, "audio": False, "prompt_extend": True, "watermark": False } response = requests.post(url, json=data, headers=headers) print(response.json())
const url = 'https://gateway.pixazo.ai/wan-video-2-5/v1/generateTextToVideo2-5Request'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { prompt: 'A beautiful sunset over a calm ocean with gentle waves', size: '832*480', duration: 5, audio: false, prompt_extend: true, watermark: false }; 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-2-5/v1/generateTextToVideo2-5Request" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "prompt": "A beautiful sunset over a calm ocean with gentle waves", "size": "832*480", "duration": 5, "audio": false, "prompt_extend": true, "watermark": false }'
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-video-2-5/v1/generateTextToVideo2-5Request"; String json = "{\n" + " \"prompt\": \"A beautiful sunset over a calm ocean with gentle waves\",\n" + " \"size\": \"832*480\",\n" + " \"duration\": 5,\n" + " \"audio\": false,\n" + " \"prompt_extend\": true,\n" + " \"watermark\": false\n" + "}"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .timeout(Duration.ofSeconds(10)) .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-2-5/v1/generateTextToVideo2-5Request'; $data = json_encode([ 'prompt' => 'A beautiful sunset over a calm ocean with gentle waves', 'size' => '832*480', 'duration' => 5, 'audio' => false, 'prompt_extend' => true, 'watermark' => false ]); $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": "db27ee62-1148-9de4-aab9-xxxxxx", "task_id": "31c13f64-60e3-4822-b255-xxxxxx", "task_status": "PENDING" }

Request Body - Generate Text To Video Request

Parameters for /generateTextToVideo2-5Request:

ParameterRequiredTypeDescription
promptYesstringText description of the video to generate. Supports English and Chinese.
negative_promptNostringDefault: null. Elements to exclude from the video.
audio_urlNostringURL to custom audio file (overrides audio parameter). Takes priority over `audio` setting.
sizeNostringDefault: "832*480". Available resolutions: "832*480", "1280*720", "1920*1080"
durationNointegerDefault: 5. Video length in seconds. Available values: 5, 10
audioNobooleanDefault: false. Audio behavior: false (silent), true (auto-generate audio)
prompt_extendNobooleanDefault: true. Enable intelligent prompt rewriting
watermarkNobooleanDefault: false. Add watermark to video
seedNointegerRandom seed for reproducible results

Example Request - Generate Text To Video Request

JSON
{ "prompt": "A beautiful sunset over a calm ocean with gentle waves", "size": "832*480", "duration": 5, "audio": false, "prompt_extend": true, "watermark": false }

Response - Generate Text To Video Request

JSON
{ "request_id": "db27ee62-1148-9de4-aab9-xxxxxx", "task_id": "31c13f64-60e3-4822-b255-xxxxxx", "task_status": "PENDING" }

Request Headers

HeaderDescription
Content-TypeMust be set to application/json
Cache-ControlMust be set to no-cache
Ocp-Apim-Subscription-KeyYour API subscription key for authentication

Response Handling

The Wan 2.5 Video Generation 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 CodeDescriptionResponse Body
200Success - The request was successfully processed.{ "success": true, ... }
Bad Request - The request contains invalid parameters or missing fields.{ "error": "Invalid request parameters" }
401Unauthorized - The provided subscription key is missing or invalid.{ "error": "Invalid or missing authentication" }
403Forbidden - The subscription does not have access to this API or action.{ "error": "Access denied for this operation" }
404Not Found - The requested resource or endpoint could not be found.{ "error": "Endpoint not found" }
Too Many Requests - The request rate limit has been exceeded.{ "error": "Rate limit exceeded, please retry later" }
500Internal 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": "31c13f64-60e3-4822-b255-xxxxxx" }

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": "31c13f64-60e3-4822-b255-xxxxxx" }
import requests 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": "31c13f64-60e3-4822-b255-xxxxxx" } response = requests.post(url, json=data, headers=headers) 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: '31c13f64-60e3-4822-b255-xxxxxx' }; 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": "31c13f64-60e3-4822-b255-xxxxxx" }'
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-video-polling/getTextToVideoResult"; String json = "{\n" + " \"task_id\": \"31c13f64-60e3-4822-b255-xxxxxx\"\n" + "}"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .timeout(Duration.ofSeconds(10)) .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' => '31c13f64-60e3-4822-b255-xxxxxx' ]); $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": "<VIDEO_URL>", "orig_prompt": "A kitten running in the moonlight", "actual_prompt": "<ENHANCED_PROMPT>" }, "usage": { "video_duration": 5, "video_ratio": "1920*1080", "video_count": 1 } }

Wan 2.5 API Pricing

Resolution Price (USD)
All Resolution$0.05