创建文生视频任务
curl --request POST \
--url https://ai.cubeuaeai.com/v1/video/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "happyhorse-1.0-t2v",
"prompt": "一只猫在草地上奔跑",
"resolution": "720P",
"ratio": "16:9",
"duration": 5,
"watermark": false,
"seed": 42,
"parameters": {}
}
'import requests
url = "https://ai.cubeuaeai.com/v1/video/generations"
payload = {
"model": "happyhorse-1.0-t2v",
"prompt": "一只猫在草地上奔跑",
"resolution": "720P",
"ratio": "16:9",
"duration": 5,
"watermark": False,
"seed": 42,
"parameters": {}
}
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({
model: 'happyhorse-1.0-t2v',
prompt: '一只猫在草地上奔跑',
resolution: '720P',
ratio: '16:9',
duration: 5,
watermark: false,
seed: 42,
parameters: {}
})
};
fetch('https://ai.cubeuaeai.com/v1/video/generations', 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://ai.cubeuaeai.com/v1/video/generations",
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.0-t2v',
'prompt' => '一只猫在草地上奔跑',
'resolution' => '720P',
'ratio' => '16:9',
'duration' => 5,
'watermark' => false,
'seed' => 42,
'parameters' => [
]
]),
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://ai.cubeuaeai.com/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"happyhorse-1.0-t2v\",\n \"prompt\": \"一只猫在草地上奔跑\",\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 42,\n \"parameters\": {}\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://ai.cubeuaeai.com/v1/video/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"happyhorse-1.0-t2v\",\n \"prompt\": \"一只猫在草地上奔跑\",\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 42,\n \"parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.cubeuaeai.com/v1/video/generations")
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 \"model\": \"happyhorse-1.0-t2v\",\n \"prompt\": \"一只猫在草地上奔跑\",\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 42,\n \"parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
"task_id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
"object": "video",
"model": "happyhorse-1.0-t2v",
"status": "queued",
"progress": 0,
"created_at": 1777343862
}Alibaba
HappyHorse 1.0 T2V
提交文生视频任务。立即返回 task_id,通过 GET /v1/video/generations/{task_id} 轮询状态并获取视频 URL。
POST
/
v1
/
video
/
generations
创建文生视频任务
curl --request POST \
--url https://ai.cubeuaeai.com/v1/video/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "happyhorse-1.0-t2v",
"prompt": "一只猫在草地上奔跑",
"resolution": "720P",
"ratio": "16:9",
"duration": 5,
"watermark": false,
"seed": 42,
"parameters": {}
}
'import requests
url = "https://ai.cubeuaeai.com/v1/video/generations"
payload = {
"model": "happyhorse-1.0-t2v",
"prompt": "一只猫在草地上奔跑",
"resolution": "720P",
"ratio": "16:9",
"duration": 5,
"watermark": False,
"seed": 42,
"parameters": {}
}
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({
model: 'happyhorse-1.0-t2v',
prompt: '一只猫在草地上奔跑',
resolution: '720P',
ratio: '16:9',
duration: 5,
watermark: false,
seed: 42,
parameters: {}
})
};
fetch('https://ai.cubeuaeai.com/v1/video/generations', 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://ai.cubeuaeai.com/v1/video/generations",
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.0-t2v',
'prompt' => '一只猫在草地上奔跑',
'resolution' => '720P',
'ratio' => '16:9',
'duration' => 5,
'watermark' => false,
'seed' => 42,
'parameters' => [
]
]),
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://ai.cubeuaeai.com/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"happyhorse-1.0-t2v\",\n \"prompt\": \"一只猫在草地上奔跑\",\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 42,\n \"parameters\": {}\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://ai.cubeuaeai.com/v1/video/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"happyhorse-1.0-t2v\",\n \"prompt\": \"一只猫在草地上奔跑\",\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 42,\n \"parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.cubeuaeai.com/v1/video/generations")
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 \"model\": \"happyhorse-1.0-t2v\",\n \"prompt\": \"一只猫在草地上奔跑\",\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 42,\n \"parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
"task_id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
"object": "video",
"model": "happyhorse-1.0-t2v",
"status": "queued",
"progress": 0,
"created_at": 1777343862
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
模型 ID。
可用选项:
happyhorse-1.0-t2v 示例:
"happyhorse-1.0-t2v"
视频描述文本。
示例:
"一只猫在草地上奔跑"
视频分辨率。
可用选项:
720P, 1080P 示例:
"720P"
宽高比。
可用选项:
16:9, 9:16, 1:1, 4:3, 3:4 示例:
"16:9"
视频时长(秒)。
必填范围:
3 <= x <= 15示例:
5
是否保留右下角 "Happy Horse" 水印。设为 false 可关闭。
示例:
false
随机种子,用于结果可复现。
必填范围:
0 <= x <= 2147483647示例:
42
可选:上述参数也可放在 parameters 对象中(DashScope 原生风格),效果一致。