Wan 2.1 Text to Video
curl --request POST \
--url https://api.myrouter.ai/v3/async/wan-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"extra": {
"webhook": "<string>",
"response_video_type": "<string>"
},
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"steps": 123,
"width": 123,
"height": 123,
"prompt": "<string>",
"fast_mode": true,
"watermark": true,
"flow_shift": 123,
"guidance_scale": 123,
"negative_prompt": "<string>",
"enable_safety_checker": true
}
'import requests
url = "https://api.myrouter.ai/v3/async/wan-t2v"
payload = {
"seed": 123,
"extra": {
"webhook": "<string>",
"response_video_type": "<string>"
},
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"steps": 123,
"width": 123,
"height": 123,
"prompt": "<string>",
"fast_mode": True,
"watermark": True,
"flow_shift": 123,
"guidance_scale": 123,
"negative_prompt": "<string>",
"enable_safety_checker": True
}
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({
seed: 123,
extra: {webhook: '<string>', response_video_type: '<string>'},
loras: [{path: '<string>', scale: 123}],
steps: 123,
width: 123,
height: 123,
prompt: '<string>',
fast_mode: true,
watermark: true,
flow_shift: 123,
guidance_scale: 123,
negative_prompt: '<string>',
enable_safety_checker: true
})
};
fetch('https://api.myrouter.ai/v3/async/wan-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.myrouter.ai/v3/async/wan-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([
'seed' => 123,
'extra' => [
'webhook' => '<string>',
'response_video_type' => '<string>'
],
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
],
'steps' => 123,
'width' => 123,
'height' => 123,
'prompt' => '<string>',
'fast_mode' => true,
'watermark' => true,
'flow_shift' => 123,
'guidance_scale' => 123,
'negative_prompt' => '<string>',
'enable_safety_checker' => true
]),
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.myrouter.ai/v3/async/wan-t2v"
payload := strings.NewReader("{\n \"seed\": 123,\n \"extra\": {\n \"webhook\": \"<string>\",\n \"response_video_type\": \"<string>\"\n },\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"steps\": 123,\n \"width\": 123,\n \"height\": 123,\n \"prompt\": \"<string>\",\n \"fast_mode\": true,\n \"watermark\": true,\n \"flow_shift\": 123,\n \"guidance_scale\": 123,\n \"negative_prompt\": \"<string>\",\n \"enable_safety_checker\": true\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.myrouter.ai/v3/async/wan-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"extra\": {\n \"webhook\": \"<string>\",\n \"response_video_type\": \"<string>\"\n },\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"steps\": 123,\n \"width\": 123,\n \"height\": 123,\n \"prompt\": \"<string>\",\n \"fast_mode\": true,\n \"watermark\": true,\n \"flow_shift\": 123,\n \"guidance_scale\": 123,\n \"negative_prompt\": \"<string>\",\n \"enable_safety_checker\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myrouter.ai/v3/async/wan-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 \"seed\": 123,\n \"extra\": {\n \"webhook\": \"<string>\",\n \"response_video_type\": \"<string>\"\n },\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"steps\": 123,\n \"width\": 123,\n \"height\": 123,\n \"prompt\": \"<string>\",\n \"fast_mode\": true,\n \"watermark\": true,\n \"flow_shift\": 123,\n \"guidance_scale\": 123,\n \"negative_prompt\": \"<string>\",\n \"enable_safety_checker\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"provider_request_id": "<string>"
}Video
Wan 2.1 Text to Video
POST
/
v3
/
async
/
wan-t2v
Wan 2.1 Text to Video
curl --request POST \
--url https://api.myrouter.ai/v3/async/wan-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"extra": {
"webhook": "<string>",
"response_video_type": "<string>"
},
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"steps": 123,
"width": 123,
"height": 123,
"prompt": "<string>",
"fast_mode": true,
"watermark": true,
"flow_shift": 123,
"guidance_scale": 123,
"negative_prompt": "<string>",
"enable_safety_checker": true
}
'import requests
url = "https://api.myrouter.ai/v3/async/wan-t2v"
payload = {
"seed": 123,
"extra": {
"webhook": "<string>",
"response_video_type": "<string>"
},
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"steps": 123,
"width": 123,
"height": 123,
"prompt": "<string>",
"fast_mode": True,
"watermark": True,
"flow_shift": 123,
"guidance_scale": 123,
"negative_prompt": "<string>",
"enable_safety_checker": True
}
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({
seed: 123,
extra: {webhook: '<string>', response_video_type: '<string>'},
loras: [{path: '<string>', scale: 123}],
steps: 123,
width: 123,
height: 123,
prompt: '<string>',
fast_mode: true,
watermark: true,
flow_shift: 123,
guidance_scale: 123,
negative_prompt: '<string>',
enable_safety_checker: true
})
};
fetch('https://api.myrouter.ai/v3/async/wan-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.myrouter.ai/v3/async/wan-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([
'seed' => 123,
'extra' => [
'webhook' => '<string>',
'response_video_type' => '<string>'
],
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
],
'steps' => 123,
'width' => 123,
'height' => 123,
'prompt' => '<string>',
'fast_mode' => true,
'watermark' => true,
'flow_shift' => 123,
'guidance_scale' => 123,
'negative_prompt' => '<string>',
'enable_safety_checker' => true
]),
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.myrouter.ai/v3/async/wan-t2v"
payload := strings.NewReader("{\n \"seed\": 123,\n \"extra\": {\n \"webhook\": \"<string>\",\n \"response_video_type\": \"<string>\"\n },\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"steps\": 123,\n \"width\": 123,\n \"height\": 123,\n \"prompt\": \"<string>\",\n \"fast_mode\": true,\n \"watermark\": true,\n \"flow_shift\": 123,\n \"guidance_scale\": 123,\n \"negative_prompt\": \"<string>\",\n \"enable_safety_checker\": true\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.myrouter.ai/v3/async/wan-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"extra\": {\n \"webhook\": \"<string>\",\n \"response_video_type\": \"<string>\"\n },\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"steps\": 123,\n \"width\": 123,\n \"height\": 123,\n \"prompt\": \"<string>\",\n \"fast_mode\": true,\n \"watermark\": true,\n \"flow_shift\": 123,\n \"guidance_scale\": 123,\n \"negative_prompt\": \"<string>\",\n \"enable_safety_checker\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myrouter.ai/v3/async/wan-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 \"seed\": 123,\n \"extra\": {\n \"webhook\": \"<string>\",\n \"response_video_type\": \"<string>\"\n },\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"steps\": 123,\n \"width\": 123,\n \"height\": 123,\n \"prompt\": \"<string>\",\n \"fast_mode\": true,\n \"watermark\": true,\n \"flow_shift\": 123,\n \"guidance_scale\": 123,\n \"negative_prompt\": \"<string>\",\n \"enable_safety_checker\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"provider_request_id": "<string>"
}undefined
This is an async API that only returns the task_id of the async task. Use the task_id to call the Get Async Task Result API to retrieve the generated result.
Request Headers
string
required
Enum:
application/jsonstring
required
Bearer authentication format: Bearer {{API Key}}.
Request Body
integer
Range: [-1, 9999999999]
integer
Range: [1, 40]
integer
default:832
Possible values:
480, 720, 832, 1280integer
default:480
Possible values:
480, 720, 832, 1280string
required
Length limit: 1 - 2000
boolean
boolean
number
Range: [1, 10]
number
Range: [0, 10]
string
Length limit: 0 - 2000
boolean
Response
string
Use the task_id to call the Get Async Task Result API to retrieve the generated output.
string
⌘I