Veo 3.1 Fast 文生视频
curl --request POST \
--url https://api.highwayapi.ai/v3/async/veo-3.1-fast-generate-text2video \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"aspect_ratio": "<string>",
"duration_seconds": 123,
"enhance_prompt": true,
"generate_audio": true,
"negative_prompt": "<string>",
"person_generation": "<string>",
"resolution": "<string>",
"sample_count": 123,
"seed": {}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/veo-3.1-fast-generate-text2video"
payload = {
"prompt": "<string>",
"aspect_ratio": "<string>",
"duration_seconds": 123,
"enhance_prompt": True,
"generate_audio": True,
"negative_prompt": "<string>",
"person_generation": "<string>",
"resolution": "<string>",
"sample_count": 123,
"seed": {}
}
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({
prompt: '<string>',
aspect_ratio: '<string>',
duration_seconds: 123,
enhance_prompt: true,
generate_audio: true,
negative_prompt: '<string>',
person_generation: '<string>',
resolution: '<string>',
sample_count: 123,
seed: {}
})
};
fetch('https://api.highwayapi.ai/v3/async/veo-3.1-fast-generate-text2video', 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/veo-3.1-fast-generate-text2video",
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>',
'aspect_ratio' => '<string>',
'duration_seconds' => 123,
'enhance_prompt' => true,
'generate_audio' => true,
'negative_prompt' => '<string>',
'person_generation' => '<string>',
'resolution' => '<string>',
'sample_count' => 123,
'seed' => [
]
]),
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/veo-3.1-fast-generate-text2video"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"duration_seconds\": 123,\n \"enhance_prompt\": true,\n \"generate_audio\": true,\n \"negative_prompt\": \"<string>\",\n \"person_generation\": \"<string>\",\n \"resolution\": \"<string>\",\n \"sample_count\": 123,\n \"seed\": {}\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/veo-3.1-fast-generate-text2video")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"duration_seconds\": 123,\n \"enhance_prompt\": true,\n \"generate_audio\": true,\n \"negative_prompt\": \"<string>\",\n \"person_generation\": \"<string>\",\n \"resolution\": \"<string>\",\n \"sample_count\": 123,\n \"seed\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/veo-3.1-fast-generate-text2video")
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 \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"duration_seconds\": 123,\n \"enhance_prompt\": true,\n \"generate_audio\": true,\n \"negative_prompt\": \"<string>\",\n \"person_generation\": \"<string>\",\n \"resolution\": \"<string>\",\n \"sample_count\": 123,\n \"seed\": {}\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}视频
Veo 3.1 Fast 文生视频
POST
/
v3
/
async
/
veo-3.1-fast-generate-text2video
Veo 3.1 Fast 文生视频
curl --request POST \
--url https://api.highwayapi.ai/v3/async/veo-3.1-fast-generate-text2video \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"aspect_ratio": "<string>",
"duration_seconds": 123,
"enhance_prompt": true,
"generate_audio": true,
"negative_prompt": "<string>",
"person_generation": "<string>",
"resolution": "<string>",
"sample_count": 123,
"seed": {}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/veo-3.1-fast-generate-text2video"
payload = {
"prompt": "<string>",
"aspect_ratio": "<string>",
"duration_seconds": 123,
"enhance_prompt": True,
"generate_audio": True,
"negative_prompt": "<string>",
"person_generation": "<string>",
"resolution": "<string>",
"sample_count": 123,
"seed": {}
}
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({
prompt: '<string>',
aspect_ratio: '<string>',
duration_seconds: 123,
enhance_prompt: true,
generate_audio: true,
negative_prompt: '<string>',
person_generation: '<string>',
resolution: '<string>',
sample_count: 123,
seed: {}
})
};
fetch('https://api.highwayapi.ai/v3/async/veo-3.1-fast-generate-text2video', 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/veo-3.1-fast-generate-text2video",
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>',
'aspect_ratio' => '<string>',
'duration_seconds' => 123,
'enhance_prompt' => true,
'generate_audio' => true,
'negative_prompt' => '<string>',
'person_generation' => '<string>',
'resolution' => '<string>',
'sample_count' => 123,
'seed' => [
]
]),
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/veo-3.1-fast-generate-text2video"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"duration_seconds\": 123,\n \"enhance_prompt\": true,\n \"generate_audio\": true,\n \"negative_prompt\": \"<string>\",\n \"person_generation\": \"<string>\",\n \"resolution\": \"<string>\",\n \"sample_count\": 123,\n \"seed\": {}\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/veo-3.1-fast-generate-text2video")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"duration_seconds\": 123,\n \"enhance_prompt\": true,\n \"generate_audio\": true,\n \"negative_prompt\": \"<string>\",\n \"person_generation\": \"<string>\",\n \"resolution\": \"<string>\",\n \"sample_count\": 123,\n \"seed\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/veo-3.1-fast-generate-text2video")
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 \"prompt\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"duration_seconds\": 123,\n \"enhance_prompt\": true,\n \"generate_audio\": true,\n \"negative_prompt\": \"<string>\",\n \"person_generation\": \"<string>\",\n \"resolution\": \"<string>\",\n \"sample_count\": 123,\n \"seed\": {}\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Veo 3.1 Preview 版本 API 已自动兼容到本接口
请求头
枚举值:
application/jsonBearer 身份验证格式: Bearer {{API 密钥}}。
请求体
描述您想要生成的视频的文本字符串。
指定生成视频的宽高比。枚举值:
16:9、9:16。默认值为 16:9。您想要生成的视频文件的长度(秒)。枚举值:
4、6、8。默认值为 8。指定是否使用 Gemini 增强您的提示词。仅支持
true。默认值: true指定是否为视频生成音频。
描述您想要阻止模型生成的内容的文本字符串。
控制是否允许人物或面部生成的安全设置。枚举值:
allow_adult(默认): 仅允许生成成人dont_allow: 不允许在图像中包含人物或面部allow_all: 允许生成所有年龄段的人物(需项目在 allowlist 中)
生成视频的分辨率。枚举值:
720p (默认) 或 1080p要生成的视频数量。取值范围: 1-4
用于初始化随机生成过程的数字。使用相同的种子、提示词和其他参数会产生相同的输出视频,使生成过程具有确定性。取值范围: 0-4,294,967,295
响应信息参数
异步任务的 task_id。您应该使用该 task_id 请求 查询任务结果 API 以获取生成结果
⌘I