Gemini Omni 1.1 Flash
gemini-omni · Video · unitool
Мультимодальная видео-генерация Google: текст, референсы, первый/последний кадр, видео-клипы, а также переиспользуемые персонажи и голоса.
Generations are async: create, wait or poll, the result by link for 7 days. Details: Media generations
Генерация видео
Mode generate · gemini-omni:generate
Price
Depends on the parameters: 85 tokens for the example below, base 85. Get the exact price of your request from POST /v1/quotes.
Price make-up (pricing from GET /v1/models/{id})
JSON
{
"unit": "tokens",
"kind": "by_parameters",
"base": 85,
"example_price": 85,
"matrix": [
{
"when": {
"resolution": "4k"
},
"when_set": [
"video_file"
],
"price": 203
},
{
"when_set": [
"video_file"
],
"price": 135
},
{
"when": {
"duration": "4",
"resolution": "4k"
},
"price": 118
},
{
"when": {
"duration": "6",
"resolution": "4k"
},
"price": 135
},
{
"when": {
"duration": "8",
"resolution": "4k"
},
"price": 152
},
{
"when": {
"duration": "10",
"resolution": "4k"
},
"price": 169
},
{
"when": {
"duration": "4"
},
"price": 51
},
{
"when": {
"duration": "6"
},
"price": 68
},
{
"when": {
"duration": "8"
},
"price": 85
},
{
"when": {
"duration": "10"
},
"price": 102
}
]
}Parameters
| Parameter | Type | Description |
|---|---|---|
promptrequired | string | |
resolution | 360p | 720p | 1080p | 4k | РазрешениеDefault "720p" |
duration | 4 | 6 | 8 | 10 | Длительность. При загруженном видео длительность выбирает модельDefault "8" |
aspect_ratio | 16:9 | 9:16 | ФорматDefault "16:9" |
first_frame_url | file | Первый кадр. Стартовый кадр видео. Несовместим с референсами, видео, голосами и персонажами A file_ref (asset:… or attachment:…), an https URL or a data: URL. Cannot be combined with: image_urls, audio_ids, video_file, character_ids. |
last_frame_url | file | Последний кадр. Только вместе с первым кадром A file_ref (asset:… or attachment:…), an https URL or a data: URL. |
video_file | file | Видео-референс. Файл до 100 МБ и до 30 с, занимает 2 слота квоты из 7 A file_ref (asset:… or attachment:…), an https URL or a data: URL. Cannot be combined with: first_frame_url. |
video_start | number 0– | Отрезок видео. Из референса используется отрезок не длиннее 10 сDefault 0 |
video_ends | number | Конец отрезкаDefault 10 |
character_ids | array of string (≤ 3) | Персонажи. 1 персонаж = 1 слот квоты (набор портрет+тело — 2), всего 7 слотов на референсы Cannot be combined with: first_frame_url. |
audio_ids | array of string (≤ 3) | Голоса. Озвучка, диалоги или звуковой референс Cannot be combined with: first_frame_url. |
seed | number 0– | Seed. Для воспроизводимости результата |
image_urls | array of file (≤ 7) | A file_ref (asset:… or attachment:…), an https URL or a data: URL. |
Example request
curl
curl https://api.unitool.ai/v1/generations \
-H "Authorization: Bearer $UNITOOL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Prefer: wait=60" \
-d '{
"model": "gemini-omni",
"mode": "generate",
"input": {
"prompt": "A red fox running through fresh snow at sunrise",
"resolution": "720p",
"duration": "8",
"aspect_ratio": "16:9",
"video_start": 0,
"video_ends": 10
}
}'Python (requests)
import json, os, time, uuid, requests
API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
"model": "gemini-omni",
"mode": "generate",
"input": {
"prompt": "A red fox running through fresh snow at sunrise",
"resolution": "720p",
"duration": "8",
"aspect_ratio": "16:9",
"video_start": 0,
"video_ends": 10
}
}''')
gen = requests.post(f"{API}/generations", json=body,
headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
time.sleep(5)
gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
"model": "gemini-omni",
"mode": "generate",
"input": {
"prompt": "A red fox running through fresh snow at sunrise",
"resolution": "720p",
"duration": "8",
"aspect_ratio": "16:9",
"video_start": 0,
"video_ends": 10
}
};
let gen = await (await fetch(`${API}/generations`, {
method: "POST", body: JSON.stringify(body),
headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
await new Promise((resolve) => setTimeout(resolve, 5000));
gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));