How to Use the Gemini Omni API: Step-by-Step (2026)

How to use the Gemini Omni Flash API in 15 minutes. Full Python and Node.js code for text-to-video and image-to-video via Atlas Cloud. Pricing: from USD1.00 per clip.

TL;DR: This tutorial shows you how to use the Gemini Omni Flash API to generate videos from text prompts and reference images. Using the Atlas Cloud unified API, you will have a working video generation script in approximately 15 minutes. No Google account approval is required — only an Atlas Cloud API key.

Google's official Gemini API quickstart does not cover Gemini Omni Flash specifically. This tutorial uses Atlas Cloud's unified API endpoint, which provides direct access to Gemini Omni Flash without a separate Google AI Studio application.

developer editorial style terminal

A thread on r/GeminiAI titled "Gemini Omni Flash API access: 5 providers tested, ranked by use case" surfaced six days ago and quickly became the go-to reference for developers evaluating their options. The top comment cut straight to the point: Google AI Studio is the fastest way to start, but you hit rate limits quickly. Developers looking for a production-ready path need a different entry point.

Gemini Omni Flash is Google's multimodal video generation model that accepts any combination of text, images, audio, and video as input. It generates cinematic videos up to 10 seconds long at resolutions from 720p to 4K. This tutorial shows you how to use the Gemini Omni Flash API through Atlas Cloud, which provides a unified API endpoint, pay-as-you-go pricing, and no rate limits tied to a Google account.

This tutorial covers the Gemini Omni API for 2 generation modes: Text-to-Video and Image-to-Video. All code examples are tested against the live Atlas Cloud API.

Gemini Omni Flash API Prerequisites

You will need:

  • Python 3.9+ or Node.js 18+
  • An Atlas Cloud account and API key (free to sign up)
  • The requests library for Python, or axios for Node.js
  • Basic familiarity with REST APIs
  • Approximately 15 minutes to complete

Tested on: macOS 14, Ubuntu 22.04, Windows 11 (WSL2)

Pricing reference (sourced from Atlas Cloud pricing, 2026-06-02):

  • 720p / 1080p: $0.20 base + $0.10 per second. An 8-second 720p video costs $1.00.
  • 4K: $1.00 base + $0.10 per second. An 8-second 4K video costs $1.80.

What We Are Building with the Gemini Omni API

By the end of this tutorial, you will have two working scripts: one that generates a video from a text prompt, and one that animates a reference image into a video. Both scripts share the same authentication and polling logic. The architecture is straightforward:

plaintext
1Your Script → Atlas Cloud API → Gemini Omni Flash → Video URL
2               (auth + queue)     (generation)      (output)

What the finished scripts do:

  • Submit a generation request and receive a prediction_id
  • Poll the status endpoint every 3 seconds until the video is ready
  • Print the output video URL when generation completes

Step 1: Get Your API Key for Gemini Omni Flash

In this step, you will create an Atlas Cloud account and generate an API key so your scripts can authenticate with the Gemini Omni Flash API.

  1. Go to atlascloud.ai and sign up for a free account.
  2. In the dashboard, navigate to API Keys.
  3. Click Create new key, copy the key, and store it securely.

Set the key as an environment variable so you do not hard-code it in your scripts:

plaintext
1# macOS / Linux
2export ATLASCLOUD_API_KEY="your_api_key_here"
3
4# Windows (PowerShell)
5$env:ATLASCLOUD_API_KEY="your_api_key_here"

Verify it is set correctly:

plaintext
1echo $ATLASCLOUD_API_KEY

Expected output:

plaintext
1your_api_key_here

Watch out: Never commit your API key to version control. Add ATLASCLOUD_API_KEY to your .gitignore via a .env file if you use python-dotenv or dotenv for Node.js.

Step 2: Make Your First Gemini Omni Flash API Request

In this step, you will submit a Text-to-Video request to the Gemini Omni Flash API and receive a prediction_id to track the job.

The endpoint for all video generation on Atlas Cloud is:

plaintext
1POST https://api.atlascloud.ai/api/v1/model/generateVideo

The model identifier for Gemini Omni Flash Text-to-Video is:

plaintext
1google/gemini-omni-flash/text-to-video-developer

Python

plaintext
1# gemini_omni_t2v.py
2import requests
3import os
4
5API_KEY = os.environ["ATLASCLOUD_API_KEY"]
6BASE_URL = "https://api.atlascloud.ai/api/v1/model"
7
8headers = {
9    "Content-Type": "application/json",
10    "Authorization": f"Bearer {API_KEY}"
11}
12
13payload = {
14    "model": "google/gemini-omni-flash/text-to-video-developer",
15    "prompt": "A young woman walks slowly through a rainy Tokyo street at night, neon reflections on wet pavement, cinematic slow motion, realistic lighting, 4K, film grain",
16    "duration": 8,          # seconds: 4, 6, 8, or 10
17    "aspect_ratio": "16:9", # "16:9" or "9:16"
18    "resolution": "1080p",  # "720p", "1080p", or "4k"
19    "seed": -1              # -1 for random; set an integer for reproducible output
20}
21
22response = requests.post(f"{BASE_URL}/generateVideo", headers=headers, json=payload)
23response.raise_for_status()
24
25prediction_id = response.json()["data"]["id"]
26print(f"Job submitted. Prediction ID: {prediction_id}")

Node.js

plaintext
1// geminiOmniT2V.js
2const axios = require("axios");
3
4const API_KEY = process.env.ATLASCLOUD_API_KEY;
5const BASE_URL = "https://api.atlascloud.ai/api/v1/model";
6
7const headers = {
8  "Content-Type": "application/json",
9  Authorization: `Bearer ${API_KEY}`,
10};
11
12const payload = {
13  model: "google/gemini-omni-flash/text-to-video-developer",
14  prompt:
15    "A young woman walks slowly through a rainy Tokyo street at night, neon reflections on wet pavement, cinematic slow motion, realistic lighting, 4K, film grain",
16  duration: 8,
17  aspect_ratio: "16:9",
18  resolution: "1080p",
19  seed: -1,
20};
21
22axios
23  .post(`${BASE_URL}/generateVideo`, payload, { headers })
24  .then((res) => {
25    const predictionId = res.data.data.id;
26    console.log(`Job submitted. Prediction ID: ${predictionId}`);
27  })
28  .catch((err) => console.error(err.response?.data || err.message));

Expected output:

plaintext
1Job submitted. Prediction ID: pred_abc123xyz

Watch out: The API returns a prediction_id immediately. The video is not ready yet. You must poll the status endpoint in Step 3 to retrieve the output URL.

Step 3: Poll for the Gemini Omni Flash Video Result

In this step, you will query the status endpoint repeatedly until the video generation completes and the output URL is available.

Video generation with Gemini Omni Flash is asynchronous. Typical completion time is 30 seconds to 3 minutes depending on resolution and server load. The status endpoint is:

plaintext
1GET https://api.atlascloud.ai/api/v1/model/prediction/{prediction_id}

Possible status values: processing, completed, succeeded, failed.

Python

plaintext
1# poll_result.py
2import requests
3import time
4import os
5
6API_KEY = os.environ["ATLASCLOUD_API_KEY"]
7BASE_URL = "https://api.atlascloud.ai/api/v1/model"
8
9headers = {
10    "Authorization": f"Bearer {API_KEY}"
11}
12
13def poll_video(prediction_id: str, timeout: int = 360) -> str:
14    """Poll until the video is ready, then return the output URL."""
15    elapsed = 0
16    while elapsed < timeout:
17        response = requests.get(
18            f"{BASE_URL}/prediction/{prediction_id}",
19            headers=headers
20        )
21        response.raise_for_status()
22        data = response.json()["data"]
23        status = data["status"]
24
25        if status in ("completed", "succeeded"):
26            video_url = data["outputs"][0]
27            print(f"Video ready: {video_url}")
28            return video_url
29
30        if status == "failed":
31            raise RuntimeError(f"Generation failed: {data}")
32
33        print(f"Status: {status} — waiting 3 seconds...")
34        time.sleep(3)
35        elapsed += 3
36
37    raise TimeoutError(f"Generation did not complete within {timeout} seconds.")
38
39# Replace with your actual prediction_id from Step 2
40video_url = poll_video("pred_abc123xyz")

Node.js

plaintext
1// pollResult.js
2const axios = require("axios");
3
4const API_KEY = process.env.ATLASCLOUD_API_KEY;
5const BASE_URL = "https://api.atlascloud.ai/api/v1/model";
6const headers = { Authorization: `Bearer ${API_KEY}` };
7
8async function pollVideo(predictionId, timeoutMs = 360000) {
9  const start = Date.now();
10  while (Date.now() - start < timeoutMs) {
11    const res = await axios.get(`${BASE_URL}/prediction/${predictionId}`, { headers });
12    const data = res.data.data;
13
14    if (data.status === "completed" || data.status === "succeeded") {
15      console.log("Video ready:", data.outputs[0]);
16      return data.outputs[0];
17    }
18    if (data.status === "failed") throw new Error(`Generation failed: {JSON.stringify(data)}`);
19
20    console.log(`Status: ${data.status} — waiting 3 seconds...`);
21    await new Promise((r) => setTimeout(r, 3000));
22  }
23  throw new Error("Generation timed out.");
24}
25
26pollVideo("pred_abc123xyz");

Expected output:

plaintext
1Status: processing — waiting 3 seconds...
2Status: processing — waiting 3 seconds...
3Video ready: https://storage.atlascloud.ai/outputs/result.mp4

Set your polling interval to 3 seconds rather than 1 second. Polling every second adds unnecessary API calls without meaningfully reducing wait time, since Gemini Omni Flash jobs rarely complete in under 30 seconds at 1080p.

Watch out: Output videos are stored on Atlas Cloud servers for 48 hours. Download the file to your own storage immediately after generation if you need to keep it.

Step 4: Image-to-Video with the Gemini Omni Flash API

In this step, you will upload a local image to Atlas Cloud and use it as a reference for Image-to-Video generation with the Gemini Omni Flash api.

Image-to-Video generation uses the same endpoint but requires a different model ID and an

text
1images
array. The model identifier is:

plaintext
1google/gemini-omni-flash/image-to-video-developer

Gemini Omni Flash Image-to-Video accepts 1 to 7 reference images (PNG, JPEG, JPG, or WebP; maximum 20 MB each, minimum 128×128 px). It preserves visual identity across the generated video, keeping characters and objects consistent throughout.

the video of showing a person is moving

Step 4a: Upload your image

plaintext
1# upload_image.py
2import requests
3import os
4
5API_KEY = os.environ["ATLASCLOUD_API_KEY"]
6UPLOAD_URL = "https://api.atlascloud.ai/api/v1/model/uploadMedia"
7
8headers = {"Authorization": f"Bearer {API_KEY}"}
9
10with open("reference.jpg", "rb") as f:
11    response = requests.post(UPLOAD_URL, headers=headers, files={"file": f})
12
13response.raise_for_status()
14image_url = response.json()["data"]["url"]
15print(f"Uploaded image URL: {image_url}")

Step 4b: Submit the Image-to-Video request

plaintext
1# gemini_omni_i2v.py
2import requests
3import os
4
5API_KEY = os.environ["ATLASCLOUD_API_KEY"]
6BASE_URL = "https://api.atlascloud.ai/api/v1/model"
7
8headers = {
9    "Content-Type": "application/json",
10    "Authorization": f"Bearer {API_KEY}"
11}
12
13payload = {
14    "model": "google/gemini-omni-flash/image-to-video-developer",
15    "prompt": "The character walks forward slowly, natural lighting, cinematic depth of field",
16    "images": [image_url],  # use the URL returned in Step 4a
17    "duration": 8,
18    "aspect_ratio": "16:9",
19    "resolution": "1080p",
20    "seed": -1
21}
22
23response = requests.post(f"{BASE_URL}/generateVideo", headers=headers, json=payload)
24response.raise_for_status()
25
26prediction_id = response.json()["data"]["id"]
27print(f"Job submitted. Prediction ID: {prediction_id}")
28# Then poll using the poll_video() function from Step 3

For best results with Gemini Omni Flash Image-to-Video, use a clean, well-lit reference image with a neutral or simple background. The model preserves facial and clothing details more consistently when the subject is clearly separated from the background. Images with complex patterns or heavy post-processing tend to produce inconsistent output across frames.

Watch out: Accepted image formats are PNG, JPEG, JPG, and WebP only. Files larger than 20 MB will be rejected with a 400 error.

Step 5: Switch Models with One Parameter Change

One of the practical advantages of accessing the gemini omni api through Atlas Cloud is that every video generation model on the platform shares the same endpoint and polling logic. Switching from Gemini Omni Flash to another model requires only a model parameter change.

plaintext
1# Switch to Seedance 2.0 Text-to-Video (priced at $0.096/s on Atlas Cloud)
2payload["model"] = "bytedance/seedance-2-0/text-to-video"
3
4# Switch to Veo 3.1 Lite
5payload["model"] = "google/veo-3-1/lite-text-to-video"

This makes A/B testing across models straightforward. You can run the same prompt through multiple models and compare output quality before committing to a specific model for production.

Gemini Omni Flash API Troubleshooting

Here are the five most common issues when using the Gemini Omni Flash API and how to resolve them.

ProblemSymptomSolution
401 Unauthorized{"error": "Invalid API key"}Check your ATLASCLOUD_API_KEY environment variable is set and not expired
400 Bad Request{"error": "Invalid prompt"}Prompt likely violates content policy; rephrase or remove restricted content
Task stuck in
text
1processing
No completed status after 6 minutesRetry the request; this is rare but can occur during peak load
Video URL returns 404URL no longer accessibleOutput files expire after 48 hours; download immediately after generation
429 Too Many RequestsRate limit exceededAdd a delay between requests; use exponential backoff on retries

Still stuck? Visit the Atlas Cloud documentation or reach out via the platform's support channel.

Next Steps

Now that you have working Text-to-Video and Image-to-Video scripts, here is how to extend them.

Extend this project:

  • Add Reference-to-Video with audio input using Seedance 2.0, which supports up to 7 reference images combined with an audio track
  • Build a batch generation pipeline that submits multiple prompts in parallel and collects results asynchronously
  • Add a cost estimator to your script: cost = 0.20 + (duration * 0.10) for 720p/1080p

Related resources:

Frequently Asked Questions

What is the Gemini Omni Flash API?

The Gemini Omni Flash API is Google's multimodal video generation interface that accepts any combination of text, images, audio, and video as input and outputs cinematic video clips. It supports durations of 4 to 10 seconds, resolutions from 720p to 4K, and both landscape and portrait aspect ratios. Access it via Atlas Cloud without a separate Google approval process.

How much does the Gemini Omni Flash API cost?

On Atlas Cloud, Gemini Omni Flash is priced at $0.20 base plus $0.10 per second for 720p and 1080p output. A standard 8-second clip at 1080p costs $1.00. For 4K output, the base fee is $1.00 plus $0.10 per second, making an 8-second 4K clip $1.80. All pricing is pay-as-you-go with no minimum spend (Atlas Cloud pricing, 2026-06-02).

What is the difference between Google AI Studio and Atlas Cloud for Gemini Omni Flash API access?

Google AI Studio provides direct access to Gemini models but requires a Google account and is subject to individual usage quotas that can be hit quickly. Atlas Cloud provides the same Gemini Omni Flash model through a unified API endpoint with transparent per-second billing, no approval queue, and access to 300+ other video and image models under the same API key. For production use, Atlas Cloud's unified API removes the need to manage separate credentials per model provider.

How long does Gemini Omni Flash take to generate a video?

Typical generation time for an 8-second 1080p video is 30 seconds to 3 minutes depending on server load. The API is asynchronous: your script submits a job and receives a prediction_id immediately, then polls the status endpoint until the video is ready. Build your timeout handling around a 6-minute upper bound to account for peak load periods.

Can I use the Gemini Omni Flash API for free?

Atlas Cloud offers free credits for new accounts, which you can apply toward Gemini Omni Flash generation. After free credits are exhausted, billing is pay-as-you-go with no subscription required. Sign up at atlascloud.ai to get started.

Latest Models

One API for All Media AI.

Explore all models

Join our Discord community

Join the Discord community for the latest model updates, prompts, and support.