Create Generation Task
curl --request POST \
--url https://api.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"image": "<string>",
"negative_prompt": "<string>",
"resolution": "720P",
"duration": 5,
"prompt_extend": true,
"seed": 1073741823,
"safety_filter": true
}
'import requests
url = "https://api.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation"
payload = {
"prompt": "<string>",
"image": "<string>",
"negative_prompt": "<string>",
"resolution": "720P",
"duration": 5,
"prompt_extend": True,
"seed": 1073741823,
"safety_filter": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
image: '<string>',
negative_prompt: '<string>',
resolution: '720P',
duration: 5,
prompt_extend: true,
seed: 1073741823,
safety_filter: true
})
};
fetch('https://api.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation', 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.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation",
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([
'prompt' => '<string>',
'image' => '<string>',
'negative_prompt' => '<string>',
'resolution' => '720P',
'duration' => 5,
'prompt_extend' => true,
'seed' => 1073741823,
'safety_filter' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"safety_filter\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"safety_filter\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"safety_filter\": true\n}"
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Wan 2.2 Image-To-Video Flash
Wan 2.2 Image-To-Video Flash Generation
Generate videos from images using the wan2.2-i2v-flash model. Fast version with 50% speed improvement.
POST
/
vendors
/
alibaba
/
v1
/
wan2.2-i2v-flash
/
generation
Create Generation Task
curl --request POST \
--url https://api.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"image": "<string>",
"negative_prompt": "<string>",
"resolution": "720P",
"duration": 5,
"prompt_extend": true,
"seed": 1073741823,
"safety_filter": true
}
'import requests
url = "https://api.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation"
payload = {
"prompt": "<string>",
"image": "<string>",
"negative_prompt": "<string>",
"resolution": "720P",
"duration": 5,
"prompt_extend": True,
"seed": 1073741823,
"safety_filter": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
image: '<string>',
negative_prompt: '<string>',
resolution: '720P',
duration: 5,
prompt_extend: true,
seed: 1073741823,
safety_filter: true
})
};
fetch('https://api.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation', 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.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation",
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([
'prompt' => '<string>',
'image' => '<string>',
'negative_prompt' => '<string>',
'resolution' => '720P',
'duration' => 5,
'prompt_extend' => true,
'seed' => 1073741823,
'safety_filter' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"safety_filter\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"safety_filter\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/alibaba/v1/wan2.2-i2v-flash/generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"safety_filter\": true\n}"
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}This API supports Alibaba Tongyi Wanxiang (Wan2) video generation models. Please refer to Alibaba Cloud’s official documentation for more details.
Overview
Generate videos from images using the wan2.2-i2v-flash model. This is the fast version with 50% speed improvement compared to the Plus version.Key Features
- Fast image-to-video generation (50% faster)
- 480P/720P resolution options
- Fixed 5s duration
- 30fps output
- Optional video effect templates
Image Requirements
| Property | Requirement |
|---|---|
| Formats | JPEG, JPG, PNG (no transparency), BMP, WEBP |
| Dimensions | [360, 2000] pixels for both width and height |
| File Size | Max 10MB |
| Input | Public URL or Base64 encoded data |
Example Requests
Basic Image-to-Video
{
"prompt": "Character turns head and smiles",
"image": "https://example.com/portrait.jpg",
"resolution": "720P",
"duration": 5
}
With Video Effect Template
{
"prompt": "Gentle motion, camera slowly pans right",
"image": "https://example.com/scene.jpg",
"template": "solaron",
"resolution": "720P",
"duration": 5
}
With Base64 Image
{
"prompt": "Subject starts moving slowly",
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"resolution": "720P",
"duration": 5
}
Parameters
template
- Optional: Yes
- Description: Apply a video effect template
- Use case: Create specific visual effects
duration
- Fixed: 5 seconds
- FPS: 30fps
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Motion/story description (max 800 characters).
Maximum string length:
800First-frame image (URL or Base64). Supported formats: JPEG/JPG/PNG/BMP/WEBP, 360-2000px, ≤10MB.
Negative prompt describing unwanted content (max 500 characters).
Maximum string length:
500Output resolution tier:
- 480P
- 720P
Available options:
480P, 720P Video duration in seconds (30 fps). Fixed at 5 seconds.
Available options:
5 Enable intelligent prompt rewriting.
Random seed [0, 2147483647].
Required range:
0 <= x <= 2147483647Enable content safety filter. Defaults to true. Set to false to disable content safety inspection.
Response
202 - application/json
Accepted - Task created successfully
Show child attributes
Show child attributes

