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 秒の動画を 4 種類の解像度で生成
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_bodymodel に 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 | 参照画像 URL は最大 10 件. 入力動画との併用はできません. |
video_list | video_url を含むオブジェクトを最大 3 件. MP4/MOV のみ, 各 50 MiB 以下. |
metadata.task | 任意: text_to_video / image_to_video / reference_to_video / edit. 省略時はモデルが判断します. |
料金
USD. 出力は要求した秒数で課金します. 入力動画はサーバーで長さを測定し, 各動画を整数秒へ切り上げて $0.006950/秒を追加課金します. 以下は基本料金で, 割引は見積もりに従います.| 出力解像度 | 1 秒あたり |
|---|---|
| 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 を使い, 統一タスク API から状態と結果を取得します.curl https://toapis.com/v1/videos/generations/TASK_ID \
-H "Authorization: Bearer YOUR_API_KEY"