Gemini Omni Flash Video API
Gemini Omni Flash is a high-performance multimodal model for fast video generation, editing, and cinematic control. It can use text, images, audio, and video together, supports conversational editing through the Interactions API, and can apply Gemini world knowledge to physical scenes and storytelling.
Calling Method
Endpoint and Authentication
Use these Interactions endpoints to create requests or retrieve results:
POST https://api.exchangetoken.ai/v1beta/interactions
GET https://api.exchangetoken.ai/v1beta/interactions/{id}Use your Exchange Token API key in either of the following authentication headers:
x-goog-api-key: YOUR_API_KEYAuthorization: Bearer YOUR_API_KEYContent-Type Header:
Content-Type: application/jsonRequest Body
The request body follows the Vertex AI Interactions API create schema. The examples below use these common fields:
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name. Text and video editing examples use gemini-omni-flash-preview; set $MODEL in image examples to the model you are calling. |
previous_interaction_id | string | No | The previous interaction's id, used to continue editing a generated video. |
input | string, content object, or content array | Yes | Main interaction input. Use a string for text-to-video, or an array for multimodal image/video editing input. |
input[].type | string | Conditional | Content item type, such as text, image, video, or user_input. |
input[].text | string | Conditional | Text prompt when type is text. |
input[].data | string | Conditional | Base64 image content. Videos use uri and do not accept Base64 data. |
input[].uri | string | Conditional | Media file address. |
input[].mime_type | string | Conditional | MIME type for media inputs, such as image/jpeg, image/png, or video/mp4. |
input[].content | array | Conditional | Nested content array when using a user_input wrapper. |
background | boolean | No | Run in the background; defaults to false. |
store | boolean | No | Defaults to true. |
stream | boolean | No | Return SSE events; defaults to false. |
response_format | object or array | No | Output format options. Examples use an object; for an array, configure each output item. |
response_format.type | string | No | Set to video for video output. |
response_format.delivery | string | No | Delivery mode. Examples use uri to receive a video link. |
response_format.aspect_ratio | string | No | Video aspect ratio: 16:9 or 9:16. |
response_format.resolution | string | No | Output resolution, such as 720p. |
response_format.duration | string | No | Video duration, such as 5s; include the number and unit in one string. |
response_format.gcs_uri | string | Omit | The platform supplies storage for video URI output. |
generation_config | object | No | Generation options. |
generation_config.video_config.task | string | No | Optional video task hint. Values include text_to_video, image_to_video, reference_to_video, edit, and extend; follow the selected model's parameter constraints. |
TIP
To receive a video link, set both response_format.type: video and response_format.delivery: uri, and omit gcs_uri. The platform allocates output storage and converts storage URIs in model output to signed download links.
Response Body
Common fields:
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the interaction |
object | string | Resource type identifier, typically interaction |
status | string | Current interaction status, such as in_progress, completed, or failed |
role | string | Role associated with the response payload, typically model |
created | string | Interaction creation time in ISO 8601 format |
updated | string | Last interaction update time in ISO 8601 format |
model | string | Name of the model used for the interaction |
steps | array | Ordered step objects returned by the interaction |
usage | object | Token usage summary for the interaction when provided by upstream |
Common steps fields:
| Field | Type | Description |
|---|---|---|
type | string | Step type, for example model_output |
content | array | Content items carried by the step |
content[].uri | string | Video download URL; read it from a type: model_output step |
Example:
{
"id": "v1_...",
"status": "completed",
"role": "model",
"created": "2026-05-27T06:15:03Z",
"updated": "2026-05-27T06:15:03Z",
"steps": [
{
"content": [
{
"text": "",
"type": "text"
}
],
"type": "model_output"
},
{
"content": [
{
"mime_type": "video/mp4",
"uri": "https://storage.googleapis.com/example-bucket/output.mp4?X-Goog-Signature=EXAMPLE",
"type": "video"
}
],
"type": "model_output"
}
],
"object": "interaction",
"model": "gemini-omni-flash-preview"
}Get an Input Video URI
Video input must be provided through uri and only supports Google Cloud Storage addresses (gs://...). Base64 video input is not supported. If you have a publicly accessible gs:// address, use it directly. Otherwise, use the platform's Google Cloud Storage upload feature: follow the steps below to upload the video and use the returned gcs_uri as the input URI.
Get an Upload URL
Call the upload URL endpoint with your Exchange Token API key. The request body accepts only an optional filename to specify the file name.
curl --fail-with-body -sS -X POST "https://api.exchangetoken.ai/v1/storage/upload-urls" \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"filename":"source.mp4"}' \
-o upload.jsonExample response:
{
"upload_url": "https://storage.googleapis.com/BUCKET/uploads/.../source.mp4?X-Goog-...",
"gcs_uri": "gs://BUCKET/uploads/.../source.mp4",
"expires_at": "2026-10-14T00:00:00Z",
"method": "PUT",
"headers": {}
}Use upload_url to upload the file and set the video input's uri field in the Interactions API to gcs_uri. The upload link is valid for 24 hours; check expires_at for its exact expiry. This request only allocates an upload URL; the video file still needs to be uploaded.
Upload a Local Video
Read the addresses from upload.json and upload the local file with PUT. The example uses Bash, curl, and jq.
VIDEO_FILE="./source.mp4"
UPLOAD_URL=$(jq -er '.upload_url' upload.json)
VIDEO_URI=$(jq -er '.gcs_uri' upload.json)
curl --fail-with-body -sS -X PUT "$UPLOAD_URL" \
--upload-file "$VIDEO_FILE"After upload, $VIDEO_URI can be used as the uri of a video content item in an Interactions API request.
Text to Video
Generate a video with audio from a text prompt. For best results, describe the scene, camera movement, lighting, mood, and key actions.
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": "A marble rolling fast on a chain reaction style track, continuous smooth shot.",
"response_format": { "type": "video", "delivery": "uri" }
}'Control Aspect Ratio
Set response_format.aspect_ratio to 9:16 for portrait video or 16:9 for landscape video.
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": "A futuristic city with neon lights and flying cars, cyberpunk style",
"response_format": {
"type": "video",
"delivery": "uri",
"aspect_ratio": "9:16"
}
}'Image to Video
Put images and the text prompt in the same input array. Set $MODEL to the model you are calling and $BASE64_IMAGE to the image content encoded as Base64.
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "'"$MODEL"'",
"input": [
{ "type": "image", "data": "'"$BASE64_IMAGE"'", "mime_type": "image/jpeg" },
{ "type": "text", "text": "turn this into realistic footage, using the drawing only as a guide for movement, do not show the drawing in the final video" }
],
"response_format": { "type": "video", "delivery": "uri" }
}'TIP
Images can also reference uploaded files through uri. For data, supply plain Base64 content and a mime_type matching the file.
Subject Reference
Put multiple reference images in the input array and describe the role of each image in the prompt.
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "'"$MODEL"'",
"input": [
{ "type": "image", "data": "'"$CAT_B64"'", "mime_type": "image/png" },
{ "type": "image", "data": "'"$YARN_B64"'", "mime_type": "image/png" },
{ "type": "text", "text": "A cat playfully batting at a ball of yarn." }
],
"response_format": { "type": "video", "delivery": "uri" }
}'Task Parameter
Use generation_config.video_config.task to specify a task mode. The gateway forwards this field; when omitted, the model determines the task from the prompt and input media. See the Vertex AI VideoConfig definition.
Parameter values (follow the selected model's constraints):
text_to_videoimage_to_videoreference_to_videoeditextend
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "'"$MODEL"'",
"input": [
{ "type": "image", "data": "'"$BASE64_IMAGE"'", "mime_type": "image/jpeg" },
{ "type": "text", "text": "turn this into realistic footage, using the drawing only as a guide for movement, do not show the drawing in the final video" }
],
"generation_config": {
"video_config": {
"task": "image_to_video"
}
},
"response_format": { "type": "video", "delivery": "uri" }
}'Edit Your Own Videos
Submit the edit with $VIDEO_URI ready. See Get an Input Video URI for how to obtain the address.
curl -sS -w "\n[HTTP %{http_code}]\n" "https://api.exchangetoken.ai/v1beta/interactions" \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": [
{
"type": "user_input",
"content": [
{
"type": "video",
"mime_type": "video/mp4",
"uri": "'"$VIDEO_URI"'"
},
{
"type": "text",
"text": "When the person touches the mirror, make the mirror ripple beautifully like liquid, and the person arm turns into reflective mirror material"
}
]
}
],
"generation_config": { "video_config": { "task": "edit" } },
"response_format": { "type": "video", "delivery": "uri" }
}'Multi-turn Editing
After the previous turn completes, previous_interaction_id references that interaction and input provides the new editing instructions. Subsequent requests must use the same API key and model.
When using previous_interaction_id, omit generation_config.video_config.task and describe the edits in input to avoid an upstream parameter conflict error.
PREVIOUS_INTERACTION_ID="YOUR_INTERACTION_ID"
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"previous_interaction_id": "'"$PREVIOUS_INTERACTION_ID"'",
"input": "Keep the subject and camera motion unchanged, and change the background to a snowy mountain.",
"response_format": { "type": "video", "delivery": "uri" }
}'Background Generation and Retrieval
background: true enables background execution. Creation and retrieval requests must use the same API key for authentication.
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash-preview",
"input": "A paper boat drifts across a quiet pond in soft morning light.",
"background": true,
"response_format": { "type": "video", "delivery": "uri" }
}'GET /v1beta/interactions/{id} retrieves the task status and result. The {id} path parameter is the interaction identifier returned by the creation request.
INTERACTION_ID="YOUR_INTERACTION_ID"
curl --fail-with-body -sS "https://api.exchangetoken.ai/v1beta/interactions/$INTERACTION_ID" \
-H "x-goog-api-key: $API_KEY" \
-o result.jsonThe response field status indicates the task state:
| Status | Description |
|---|---|
in_progress | The task is running and can be polled periodically. |
completed | The task has completed; generated results are available in steps. |
failed | The task has failed; error details are included in the response. |
incomplete | The task did not complete fully; details are included in the response. |
