Create happyhorse-1.1-i2v image-to-video task
curl --request POST \
--url https://api.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "happyhorse-1.1-i2v",
"input": {
"prompt": "一只猫在草地上奔跑",
"media": [
{
"type": "first_frame",
"url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"
}
]
},
"parameters": {
"resolution": "720P",
"duration": 5
}
}
'import requests
url = "https://api.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis"
payload = {
"model": "happyhorse-1.1-i2v",
"input": {
"prompt": "一只猫在草地上奔跑",
"media": [
{
"type": "first_frame",
"url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"
}
]
},
"parameters": {
"resolution": "720P",
"duration": 5
}
}
headers = {
"Content-Type": "<content-type>",
"X-DashScope-Async": "<x-dashscope-async>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Content-Type': '<content-type>',
'X-DashScope-Async': '<x-dashscope-async>',
Authorization: 'Bearer <token>'
},
body: JSON.stringify({
model: 'happyhorse-1.1-i2v',
input: {
prompt: '一只猫在草地上奔跑',
media: [
{
type: 'first_frame',
url: 'https://cdn.translate.alibaba.com/r/wanx-demo-1.png'
}
]
},
parameters: {resolution: '720P', duration: 5}
})
};
fetch('https://api.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis', 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.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis",
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([
'model' => 'happyhorse-1.1-i2v',
'input' => [
'prompt' => '一只猫在草地上奔跑',
'media' => [
[
'type' => 'first_frame',
'url' => 'https://cdn.translate.alibaba.com/r/wanx-demo-1.png'
]
]
],
'parameters' => [
'resolution' => '720P',
'duration' => 5
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"X-DashScope-Async: <x-dashscope-async>"
],
]);
$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.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis"
payload := strings.NewReader("{\n \"model\": \"happyhorse-1.1-i2v\",\n \"input\": {\n \"prompt\": \"一只猫在草地上奔跑\",\n \"media\": [\n {\n \"type\": \"first_frame\",\n \"url\": \"https://cdn.translate.alibaba.com/r/wanx-demo-1.png\"\n }\n ]\n },\n \"parameters\": {\n \"resolution\": \"720P\",\n \"duration\": 5\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-DashScope-Async", "<x-dashscope-async>")
req.Header.Add("Authorization", "Bearer <token>")
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.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis")
.header("Content-Type", "<content-type>")
.header("X-DashScope-Async", "<x-dashscope-async>")
.header("Authorization", "Bearer <token>")
.body("{\n \"model\": \"happyhorse-1.1-i2v\",\n \"input\": {\n \"prompt\": \"一只猫在草地上奔跑\",\n \"media\": [\n {\n \"type\": \"first_frame\",\n \"url\": \"https://cdn.translate.alibaba.com/r/wanx-demo-1.png\"\n }\n ]\n },\n \"parameters\": {\n \"resolution\": \"720P\",\n \"duration\": 5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["X-DashScope-Async"] = '<x-dashscope-async>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"model\": \"happyhorse-1.1-i2v\",\n \"input\": {\n \"prompt\": \"一只猫在草地上奔跑\",\n \"media\": [\n {\n \"type\": \"first_frame\",\n \"url\": \"https://cdn.translate.alibaba.com/r/wanx-demo-1.png\"\n }\n ]\n },\n \"parameters\": {\n \"resolution\": \"720P\",\n \"duration\": 5\n }\n}"
response = http.request(request)
puts response.read_body{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}Alibaba
HappyHorse 1.1 Image to Video
Submit an asynchronous Aliyun HappyHorse happyhorse-1.1-i2v image-to-video task.
After submitting a task, query its status via GET /ali/api/v1/tasks/{task_id}.
POST
/
ali
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
Create happyhorse-1.1-i2v image-to-video task
curl --request POST \
--url https://api.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "happyhorse-1.1-i2v",
"input": {
"prompt": "一只猫在草地上奔跑",
"media": [
{
"type": "first_frame",
"url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"
}
]
},
"parameters": {
"resolution": "720P",
"duration": 5
}
}
'import requests
url = "https://api.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis"
payload = {
"model": "happyhorse-1.1-i2v",
"input": {
"prompt": "一只猫在草地上奔跑",
"media": [
{
"type": "first_frame",
"url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"
}
]
},
"parameters": {
"resolution": "720P",
"duration": 5
}
}
headers = {
"Content-Type": "<content-type>",
"X-DashScope-Async": "<x-dashscope-async>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Content-Type': '<content-type>',
'X-DashScope-Async': '<x-dashscope-async>',
Authorization: 'Bearer <token>'
},
body: JSON.stringify({
model: 'happyhorse-1.1-i2v',
input: {
prompt: '一只猫在草地上奔跑',
media: [
{
type: 'first_frame',
url: 'https://cdn.translate.alibaba.com/r/wanx-demo-1.png'
}
]
},
parameters: {resolution: '720P', duration: 5}
})
};
fetch('https://api.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis', 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.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis",
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([
'model' => 'happyhorse-1.1-i2v',
'input' => [
'prompt' => '一只猫在草地上奔跑',
'media' => [
[
'type' => 'first_frame',
'url' => 'https://cdn.translate.alibaba.com/r/wanx-demo-1.png'
]
]
],
'parameters' => [
'resolution' => '720P',
'duration' => 5
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"X-DashScope-Async: <x-dashscope-async>"
],
]);
$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.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis"
payload := strings.NewReader("{\n \"model\": \"happyhorse-1.1-i2v\",\n \"input\": {\n \"prompt\": \"一只猫在草地上奔跑\",\n \"media\": [\n {\n \"type\": \"first_frame\",\n \"url\": \"https://cdn.translate.alibaba.com/r/wanx-demo-1.png\"\n }\n ]\n },\n \"parameters\": {\n \"resolution\": \"720P\",\n \"duration\": 5\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-DashScope-Async", "<x-dashscope-async>")
req.Header.Add("Authorization", "Bearer <token>")
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.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis")
.header("Content-Type", "<content-type>")
.header("X-DashScope-Async", "<x-dashscope-async>")
.header("Authorization", "Bearer <token>")
.body("{\n \"model\": \"happyhorse-1.1-i2v\",\n \"input\": {\n \"prompt\": \"一只猫在草地上奔跑\",\n \"media\": [\n {\n \"type\": \"first_frame\",\n \"url\": \"https://cdn.translate.alibaba.com/r/wanx-demo-1.png\"\n }\n ]\n },\n \"parameters\": {\n \"resolution\": \"720P\",\n \"duration\": 5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/ali/api/v1/services/aigc/video-generation/video-synthesis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["X-DashScope-Async"] = '<x-dashscope-async>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"model\": \"happyhorse-1.1-i2v\",\n \"input\": {\n \"prompt\": \"一只猫在草地上奔跑\",\n \"media\": [\n {\n \"type\": \"first_frame\",\n \"url\": \"https://cdn.translate.alibaba.com/r/wanx-demo-1.png\"\n }\n ]\n },\n \"parameters\": {\n \"resolution\": \"720P\",\n \"duration\": 5\n }\n}"
response = http.request(request)
puts response.read_body{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}Authorizations
Pass Authorization: Bearer <token> in the request header.
Headers
Request content type. This parameter must be set to application/json.
Asynchronous processing configuration parameter. HTTP requests only support async mode and must be set to enable. Missing this header will raise the error: "current user api does not support synchronous calls".
Body
application/json
Response
Submitted successfully. Returns a video task object.
⌘I