Skip to main content

Gemini Omni Flash Preview

Use gemini-omni-flash-preview through the UniAll.ai Gemini Interactions API to generate videos from text, one image, multiple images, one video, or a supported combination of images and video.

Base URL

All examples on this page use:

https://api.uniall.ai

If the UniAll.ai console provides a dedicated API address for your account, use the address shown in the console.

Quick Start

Generate a video:

POST /v1beta/interactions

Authenticate with:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Minimal text-to-video request:

curl -X POST "https://api.uniall.ai/v1beta/interactions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": "A cinematic robot walking through rain at night.",
"response_format": {
"type": "video",
"aspect_ratio": "16:9"
},
"generation_config": {
"video_config": {
"task": "text_to_video",
"resolution": "720p",
"duration_seconds": 4
}
}
}'

Supported Capabilities

CapabilitytaskInput
Text to videotext_to_videoA prompt with no image or video
Image to videoimage_to_videoA prompt and exactly one image
Reference generationreference_to_videoA prompt plus images, one video, or a supported image-and-video combination

The following inputs and operations are not currently supported:

  • audio reference assets;
  • first-frame and last-frame interpolation;
  • continuation or editing based on an earlier interaction_id;
  • video extension;
  • Base64, inline_data, or multipart file uploads;
  • custom resolution, width, or height.

Request Parameters

Top-Level Parameters

ParameterTypeRequiredDescription
modelstringYesMust be gemini-omni-flash-preview.
inputstring / object / arrayYesPrompt and optional public image or video URLs.
response_formatobjectYesOutput type and aspect ratio.
generation_configobjectRecommendedVideo generation settings. Pass it explicitly for predictable results.
timeout_secondsintegerNoMaximum time the server waits for a result. Default: 300. This is not the video duration.

POST /v1beta/interactions waits for generation to finish before returning. Set the client-side HTTP timeout higher than timeout_seconds; use 600 seconds or more for reference-video requests.

response_format

ParameterTypeRequiredSupported valuesDefault
typestringYesvideoNone
aspect_ratiostringNo16:9, 9:1616:9
  • 16:9 creates a landscape video.
  • 9:16 creates a portrait video.

generation_config.video_config

ParameterTypeRequiredSupported valuesDescription
taskstringRecommendedtext_to_video, image_to_video, reference_to_videoPass explicitly so the requested input mode is unambiguous.
resolutionstringNo720pThe only supported resolution. Default: 720p.
duration_secondsintegerNo4, 6, 8, 10Requested duration. Default: 4.

When a request includes a video reference, the model may choose the final duration based on that reference. duration_seconds does not guarantee the exact output duration in that case. Inspect the returned video file when exact duration matters.

Task And Asset Combinations

taskImagesVideosAllowed input
text_to_video00Prompt only
image_to_video10Exactly one image
reference_to_video0-70-1Images, multiple images, one video, or images plus one video; at least one asset is required

If task is omitted, the API infers it from the supplied assets:

  • no image or video: text_to_video;
  • exactly one image: image_to_video;
  • multiple images or any video: reference_to_video.

For stable production behavior, always pass task explicitly.

Input Formats

Text

For text-to-video generation, input can be a string:

{
"input": "A paper boat sailing through a neon city during heavy rain."
}

Content Array

The array format is the clearest option and is recommended for requests with reference assets:

{
"input": [
{
"type": "text",
"text": "Animate the subject with a slow cinematic camera push-in."
},
{
"type": "image",
"url": "https://example.com/subject.webp"
},
{
"type": "video",
"url": "https://example.com/motion-reference.mp4"
}
]
}
typeFieldDescription
texttextText prompt
imageurlPublicly accessible image URL
videourlPublicly accessible video URL

Object Shorthand

You can also provide an object with URL fields:

{
"input": {
"text": "Use the references to create one cohesive cinematic shot.",
"image_urls": [
"https://example.com/character.png",
"https://example.com/environment.jpg"
],
"video_urls": [
"https://example.com/camera-motion.mp4"
]
}
}
FieldTypeDescription
textstringPrompt
image_urlstringOne image URL
image_urlsstring[]Multiple image URLs
video_urlstringOne video URL
video_urlsstring[]Video URL array; currently limited to one video

Prompt And Asset Limits

Prompt

  • Every task should include a non-empty prompt.
  • The maximum prompt length is 20000 characters.
  • Multiple text items are combined in order.
  • Describe the subject, action, camera movement, scene, lighting, pacing, and style.
  • For reference generation, explain the intended role of each asset.

Example:

Use the first image for the character appearance, the second image for the
environment, and the video for camera motion. Create one continuous cinematic
shot with natural movement and consistent lighting.

Images

  • Supported formats: JPEG, PNG, and WEBP.
  • Maximum size: 20 MB per image.
  • Each URL must be directly reachable from the public internet without cookies, login state, or custom headers.
  • Up to seven images are allowed when no video is supplied.
  • image_to_video requires exactly one image.

Video

  • A request can include at most one reference video.
  • Maximum file size: 100 MB.
  • Maximum input duration: 30 seconds.
  • MP4 is recommended for broad compatibility.
  • The model uses at most the first 10 seconds of the reference.
  • The URL must be directly reachable from the public internet.

Reference Asset Quota

Each image uses one asset unit and each video uses two. The total must not exceed seven:

image count + video count * 2 <= 7
ImagesVideosAllowed
70Yes
51Yes
61No
01Yes
02No

Request Examples

The following examples pass the task and video settings explicitly.

Landscape Text To Video

curl -X POST "https://api.uniall.ai/v1beta/interactions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": "A wide cinematic shot of an astronaut walking through a field of glowing flowers at dusk, gentle wind, slow dolly-in camera movement.",
"response_format": {
"type": "video",
"aspect_ratio": "16:9"
},
"generation_config": {
"video_config": {
"task": "text_to_video",
"resolution": "720p",
"duration_seconds": 6
}
},
"timeout_seconds": 600
}'

Portrait Text To Video

curl -X POST "https://api.uniall.ai/v1beta/interactions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": [
{
"type": "text",
"text": "Vertical fashion film, a model walking through a minimalist white gallery, soft shadows, smooth handheld camera, premium editorial style."
}
],
"response_format": {
"type": "video",
"aspect_ratio": "9:16"
},
"generation_config": {
"video_config": {
"task": "text_to_video",
"resolution": "720p",
"duration_seconds": 10
}
},
"timeout_seconds": 600
}'

Image To Video

curl -X POST "https://api.uniall.ai/v1beta/interactions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": [
{
"type": "image",
"url": "https://example.com/portrait.webp"
},
{
"type": "text",
"text": "Keep the character appearance consistent. Add subtle breathing and blinking, hair moving gently in the wind, and a slow camera push-in."
}
],
"response_format": {
"type": "video",
"aspect_ratio": "9:16"
},
"generation_config": {
"video_config": {
"task": "image_to_video",
"resolution": "720p",
"duration_seconds": 4
}
},
"timeout_seconds": 600
}'

Multiple Image References

curl -X POST "https://api.uniall.ai/v1beta/interactions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": {
"text": "Use the first image for the character, the second for clothing, and the third for the environment. Create one continuous shot of the character entering the cafe and looking toward the camera.",
"image_urls": [
"https://example.com/character.png",
"https://example.com/outfit.jpg",
"https://example.com/cafe.webp"
]
},
"response_format": {
"type": "video",
"aspect_ratio": "16:9"
},
"generation_config": {
"video_config": {
"task": "reference_to_video",
"resolution": "720p",
"duration_seconds": 8
}
},
"timeout_seconds": 600
}'

One Video Reference

curl -X POST "https://api.uniall.ai/v1beta/interactions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": [
{
"type": "video",
"url": "https://example.com/dance-motion.mp4"
},
{
"type": "text",
"text": "Create a cinematic dancer performance using the reference for body movement and rhythm. Use dramatic blue stage lighting and a slowly orbiting camera."
}
],
"response_format": {
"type": "video",
"aspect_ratio": "16:9"
},
"generation_config": {
"video_config": {
"task": "reference_to_video",
"resolution": "720p",
"duration_seconds": 8
}
},
"timeout_seconds": 600
}'

Mixed Image And Video References

curl -X POST "https://api.uniall.ai/v1beta/interactions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": {
"text": "Use the character image for appearance, the city image for the environment, and the video for camera motion. Keep the character identity and clothing consistent throughout the shot.",
"image_urls": [
"https://example.com/character.png",
"https://example.com/night-city.jpg"
],
"video_urls": [
"https://example.com/camera-reference.mp4"
]
},
"response_format": {
"type": "video",
"aspect_ratio": "16:9"
},
"generation_config": {
"video_config": {
"task": "reference_to_video",
"resolution": "720p",
"duration_seconds": 10
}
},
"timeout_seconds": 600
}'

Python

import requests

api_url = "https://api.uniall.ai/v1beta/interactions"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"model": "gemini-omni-flash-preview",
"input": [
{
"type": "image",
"url": "https://example.com/product.png",
},
{
"type": "text",
"text": (
"Create a premium product film with a slow 360-degree camera "
"move, soft studio reflections, and a dark background."
),
},
],
"response_format": {
"type": "video",
"aspect_ratio": "16:9",
},
"generation_config": {
"video_config": {
"task": "image_to_video",
"resolution": "720p",
"duration_seconds": 6,
}
},
"timeout_seconds": 600,
}

response = requests.post(
api_url,
headers=headers,
json=payload,
timeout=660,
)
response.raise_for_status()

result = response.json()
print(result["interaction_id"])
print(result["response"]["video"]["uri"])

JavaScript

const response = await fetch("https://api.uniall.ai/v1beta/interactions", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gemini-omni-flash-preview",
input: "A tiny red train crossing a snowy mountain bridge at sunrise.",
response_format: {
type: "video",
aspect_ratio: "16:9",
},
generation_config: {
video_config: {
task: "text_to_video",
resolution: "720p",
duration_seconds: 4,
},
},
timeout_seconds: 600,
}),
});

const result = await response.json();
if (!response.ok) {
throw new Error(result.error?.message ?? "Video generation failed");
}

console.log(result.interaction_id);
console.log(result.response.video.uri);

Success Response

A successful request returns a Gemini Interactions-style response:

{
"interaction_id": "task_xxx",
"model": "gemini-omni-flash-preview",
"response": {
"video": {
"uri": "https://api.uniall.ai/media/generated-video.mp4"
}
}
}
FieldDescription
interaction_idUnique generation ID that can be used to query the result
modelPublic model name used for the request
response.video.uriGenerated video URL

Download and store the generated result promptly. Do not assume that the video URL remains available indefinitely.

Task Status And Result

POST /v1beta/interactions normally waits for the interaction result. When a follow-up query is needed, save interaction_id and call GET /v1/videos/generations/{interaction_id} instead of the default task route. See Video Generation Overview for the shared terminal statuses, error contract, and result fields.

Errors And Troubleshooting

Errors use a consistent structure:

{
"error": {
"code": 400,
"message": "`duration_seconds` must be one of 4, 6, 8, or 10",
"status": "INVALID_ARGUMENT"
}
}
HTTP statuserror.statusMeaning
400INVALID_ARGUMENTInvalid parameter, asset count, or task mode
400FAILED_PRECONDITIONRequest did not pass safety checks
401UNAUTHENTICATEDMissing or invalid API key
404NOT_FOUNDModel or query ID does not exist
429RESOURCE_EXHAUSTEDRequest rate is too high
503UNAVAILABLEService is temporarily unavailable
504DEADLINE_EXCEEDEDNo result was returned within timeout_seconds

Billing Notes

Pricing and billing rules can change. Use the current model price and usage records shown in the UniAll.ai console as the source of truth. Keep the interaction_id when reconciling a request or contacting support.

Recommendations

  • Pass task, resolution, duration_seconds, and aspect_ratio explicitly.
  • Use HTTPS asset URLs and verify that each URL downloads without authentication.
  • Set the client HTTP timeout 30-60 seconds higher than timeout_seconds.
  • Treat the output file as the source of truth for the duration of video-reference results.
  • Explain the role of every asset in the prompt for reference-generation requests.
  • Retry 429 and 503 responses with exponential backoff.
  • Never expose an API key in logs, frontend code, or a public repository.