Wan2.2 API Documentation

Wan Image to Video First Frame - Request Code

POST https://gateway.pixazo.ai/wan-i2v/v1/generateImageToVideoRequest HTTP/1.1
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 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: {
    '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 -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 json = "{" +
            "\n  \"model\": \"wan2.2-i2v-plus\"," +
            "\n  \"input\": {" +
            "\n    \"prompt\": \"Banana dancing in a traditional dress\"," +
            "\n    \"negative_prompt\": \"flowers, blur\"," +
            "\n    \"img_url\": \"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana.jpeg\"" +
            "\n  }," +
            "\n  \"parameters\": {" +
            "\n    \"resolution\": \"1080P\"," +
            "\n    \"duration\": 5," +
            "\n    \"prompt_extend\": true," +
            "\n    \"watermark\": false," +
            "\n    \"seed\": 12345" +
            "\n  }" +
            "\n}";

        HttpClient client = HttpClient.newBuilder()
            .connectTimeout(Duration.ofSeconds(10))
            .build();

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://gateway.pixazo.ai/wan-i2v/v1/generateImageToVideoRequest"))
            .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 = [
    '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_HTTPHEADER, [
    'Content-Type: application/json',
    'Cache-Control: no-cache',
    'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY'
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$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": "<STATUS>"
  }
}

Request Body - Wan Image to Video First Frame

Parameters for /generateImageToVideoRequest:

ParameterRequiredTypeDescription
modelYesstringModel to use. Available values: "wan2.2-i2v-flash", "wan2.2-i2v-plus" (recommended), "wan2.1-i2v-plus", "wan2.1-i2v-turbo".
input.img_urlYesstringURL 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.promptNostringDefault: null. Text description to guide video generation. Supports English and Chinese, up to 800 characters.
input.negative_promptNostringDefault: null. Elements to exclude from the video. Up to 500 characters.
parameters.resolutionNostringDefault 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.durationNointegerDefault: 5. Video duration in seconds. For wan2.1-i2v-turbo: 3, 4, or 5. Other models fixed at 5.
parameters.prompt_extendNobooleanDefault: true. When enabled, uses LLM to enhance the prompt. Improves quality but adds processing time.
parameters.watermarkNobooleanDefault: false. When true, adds "Generated by AI" watermark at bottom-right.
parameters.seedNointegerDefault: 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": "<STATUS>"
  }
}

Request Headers

HeaderDescription
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYour 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 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": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXX"
}
POST https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult HTTP/1.1
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXX"
}
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-XXXXXXXXXXXXX"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const url = 'https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult';

const data = {
  "task_id": "19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXX"
};

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 -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-XXXXXXXXXXXXX"
}'
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 json = "{" +
            "\n  \"task_id\": \"19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXX\"" +
            "\n}";

        HttpClient client = HttpClient.newBuilder()
            .connectTimeout(Duration.ofSeconds(10))
            .build();

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://gateway.pixazo.ai/wan-video-polling/getTextToVideoResult"))
            .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 = [
    'task_id' => '19d8e7a6-c652-XXXX-XXXX-XXXXXXXXXXXXX'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Cache-Control: no-cache',
    'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY'
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

Wan2.2 API Pricing

Model Resolution CostPerSec Seconds Price (USD)
wan2.1-kf2v-plus720P0.125$0.6
wan2.2-i2v-flash480P0.017-$0.085
wan2.2-i2v-flash720P0.045$0.2
wan2.2-i2v-plus480P0.025-$0.125
wan2.2-i2v-plus1080P0.15-$0.75
wan2.1-i2v-turbo480P0.045$0.2
wan2.1-i2v-turbo720P0.04-$0.2
wan2.1-i2v-plus720P0.15-$0.75

Ready to generate Wan2.2 API assets?

Start with an API key, then automate your pipeline.