> ## 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 비디오 생성

>  - Google 공식 Gemini Omni Flash 올인원 멀티모달 비디오 생성 모델
- 텍스트-비디오, 이미지-비디오, 비디오-비디오(편집)를 지원하며, 텍스트 + 이미지 + 비디오 입력을 혼합할 수 있습니다
- 720p / 24fps, 3~10초, 오디오 포함 출력. 대화형 다중 턴 편집을 지원합니다
- 비동기 작업 API. 작업을 제출한 뒤 작업 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": "요청 파라미터가 올바르지 않습니다",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "인증에 실패했습니다. API 키를 확인하세요",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "계정 잔액이 부족합니다. 충전 후 다시 시도하세요",
      "type": "payment_required"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": 429,
      "message": "요청이 너무 많습니다. 잠시 후 다시 시도하세요",
      "type": "rate_limit_error"
    }
  }
  ```
</ResponseExample>

## 인증

<ParamField header="Authorization" type="string" required>
  모든 요청은 Bearer Token 인증이 필요합니다.

  API Key 발급:

  [API Key 관리 페이지](https://apimart.ai/keys)에서 API Key를 발급받으세요.

  요청 시 다음 헤더를 추가합니다:

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

## 요청 파라미터

<ParamField body="model" type="string" required>
  비디오 생성 모델 이름입니다. `gemini-omni-flash-preview`로 고정됩니다.
</ParamField>

<ParamField body="prompt" type="string" required>
  텍스트 지시문입니다. 텍스트-비디오에서는 장면 설명, 이미지 / 비디오-비디오에서는 동작 / 스타일 / 편집 지시입니다.

  <Note>
    `prompt`와 참조 소재(`image_urls` / `video_urls`) 중 **최소 하나는 제공**해야 합니다.
  </Note>
</ParamField>

<ParamField body="image_urls" type="array<string>">
  참조 이미지로, 최대 **16장**입니다. 각 항목은 `http(s)://` URL 형식입니다.

  JPEG / PNG를 지원합니다. 여러 주체(예: 「고양이 + 털실뭉치」)는 여러 장을 전달하고, `prompt`에서 이들이 어떻게 상호작용하는지 설명할 수 있습니다.
</ParamField>

<ParamField body="video_urls" type="array<string>">
  참조 / 편집 대상 비디오로, **최대 1개**입니다(다중 비디오 참조는 지원하지 않습니다). `http(s)://` 직접 링크 또는 `data:video/...` 형식일 수 있습니다.

  <Warning>
    * 참조 비디오는 1\~24초이며, 공식적으로 **≤3초**를 권장합니다.
    * `video_urls`와 `extend_from_task_id`는 **상호 배타적**이며, 둘 중 하나만 제공할 수 있고 동시에 전달할 수 없습니다.
  </Warning>
</ParamField>

<ParamField body="aspect_ratio" type="string" default="16:9">
  비디오 화면 비율로, 실제 출력 화면의 방향을 제어합니다.

  <Warning>
    `video_urls`를 전달하면 `aspect_ratio` 매개변수가 적용되지 않습니다.
  </Warning>

  다음만 지원합니다:

  * `16:9` - 가로(기본값)
  * `9:16` - 세로

  다른 값은 `16:9`로 처리됩니다.
</ParamField>

<ParamField body="resolution" type="string" default="720p">
  비디오 해상도입니다. 현재 `720p`만 지원합니다.
</ParamField>

<ParamField body="extend_from_task_id" type="string">
  이전 작업 ID입니다. 이전 생성 작업의 \*\* `task_id`\*\*를 입력합니다.

  <Warning>
    `extend_from_task_id`와 `video_urls`는 **상호 배타적**이며, 둘 중 하나만 제공할 수 있고 동시에 전달할 수 없습니다.
  </Warning>
</ParamField>

## 응답

<ResponseField name="code" type="integer">
  응답 상태 코드입니다. 성공 시 `200`입니다.
</ResponseField>

<ResponseField name="data" type="array">
  작업 배열을 반환합니다.

  <Expandable title="배열 항목">
    <ResponseField name="status" type="string">
      작업 초기 상태입니다. 제출 성공 시 `submitted`입니다.
    </ResponseField>

    <ResponseField name="task_id" type="string">
      작업 고유 식별자입니다. 작업 상태와 결과 조회에 사용합니다.
    </ResponseField>
  </Expandable>
</ResponseField>

## 작업 결과 조회

비디오 생성은 비동기 작업입니다. 제출 후 `task_id`가 반환되며, [작업 상태 조회](/ko/api-reference/tasks/status) API로 생성 진행 상황과 결과를 조회합니다.

### 성공 결과 예시

```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
        }
      ]
    }
  }
}
```

## 사용 사례

### 시나리오 1: 텍스트-비디오

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

### 시나리오 2: 이미지-비디오

```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"]
}
```

### 시나리오 3: 비디오-비디오

```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"]
}
```
