Gemini Omni 1.1 影片生成與編輯
curl --request POST \
--url https://toapis.com/v1/videos/generationsimport requests
url = "https://toapis.com/v1/videos/generations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://toapis.com/v1/videos/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://toapis.com/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://toapis.com/v1/videos/generations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://toapis.com/v1/videos/generations")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyGemini Omni Official
Gemini Omni 1.1 影片生成與編輯
使用官方 Gemini Omni 1.1 Flash Preview 生成 3-10 秒影片, 支援四種解析度
POST
/
v1
/
videos
/
generations
Gemini Omni 1.1 影片生成與編輯
curl --request POST \
--url https://toapis.com/v1/videos/generationsimport requests
url = "https://toapis.com/v1/videos/generations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://toapis.com/v1/videos/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://toapis.com/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://toapis.com/v1/videos/generations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://toapis.com/v1/videos/generations")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body透過
請先上傳媒體以取得 URL. 不接受 Veo 專屬參數, 例如 generateAudio, negativePrompt 及 seed. 影片輸入請使用 video_list.
model 指定 gemini-omni-1.1-flash-preview-official. 此預覽模型支援文字生成影片, 圖片生成影片, 參考圖生成及影片編輯.
中國大陸使用者可將範例網域替換為
https://toapis.cn.參數
Authorization: Bearer YOUR_API_KEY
| 欄位 | 說明 |
|---|---|
model | gemini-omni-1.1-flash-preview-official |
prompt | 必填. 描述需要生成或編輯的內容. |
duration | 整數 3-10 秒, 預設 6 秒. |
resolution | 360p / 720p / 1080p / 4K, 預設 720p. |
aspect_ratio | 16:9 / 9:16, 預設 16:9. 編輯影片時不傳此欄位. |
image_urls | 最多 10 張參考圖 URL, 不可與輸入影片混用. |
video_list | 最多 3 項, 每項包含 video_url. 支援 MP4/MOV, 每項最大 50 MiB. |
metadata.task | 選填: text_to_video / image_to_video / reference_to_video / edit. 省略時由模型判斷. |
計費
USD, 輸出依請求秒數計費. 輸入影片依伺服器探測時長逐項無條件進位至整秒, 另計 $0.006950/秒. 以下為基本價格, 群組或帳戶折扣以報價為準.| 輸出解析度 | 每秒價格 |
|---|---|
| 360p | $0.027034 |
| 720p | $0.081088 |
| 1080p | $0.121632 |
| 4K | $0.243264 |
請求範例
curl https://toapis.com/v1/videos/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-1.1-flash-preview-official",
"prompt": "A red paper boat floating on a calm lake at sunrise",
"duration": 3,
"resolution": "360p",
"aspect_ratio": "16:9"
}'
{
"model": "gemini-omni-1.1-flash-preview-official",
"prompt": "Change the sky to a warm sunset",
"duration": 6,
"resolution": "1080p",
"video_list": [{"video_url": "https://example.com/uploaded-video.mp4"}],
"metadata": {"task": "edit"}
}
查詢結果
提交後取得任務 id, 透過統一任務查詢介面取得狀態與結果.curl https://toapis.com/v1/videos/generations/TASK_ID \
-H "Authorization: Bearer YOUR_API_KEY"