Wan 2.2 Text-to-Video
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.2-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": true,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.2-t2v"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": True,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
input: {prompt: '<string>', negative_prompt: '<string>'},
parameters: {
size: '<string>',
duration: 123,
prompt_extend: true,
seed: 123,
loras: [{path: '<string>', scale: 123}]
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.2-t2v', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/async/wan-2.2-t2v",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'prompt' => '<string>',
'negative_prompt' => '<string>'
],
'parameters' => [
'size' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'seed' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/async/wan-2.2-t2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/wan-2.2-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.2-t2v")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Video
Wan 2.2 Text-to-Video
POST
/
v3
/
async
/
wan-2.2-t2v
Wan 2.2 Text-to-Video
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.2-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": true,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.2-t2v"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": True,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
input: {prompt: '<string>', negative_prompt: '<string>'},
parameters: {
size: '<string>',
duration: 123,
prompt_extend: true,
seed: 123,
loras: [{path: '<string>', scale: 123}]
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.2-t2v', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/async/wan-2.2-t2v",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'prompt' => '<string>',
'negative_prompt' => '<string>'
],
'parameters' => [
'size' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'seed' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/async/wan-2.2-t2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/wan-2.2-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.2-t2v")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Wan 2.2 (Wanxiang 2.2) Pro text-to-video model can generate high-quality video content based on text descriptions. Compared with previous-generation models, it offers significant improvements in visual details and motion stability, and supports generating videos with durations of 5 seconds and 8 seconds.
This is an asynchronous API and only returns the task_id of the asynchronous task. You should use this task_id to request the Get Task Result API to retrieve the video generation result.
Request Headers
Enum value:
application/jsonBearer authentication format: Bearer {{API key}}.
Request Body
Basic input information, such as the prompt.
Hide properties
Hide properties
Text prompt. Chinese and English are supported. The length must not exceed 800 characters; each Chinese character/letter counts as one character, and any excess will be automatically truncated.Example value: A kitten running under the moonlight.
Negative prompt, used to describe content you do not want to see in the video frame and to restrict the video image.Chinese and English are supported. The length must not exceed 500 characters, and any excess will be automatically truncated.Example value: low resolution, errors, worst quality, low quality, incomplete, extra fingers, poor proportions, etc.
Video processing parameters.
Hide properties
Hide properties
Multiple resolution tiers are supported, including 480P, 720P, and 1080P. The default value is
1920*1080 (1080P).
Used to specify the video resolution in width*height format. The resolutions supported by different models are as follows:480P tier: Available video resolutions and their corresponding video aspect ratios:832*480: 16:9.480*832: 9:16.624*624: 1:1.
1280*720: 16:9.720*1280: 9:16.
1920*1080: 16:9.1080*1920: 9:16.1440*1440: 1:1.1632*1248: 4:3.1248*1632: 3:4.
Common misconception about the size parameter: size must be set to the specific value of the target resolution (such as
1280*720), not an aspect ratio (such as 1:1) or the name of a resolution tier (such as 480P or 720P).Duration of the generated video.
- For
480Pand720Presolutions, the available durations are5or8seconds. - For
1080Presolution, the duration is fixed at5seconds.
5.Whether to enable intelligent prompt rewriting. When enabled, a large model is used to intelligently rewrite the input prompt. This significantly improves generation results for shorter prompts, but increases processing time.
true: Default value; enables intelligent rewriting.false: Disables intelligent rewriting.
Random seed, used to control the randomness of the content generated by the model. Value range:
[0, 2147483647].If not provided, the algorithm automatically generates a random number as the seed. If you want the generated content to remain relatively stable, use the same seed parameter value.Response Information
The task_id of the asynchronous task. You should use this task_id to request the Get Task Result API to obtain the generation result
⌘I