Wan 2.2 14B API Documentation

Speech to Video Request - Request Code

POST https://gateway.pixazo.ai/wan2.2-s2v/v1/generateSpeechToVideoRequest Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "prompt": "Summer beach vacation style, a man wearing sunglasses Blue Tshirt.", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png", "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_music.mp3" }
import requests url = "https://gateway.pixazo.ai/wan2.2-s2v/v1/generateSpeechToVideoRequest" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "prompt": "Summer beach vacation style, a man wearing sunglasses Blue Tshirt.", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png", "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_music.mp3" } response = requests.post(url, json=data, headers=headers) print(response.json())
const url = 'https://gateway.pixazo.ai/wan2.2-s2v/v1/generateSpeechToVideoRequest'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { prompt: 'Summer beach vacation style, a man wearing sunglasses Blue Tshirt.', image_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png', audio_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_music.mp3' }; 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/wan2.2-s2v/v1/generateSpeechToVideoRequest" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "prompt": "Summer beach vacation style, a man wearing sunglasses Blue Tshirt.", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png", "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_music.mp3" }'
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/wan2.2-s2v/v1/generateSpeechToVideoRequest"; String json = """ { "prompt": "Summer beach vacation style, a man wearing sunglasses Blue Tshirt.", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png", "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_music.mp3" } """; 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/wan2.2-s2v/v1/generateSpeechToVideoRequest'; $data = json_encode([ 'prompt' => 'Summer beach vacation style, a man wearing sunglasses Blue Tshirt.', 'image_url' => 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png', 'audio_url' => 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_music.mp3' ]); $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": "5ccf2522-a146-4032-92f2-c0bba9607ff8" }

Request Body - Speech to Video Request

Parameters for /generateSpeechToVideoRequest:

ParameterRequiredTypeDescription
promptYesstringThe text prompt used for video generation. Describes the style and content for the generated video.
image_urlYesstringURL of the input image. If the input image does not match the chosen aspect ratio, it is resized and center cropped.
audio_urlYesstringThe URL of the audio file that will be used to generate lip-sync and facial expressions in the video.
negative_promptNostringNegative prompt for video generation. Default: "". Used to steer the generation away from unwanted features.
seedNointegerRandom seed for reproducibility. If not provided, a random seed is chosen.
resolutionNostringResolution of the generated video. Default: "480p". Available values: "480p", "580p", "720p".
num_inference_stepsNointegerNumber of inference steps for sampling. Higher values give better quality but take longer. Default: 27.
enable_safety_checkerNobooleanIf set to true, input data will be checked for safety before processing.
guidance_scaleNofloatClassifier-free guidance scale. Higher values give better adherence to the prompt but may decrease quality. Default: 3.5.
shiftNofloatShift value for the video. Must be between 1.0 and 10.0. Default: 5.
video_qualityNostringThe quality of the output video. Higher quality means better visual quality but larger file size. Default: "high". Values: "low", "medium", "high", "maximum".
video_write_modeNostringThe write mode of the output video. Default: "balanced". Values: "fast" (faster results, larger file), "balanced" (compromise), "small" (slowest, smallest file).

Example Request - Speech to Video Request

JSON
{ "prompt": "Summer beach vacation style, a man wearing sunglasses Blue Tshirt.", "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png", "audio_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_music.mp3" }

Response - Speech to Video Request

JSON
{ "request_id": "5ccf2522-a146-4032-92f2-c0bba9607ff8" }

Retrieving Video Result and URL

After submitting your request, use this endpoint to check status and retrieve results.

Endpoint

POST https://gateway.pixazo.ai/wan2.2-s2v-polling/getStatusSpeechToVideo

Request Body

{ "requestId": "5ccf2522-a146-4032-92f2-c0bba9607ff8" }

Code Examples

POST https://gateway.pixazo.ai/wan2.2-s2v-polling/getStatusSpeechToVideo Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "requestId": "5ccf2522-a146-4032-92f2-c0bba9607ff8" }
import requests url = "https://gateway.pixazo.ai/wan2.2-s2v-polling/getStatusSpeechToVideo" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "requestId": "5ccf2522-a146-4032-92f2-c0bba9607ff8" } response = requests.post(url, json=data, headers=headers) print(response.json())
const url = 'https://gateway.pixazo.ai/wan2.2-s2v-polling/getStatusSpeechToVideo'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { requestId: '5ccf2522-a146-4032-92f2-c0bba9607ff8' }; 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/wan2.2-s2v-polling/getStatusSpeechToVideo" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "requestId": "5ccf2522-a146-4032-92f2-c0bba9607ff8" }'
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/wan2.2-s2v-polling/getStatusSpeechToVideo"; String json = """ { "requestId": "5ccf2522-a146-4032-92f2-c0bba9607ff8" } """; 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/wan2.2-s2v-polling/getStatusSpeechToVideo'; $data = json_encode([ 'requestId' => '5ccf2522-a146-4032-92f2-c0bba9607ff8' ]); $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 Responses

{ "status": "IN_PROGRESS", "detail": "Request is still in progress", "request_id": "5e463355-39bf-4ca4-bb00-61d314aa241a" }
{ "video": { "url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/wan-s2v/wan-s2v-5ccf2522-a146-4032-92f2-c0bba9607ff8.mp4", "content_type": "application/octet-stream", "file_name": "ddafecf17bd2482a9e7b15d7596e5e1b.mp4", "file_size": 3409777 } }

Request Headers

HeaderDescription
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYour API subscription key for authentication

Response Handling

The Wan 2.2 14B Speech 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 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" }

Wan 2.2 14B API Pricing

Resolution Seconds Price (USD)
480p5$0.75
580p5$1
720p5$1.25