Gemini原生(视频)
curl --request POST \
--url https://api.leapx-hub.com/v1/video/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"durationSeconds": 123,
"aspectRatio": "<string>",
"resolution": "<string>",
"image": "<string>",
"lastFrame": "<string>",
"generateAudio": true,
"sampleCount": 123
}
'import requests
url = "https://api.leapx-hub.com/v1/video/generations"
payload = {
"prompt": "<string>",
"durationSeconds": 123,
"aspectRatio": "<string>",
"resolution": "<string>",
"image": "<string>",
"lastFrame": "<string>",
"generateAudio": True,
"sampleCount": 123
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
durationSeconds: 123,
aspectRatio: '<string>',
resolution: '<string>',
image: '<string>',
lastFrame: '<string>',
generateAudio: true,
sampleCount: 123
})
};
fetch('https://api.leapx-hub.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://api.leapx-hub.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([
'prompt' => '<string>',
'durationSeconds' => 123,
'aspectRatio' => '<string>',
'resolution' => '<string>',
'image' => '<string>',
'lastFrame' => '<string>',
'generateAudio' => true,
'sampleCount' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.leapx-hub.com/v1/video/generations"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"durationSeconds\": 123,\n \"aspectRatio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"image\": \"<string>\",\n \"lastFrame\": \"<string>\",\n \"generateAudio\": true,\n \"sampleCount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.leapx-hub.com/v1/video/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"durationSeconds\": 123,\n \"aspectRatio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"image\": \"<string>\",\n \"lastFrame\": \"<string>\",\n \"generateAudio\": true,\n \"sampleCount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leapx-hub.com/v1/video/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"durationSeconds\": 123,\n \"aspectRatio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"image\": \"<string>\",\n \"lastFrame\": \"<string>\",\n \"generateAudio\": true,\n \"sampleCount\": 123\n}"
response = http.request(request)
puts response.read_body视频系列
Gemini原生(视频)
Google Veo 视频生成模型
POST
/
v1
/
video
/
generations
Gemini原生(视频)
curl --request POST \
--url https://api.leapx-hub.com/v1/video/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"durationSeconds": 123,
"aspectRatio": "<string>",
"resolution": "<string>",
"image": "<string>",
"lastFrame": "<string>",
"generateAudio": true,
"sampleCount": 123
}
'import requests
url = "https://api.leapx-hub.com/v1/video/generations"
payload = {
"prompt": "<string>",
"durationSeconds": 123,
"aspectRatio": "<string>",
"resolution": "<string>",
"image": "<string>",
"lastFrame": "<string>",
"generateAudio": True,
"sampleCount": 123
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
durationSeconds: 123,
aspectRatio: '<string>',
resolution: '<string>',
image: '<string>',
lastFrame: '<string>',
generateAudio: true,
sampleCount: 123
})
};
fetch('https://api.leapx-hub.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://api.leapx-hub.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([
'prompt' => '<string>',
'durationSeconds' => 123,
'aspectRatio' => '<string>',
'resolution' => '<string>',
'image' => '<string>',
'lastFrame' => '<string>',
'generateAudio' => true,
'sampleCount' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.leapx-hub.com/v1/video/generations"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"durationSeconds\": 123,\n \"aspectRatio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"image\": \"<string>\",\n \"lastFrame\": \"<string>\",\n \"generateAudio\": true,\n \"sampleCount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.leapx-hub.com/v1/video/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"durationSeconds\": 123,\n \"aspectRatio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"image\": \"<string>\",\n \"lastFrame\": \"<string>\",\n \"generateAudio\": true,\n \"sampleCount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leapx-hub.com/v1/video/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"durationSeconds\": 123,\n \"aspectRatio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"image\": \"<string>\",\n \"lastFrame\": \"<string>\",\n \"generateAudio\": true,\n \"sampleCount\": 123\n}"
response = http.request(request)
puts response.read_body简介
Veo 是 Google Vertex AI 推出的多模态视频生成模型,支持文生视频(T2V)、首帧约束与首尾帧约束(仅 3.1 系列)生成连贯视频。通过 LeapX 统一视频接口调用:先 提交任务 获取task_id,再 查询任务 轮询状态并获取结果。
认证
string
必填
Bearer Token,如
Bearer sk-xxxxxxxxxx支持的模型
| 模型 ID | 说明 |
|---|---|
veo-3.0-fast-generate-001 | 文生视频、首帧模式,快速版(默认含音频) |
veo-3.1-fast-generate-preview | 文生视频、首帧/首尾帧模式,快速版 |
veo-3.0-generate-preview | 文生视频、首帧模式 |
veo-3.1-generate-preview | 文生视频、首帧/首尾帧模式 |
调用流程
- 提交任务:
POST /v1/video/generations,传入model、prompt及 Veo 专用参数。 - 轮询状态:
GET /v1/video/generations/{task_id},直到status为succeeded或failed。 - 获取结果:成功时响应中的
url为视频数据(Veo 可能为data:video/mp4;base64,...或 OSS 链接)。
Veo 专用参数
string
必填
视频生成提示词,描述画面与动作。
integer
默认值:"4"
视频时长(秒),支持:
4、6、8。string
默认值:"16:9"
宽高比,仅支持:
16:9、9:16。string
默认值:"1080p"
分辨率:
720p、1080p。string
首帧参考图(URL 或 Base64),用于图生视频/首帧约束。
string
尾帧参考图(仅
veo-3.1 系列支持),与首帧配合实现首尾帧约束。boolean
默认值:"false"
是否生成同步音频。快速版模型会忽略该参数并始终包含音频。
integer
默认值:"1"
每次生成的视频数量,范围
1-4。personGeneration、addWatermark、seed)见 提交视频任务。
请求示例
提交 Veo 任务(文生视频):curl -X POST "https://api.leapx-hub.com/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1-fast-generate-preview",
"prompt": "清晨阳光洒在赛博城市的高楼群,镜头慢慢推进",
"durationSeconds": 6,
"aspectRatio": "16:9",
"resolution": "1080p",
"generateAudio": false
}'
curl -X GET "https://api.leapx-hub.com/v1/video/generations/{task_id}" \
-H "Authorization: Bearer sk-xxxxxxxxxx"
⌘I
