> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini Omni Flash Video Generation

>  - Google's official Gemini Omni Flash all-in-one multimodal video generation model
- Supports Text-to-Video, Image-to-Video, and Video-to-Video (editing), with mixed text + image + video input
- Outputs 720p / 24fps, 3-10 seconds, with audio; supports conversational multi-turn editing
- Asynchronous task API. Submit a task first, then query the result by task ID 

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "gemini-omni-flash-preview",
      "prompt": "a red apple on a wooden table, short cinematic clip",
      "aspect_ratio": "16:9"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.apimart.ai/v1/videos/generations"

  payload = {
      "model": "gemini-omni-flash-preview",
      "prompt": "a red apple on a wooden table, short cinematic clip",
      "aspect_ratio": "16:9"
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://api.apimart.ai/v1/videos/generations";

  const payload = {
    model: "gemini-omni-flash-preview",
    prompt: "a red apple on a wooden table, short cinematic clip",
    aspect_ratio: "16:9"
  };

  const headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload)
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error("Error:", error));
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "io/ioutil"
      "net/http"
  )

  func main() {
      url := "https://api.apimart.ai/v1/videos/generations"

      payload := map[string]interface{}{
          "model":        "gemini-omni-flash-preview",
          "prompt":       "a red apple on a wooden table, short cinematic clip",
          "aspect_ratio": "16:9",
      }

      jsonData, _ := json.Marshal(payload)

      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer <token>")
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": [
      {
        "status": "submitted",
        "task_id": "task_01KS1H7ZYSJWH1N779S2FSHTKA"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "Invalid request parameters",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "Authentication failed. Please check your API key",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "Insufficient account balance. Please recharge and try again",
      "type": "payment_required"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": 429,
      "message": "Too many requests. Please try again later",
      "type": "rate_limit_error"
    }
  }
  ```
</ResponseExample>

## Authentication

<ParamField header="Authorization" type="string" required>
  All requests require Bearer Token authentication.

  Get an API key:

  Visit the [API Key management page](https://apimart.ai/keys) to get your API key.

  Add the following header when making requests:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Request Parameters

<ParamField body="model" type="string" required>
  Video generation model name. Must be `gemini-omni-flash-preview`.
</ParamField>

<ParamField body="prompt" type="string" required>
  Text instruction. For Text-to-Video, it is a scene description; for Image/Video-to-Video, it is an action / style / editing instruction.

  <Note>
    `prompt` and reference materials (`image_urls` / `video_urls`) — **provide at least one of them**.
  </Note>
</ParamField>

<ParamField body="image_urls" type="array<string>">
  Reference images, up to **16**. Each item is an `http(s)://` URL.

  Supports JPEG / PNG. For multiple subjects (e.g. "cat + ball of yarn"), you can pass multiple images and describe how they interact in the `prompt`.
</ParamField>

<ParamField body="video_urls" type="array<string>">
  Reference / video to be edited, **at most 1** (multiple video references are not supported). Can be an `http(s)://` direct link or `data:video/...`.

  <Warning>
    Reference videos are 1-24 seconds; the official recommendation is **≤3 seconds**.
  </Warning>
</ParamField>

<ParamField body="aspect_ratio" type="string" default="16:9">
  Video aspect ratio, which actually controls the output frame orientation.

  Supported values only:

  * `16:9` - landscape (default)
  * `9:16` - portrait

  Other values are treated as `16:9`.
</ParamField>

<ParamField body="resolution" type="string" default="720p">
  Video resolution. Currently only `720p` is supported.
</ParamField>

<ParamField body="extend_from_task_id" type="string">
  Previous task ID: fill in the \*\* `task_id`\*\* of the previous generation task.
</ParamField>

## Response

<ResponseField name="code" type="integer">
  Response status code. Successful requests return `200`.
</ResponseField>

<ResponseField name="data" type="array">
  Returned task array.

  <Expandable title="Array item">
    <ResponseField name="status" type="string">
      Initial task status. It is `submitted` after successful submission.
    </ResponseField>

    <ResponseField name="task_id" type="string">
      Unique task ID for querying task status and result.
    </ResponseField>
  </Expandable>
</ResponseField>

## Query Task Result

Video generation is asynchronous. After submission, the API returns a `task_id`. Use the [Get task status](/en/api-reference/tasks/status) endpoint to query progress and results.

### Successful Result Example

```json theme={null}
{
  "code": 200,
  "data": {
    "id": "task_01KS1H7ZYSJWH1N779S2FSHTKA",
    "status": "completed",
    "progress": 100,
    "created": 1779246294,
    "completed": 1779246334,
    "actual_time": 40,
    "estimated_time": 60,
    "cost": 1.0,
    "credits_cost": 10,
    "result": {
      "videos": [
        {
          "url": ["https://cdn.example.com/gemini_omni_xxx.mp4"],
          "expires_at": 1779332760
        }
      ]
    }
  }
}
```

## Use Cases

### Scenario 1: Text-to-Video

```json theme={null}
{
  "model": "gemini-omni-flash-preview",
  "prompt": "a blue butterfly landing on a flower, macro, soft light",
  "aspect_ratio": "9:16"
}
```

### Scenario 2: Image-to-Video

```json theme={null}
{
  "model": "gemini-omni-flash-preview",
  "prompt": "turn this drawing into realistic footage, use it only as a motion guide",
  "image_urls": ["https://example.com/sketch.jpg"]
}
```

### Scenario 3: Video-to-Video

```json theme={null}
{
  "model": "gemini-omni-flash-preview",
  "prompt": "when the person touches the mirror, make it ripple like liquid",
  "video_urls": ["https://example.com/clip.mp4"]
}
```
