# Gemini Omni 1.2 Flash API Complete API reference for Google Gemini Omni 1.2 Flash video generation models. ## Model Variants This API supports four model variants: | Model | ID | Description | |-------|-----|-------------| | **Gemini Omni 1.2 Flash Text to Video** | `gemini-omni-1.2-flash-text-to-video` | Generate videos from text prompts | | **Gemini Omni 1.2 Flash Image to Video** | `gemini-omni-1.2-flash-image-to-video` | Animate a required start image with optional end-frame guidance | | **Gemini Omni 1.2 Flash Video Edit** | `gemini-omni-1.2-flash-video-edit` | Apply prompt-guided changes to an existing video | | **Gemini Omni 1.2 Flash Reference to Video** | `gemini-omni-1.2-flash-reference-to-video` | Generate videos from image references, video references, or both | ## Quick Comparison | Feature | Text to Video | Image to Video | Video Edit | Reference to Video | |---------|---------------|----------------|------------|--------------------| | Primary Input | Text prompt | Start image + Text prompt | Source video + Text prompt | Text prompt + At least one image or video reference | | Duration | 3-15 seconds | 3-15 seconds; 3-10 with an end frame | Source video must be no longer than 10 seconds | 3-15 seconds | | Resolution Options | 360p, 720p, 1080p, 4k | 360p, 720p, 1080p, 4k | 360p, 720p, 1080p, 4k | 360p, 720p, 1080p, 4k | | Aspect Ratios | 16:9, 9:16 | 16:9, 9:16 | Not supported | 16:9, 9:16 | | Optional Inputs | None | End image | None | Up to 10 images and 3 videos; at least one reference required | ## Shared Endpoint All Gemini Omni 1.2 Flash variants use the video task endpoint: ``` POST /api/v1/video/task ``` ## Gemini Omni 1.2 Flash Text to Video ### Required Parameters | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be `"gemini-omni-1.2-flash-text-to-video"` | | `prompt` | string | Text description of the video to generate | | `aspect_ratio` | string | Output aspect ratio: `"16:9"` or `"9:16"` | | `resolution` | string | Output resolution: `"360p"`, `"720p"`, `"1080p"`, or `"4k"` | | `duration` | integer | Output duration in seconds, from 3 to 15 | ### Example Request ```javascript const response = await fetch('https://api.flaq.ai/api/v1/video/task', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ model_name: 'gemini-omni-1.2-flash-text-to-video', prompt: 'A cinematic tracking shot follows a sailboat crossing a glowing ocean at sunset', aspect_ratio: '16:9', resolution: '1080p', duration: 12 }) }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Gemini Omni 1.2 Flash Image to Video ### Required Parameters | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be `"gemini-omni-1.2-flash-image-to-video"` | | `prompt` | string | Text description of the desired motion and scene development | | `image_url` | string | URL of the required start-frame image | | `aspect_ratio` | string | Output aspect ratio: `"16:9"` or `"9:16"` | | `resolution` | string | Output resolution: `"360p"`, `"720p"`, `"1080p"`, or `"4k"` | | `duration` | integer | Output duration in seconds, from 3 to 15 without an end frame, or from 3 to 10 when `image_end_url` is provided | ### Optional Parameters | Parameter | Type | Description | |-----------|------|-------------| | `image_end_url` | string | URL of an optional end-frame image. When provided, `duration` must be from 3 to 10 seconds | ### Example Request ```javascript { model_name: 'gemini-omni-1.2-flash-image-to-video', prompt: 'The girl walks toward the camera while the city lights shimmer behind her', image_url: 'https://example.com/start-frame.jpg', image_end_url: 'https://example.com/end-frame.jpg', aspect_ratio: '9:16', resolution: '1080p', duration: 8 } ``` ## Gemini Omni 1.2 Flash Video Edit ### Required Parameters | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be `"gemini-omni-1.2-flash-video-edit"` | | `prompt` | string | Text instructions describing the edit to apply | | `video_url` | string | URL of the source video. The source video must be no longer than 10 seconds | | `resolution` | string | Output resolution: `"360p"`, `"720p"`, `"1080p"`, or `"4k"` | **Note:** Video Edit does not support `aspect_ratio` or `duration`. Do not include either parameter in the request. ### Example Request ```javascript { model_name: 'gemini-omni-1.2-flash-video-edit', prompt: 'A small ball rolls into the scene and captures the attention of the cat', video_url: 'https://example.com/source-video.mp4', resolution: '1080p' } ``` ## Gemini Omni 1.2 Flash Reference to Video Reference images and videos may be used separately or together. At least one reference image or video must be provided in `images` or `videos`. ### Required Parameters | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be `"gemini-omni-1.2-flash-reference-to-video"` | | `prompt` | string | Text description of the video to generate | | `aspect_ratio` | string | Output aspect ratio: `"16:9"` or `"9:16"` | | `resolution` | string | Output resolution: `"360p"`, `"720p"`, `"1080p"`, or `"4k"` | | `duration` | integer | Output duration in seconds, from 3 to 15 | ### Optional Reference Inputs | Parameter | Type | Description | |-----------|------|-------------| | `images` | string[] | Up to 10 reference image URLs. Optional when video references are provided | | `videos` | string[] | Up to 3 reference video URLs. Each video must be no longer than 3 seconds. Optional when image references are provided | ### Example Request ```javascript { model_name: 'gemini-omni-1.2-flash-reference-to-video', prompt: 'Use the references to create a cinematic shot of a small boat approaching from the distance', aspect_ratio: '16:9', resolution: '1080p', duration: 12, images: ['https://example.com/boat-reference.jpg'], videos: ['https://example.com/motion-reference.mp4'] } ``` ## Response Format ### Initial Response All models return a `task_id` for polling: ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "submitted" } } ``` ### Polling Response Poll `GET /api/v1/video/{taskId}` to check status: ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "succeed", "task_status_msg": null, "task_result": { "credit": 0.2, "videos": [ { "url": "https://example.com/generated-video.mp4" } ] } } } ``` ### Status Values - `submitted`: Task accepted and waiting to be processed - `processing`: Video generation in progress - `succeed`: Video generation completed - `failed`: Video generation failed ## Best Practices 1. **Prompt Direction**: Describe subjects, actions, camera movement, lighting, and scene progression clearly. 2. **Required Settings**: Always provide a supported resolution and, except for Video Edit, a supported aspect ratio and duration. 3. **Image Inputs**: Use stable, publicly accessible URLs for start, end, and reference images. When providing an end-frame image, keep `duration` between 3 and 10 seconds. 4. **Video Edit Input**: Verify that the source video is no longer than 10 seconds before submitting it. 5. **Reference Limits**: Provide at least one reference image or video. Submit no more than 10 images and 3 videos, and keep every reference video at or below 3 seconds.