# Gemini Omni 1.2 Flash

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/jobs/createTask:
    post:
      summary: Gemini Omni 1.2 Flash
      deprecated: false
      description: >
        ### Create Task


        Use this endpoint to create a new multimodal video generation task. Use
        only one generation mode per request.


        <Card title="Get Task Details" icon="lucide-search"
        href="/market/common/get-task-detail">
          After submission, use the unified query endpoint to check task progress and retrieve results
        </Card>


        ::: tip[]

        For production use, we recommend providing the `callBackUrl` parameter
        so your service can receive completion notifications instead of polling
        for task status.

        :::


        ### Related Resources


        <CardGroup cols={2}>
          <Card title="Model Marketplace" icon="lucide-store" href="/market/quickstart">
            Explore all available models and capabilities
          </Card>
          <Card title="Common API" icon="lucide-cog" href="/common-api/get-account-credits">
            Check account credits and usage
          </Card>
        </CardGroup>


        ### Generation modes


        Choose one mode per request, based on whether you send a first frame or
        a video:


        | Mode | When | `duration` | Other assets allowed |

        |---|---|---|---|

        | A Text / reference images / characters | No `first_frame_url`, no
        `video_list` | **Required**, integer **3–15** | `image_urls`,
        `character_ids` |

        | B First frame only | `first_frame_url` set, no `last_frame_url` |
        **Required**, integer **3–15** | None (see exclusions) |

        | C First and last frame | Both `first_frame_url` and `last_frame_url` |
        **Required**, integer **3–10** | None (see exclusions) |

        | D Video edit | `video_list` set | **Do not send** | `image_urls`,
        `character_ids` |


        **Exclusions** (when `first_frame_url` or `last_frame_url` is set):


        - Do not send `last_frame_url` alone

        - Do not send `image_urls`, `video_list`, or `character_ids` at the same
        time


        ### Image quota (7 slots)


        Quota formula:


        ```

        number of reference images + (2 if a video is present) ≤ 7

        ```


        - `image_urls`: max **6**, 1 slot each

        - `video_list`: max **1**, 2 slots

        - `character_ids`: max **2**. Character images do not count toward the
        reference-image quota


        **Examples:**


        *   6 reference images → allowed

        *   5 reference images + 1 video → 5+2=7, allowed

        *   6 reference images + 1 video → 6+2=8, over quota
      operationId: gemini-omni-1.2-flash
      tags:
        - docs/en/Market/Video Models/Gemini Omni
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - google/gemini-omni-flash-1-2
                  default: google/gemini-omni-flash-1-2
                  description: >-
                    The model name used to generate the task. This field is
                    required. This interface must use the
                    `google/gemini-omni-flash-1-2` model.
                  examples:
                    - google/gemini-omni-flash-1-2
                callBackUrl:
                  type: string
                  format: uri
                  description: >-
                    The callback URL for task completion notifications. This
                    parameter is optional. If provided, the system will send a
                    POST request to this URL when the task is completed,
                    regardless of whether it succeeds or fails. If not provided,
                    no callback notification will be sent.
                  examples:
                    - https://your-domain.com/api/callback
                input:
                  type: object
                  description: >-
                    Input parameters for the generation task. Use only one
                    generation mode per request: text / reference images, first
                    frame only, first and last frame, or video edit.
                  properties:
                    prompt:
                      type: string
                      description: >-
                        Video prompt. Required and must be non-empty. Describe
                        the scene, action, camera, and sound.
                      examples:
                        - >-
                          A cat plays piano in a jazz bar, one continuous shot,
                          soft live jazz
                      maxLength: 20000
                      minLength: 1
                    duration:
                      type: integer
                      minimum: 3
                      maximum: 15
                      description: >-
                        Duration of the generated video in seconds. Send an
                        integer.


                        - Text / reference images / characters (no first frame,
                        no video): **required**, **3–15**

                        - First frame only: **required**, **3–15**

                        - First and last frame: **required**, **3–10**

                        - Video edit (`video_list` set): **do not send**; output
                        duration follows the input video
                      examples:
                        - 8
                    aspect_ratio:
                      type: string
                      enum:
                        - '16:9'
                        - '9:16'
                        - auto
                      default: '16:9'
                      description: >-
                        Aspect ratio of the generated video. Allowed values:
                        `16:9`, `9:16`, `auto`. Default `16:9`. When no
                        reference image is provided, `auto` is treated as
                        `16:9`.
                      examples:
                        - '16:9'
                      x-apidog-enum:
                        - value: '16:9'
                          name: '16:9'
                          description: Landscape
                        - value: '9:16'
                          name: '9:16'
                          description: Portrait
                        - value: auto
                          name: auto
                          description: >-
                            Automatic; treated as 16:9 when there is no
                            reference image
                    resolution:
                      type: string
                      enum:
                        - 360p
                        - 720p
                        - 1080p
                        - 4k
                      default: 720p
                      description: >-
                        Resolution of the generated video. Allowed values:
                        `360p`, `720p`, `1080p`, `4k`. Default `720p`.
                      examples:
                        - 720p
                      x-apidog-enum:
                        - value: 360p
                          name: ''
                          description: ''
                        - value: 720p
                          name: ''
                          description: ''
                        - value: 1080p
                          name: ''
                          description: ''
                        - value: 4k
                          name: ''
                          description: ''
                    seeds:
                      type: integer
                      minimum: 10000
                      maximum: 99999
                      description: >-
                        Random seed. Range: 10000–99999. Send a single integer.
                        If omitted, the system generates one.
                      examples:
                        - 12345
                    image_urls:
                      type: array
                      maxItems: 6
                      items:
                        type: string
                        format: uri
                      description: >-
                        Reference image URLs, max **6**. Used for subject,
                        scene, style, or storyboard reference. Two reference
                        images are not treated as first/last frames.


                        Limits:

                        - Use publicly accessible image URLs

                        - Each file must be no larger than `20MB`

                        - Mutually exclusive with `first_frame_url` and
                        `last_frame_url`

                        - Each image costs 1 quota slot
                      examples:
                        - - https://example.com/ref1.png
                          - https://example.com/ref2.png
                    character_ids:
                      type: array
                      maxItems: 2
                      items:
                        type: string
                      description: >-
                        Character IDs, max **2**. IDs come from the
                        create-character endpoint
                        `/api/v1/omni/character/create`. You can only use
                        characters you created yourself. Mutually exclusive with
                        first/last frames (`first_frame_url` /
                        `last_frame_url`). Character images do not count toward
                        the reference-image quota.
                      examples:
                        - - character_01hx8p0demo
                    first_frame_url:
                      type: string
                      format: uri
                      description: >-
                        First-frame image URL. Sets the starting frame of the
                        generated video. Use a publicly accessible image URL.


                        - First frame only (no last frame): `duration` is
                        required, integer 3–15

                        - Together with `last_frame_url`: `duration` is
                        required, integer 3–10

                        - When this field is set, do not send `image_urls`,
                        `video_list`, or `character_ids`

                        - Do not send `last_frame_url` alone
                      examples:
                        - https://example.com/first.png
                    last_frame_url:
                      type: string
                      format: uri
                      description: >-
                        Last-frame image URL. Sets the ending frame. Must be
                        sent together with `first_frame_url`; cannot be used
                        alone. `duration` is then required and must be 3–10.
                        When first and last frames are set, do not send
                        `image_urls`, `video_list`, or `character_ids`.
                      examples:
                        - https://example.com/last.png
                    video_list:
                      type: array
                      maxItems: 1
                      items:
                        type: string
                        format: uri
                      description: >-
                        Video URL array, max **1**. Sending this field selects
                        video-edit mode. **Do not send `duration`**; output
                        duration follows the input video. Can be combined with
                        `image_urls` and `character_ids`. Mutually exclusive
                        with `first_frame_url` and `last_frame_url`. Use a
                        publicly accessible video URL, MP4 recommended, no
                        longer than **15 seconds**.
                      examples:
                        - - https://example.com/clip.mp4
                  x-apidog-orders:
                    - prompt
                    - duration
                    - aspect_ratio
                    - resolution
                    - seeds
                    - image_urls
                    - character_ids
                    - first_frame_url
                    - last_frame_url
                    - video_list
                  required:
                    - prompt
                  dependencies:
                    last_frame_url:
                      - first_frame_url
                  x-apidog-ignore-properties: []
              x-apidog-orders:
                - model
                - callBackUrl
                - input
              x-apidog-ignore-properties: []
            example:
              model: google/gemini-omni-flash-1-2
              callBackUrl: https://your-domain.com/api/callback
              input:
                prompt: >-
                  The character walks through a rainy street at night, neon
                  reflections
                duration: 8
                aspect_ratio: '9:16'
                resolution: 720p
                image_urls:
                  - https://example.com/ref1.png
                  - https://example.com/ref2.png
                character_ids:
                  - character_01hx8p0demo
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/response%20not%20with%20recordId'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          taskId:
                            type: string
                            description: >-
                              Task ID, which can be used to query task status
                              through the task detail endpoint.
                            examples:
                              - task_gemini_1765180586443
                        x-apidog-orders:
                          - taskId
                        x-apidog-ignore-properties: []
                    x-apidog-orders:
                      - data
                    x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: ''
      security:
        - BearerAuth: []
          x-apidog:
            schemeGroups:
              - id: kn8M4YUlc5i0A0179ezwx
                schemeIds:
                  - BearerAuth
            required: true
            use:
              id: kn8M4YUlc5i0A0179ezwx
            scopes:
              kn8M4YUlc5i0A0179ezwx:
                BearerAuth: []
      callbacks:
        videoTaskCompleted:
          '{request.body#/callBackUrl}':
            post:
              description: >-
                The system sends this callback when the
                `google/gemini-omni-flash-1-2` task succeeds or fails.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      type: object
                      required:
                        - code
                        - msg
                        - data
                      properties:
                        code:
                          type: integer
                          description: >-
                            Unified callback code: 200 for success, 501 for
                            failure.
                          enum:
                            - 200
                            - 501
                        msg:
                          type: string
                          description: Unified callback message.
                          enum:
                            - Playground task completed successfully.
                            - Playground task failed.
                        data:
                          type: object
                          required:
                            - taskId
                            - model
                            - state
                            - param
                          properties:
                            taskId:
                              type: string
                              description: The unique task identifier.
                            model:
                              type: string
                              description: The model used for the task.
                              enum:
                                - google/gemini-omni-flash-1-2
                            state:
                              type: string
                              description: Terminal task state.
                              enum:
                                - success
                                - fail
                            param:
                              type: string
                              description: >-
                                JSON string containing the submitted task
                                parameters.
                            resultJson:
                              type: string
                              nullable: true
                              description: >-
                                JSON string containing resultUrls,
                                firstFrameUrl, lastFrameUrl, or resultObject
                                when successful. Present only when state is
                                success.
                            failCode:
                              type: string
                              nullable: true
                              description: >-
                                Failure code, a numeric string such as "400" or
                                "500". Present only when state is fail.
                            failMsg:
                              type: string
                              nullable: true
                              description: Failure reason. Present only when state is fail.
                            costTime:
                              type: integer
                              format: int64
                              description: >-
                                Processing time in seconds. Present on both
                                success and failure callbacks.
                            completeTime:
                              type: integer
                              format: int64
                              description: Task completion timestamp.
                            createTime:
                              type: integer
                              format: int64
                              description: Task creation timestamp.
                            updateTime:
                              type: integer
                              format: int64
                              description: >-
                                Use completeTime as the completion time;
                                updateTime may equal createTime.
                            creditsConsumed:
                              type: number
                              description: >-
                                Credits consumed by the task; 0 for failed
                                tasks.
                    examples:
                      success:
                        summary: Task completed successfully
                        value:
                          code: 200
                          msg: Playground task completed successfully.
                          data:
                            taskId: task_example_video_webhook_001
                            model: google/gemini-omni-flash-1-2
                            state: success
                            param: >-
                              {"input":"{\"prompt\":\"The character walks
                              through a rainy street at night, neon
                              reflections\",\"duration\":8,\"aspect_ratio\":\"9:16\",\"resolution\":\"720p\",\"image_urls\":[\"https://example.com/ref1.png\",\"https://example.com/ref2.png\"]}","callBackUrl":"https://example.com/callback","model":"google/gemini-omni-flash-1-2"}
                            resultJson: >-
                              {"resultUrls":["https://example.com/generated-video.mp4"]}
                            costTime: 12
                            completeTime: 1234567890
                            createTime: 1234560000
                            updateTime: 1234567890
                            creditsConsumed: 1.23
                      failure:
                        summary: Task failed
                        value:
                          code: 501
                          msg: Playground task failed.
                          data:
                            taskId: task_example_video_webhook_001
                            model: google/gemini-omni-flash-1-2
                            state: fail
                            param: >-
                              {"input":"{\"prompt\":\"The character walks
                              through a rainy street at night, neon
                              reflections\",\"duration\":8,\"aspect_ratio\":\"9:16\",\"resolution\":\"720p\",\"image_urls\":[\"https://example.com/ref1.png\",\"https://example.com/ref2.png\"]}","callBackUrl":"https://example.com/callback","model":"google/gemini-omni-flash-1-2"}
                            failCode: '400'
                            failMsg: <error detail>
                            costTime: 12
                            creditsConsumed: 0
              responses:
                '200':
                  description: Callback received successfully.
                  content:
                    application/json:
                      schema:
                        type: object
                        properties:
                          code:
                            type: integer
                            example: 200
                          msg:
                            type: string
                            example: success
                      example:
                        code: 200
                        msg: success
      x-apidog-folder: docs/en/Market/Video Models/Gemini Omni
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1184766/apis/api-46724168-run
components:
  schemas:
    response not with recordId:
      type: object
      required:
        - data
      properties:
        code:
          type: integer
          description: >-
            Status code of the request. The HTTP status is 200 even when the
            request fails, so always check this field: 200 means success; any
            other value means the request failed and msg describes the reason.
            Common values: 401 invalid or missing API key; 402 insufficient
            credits; 429 rate limit exceeded; 422 or 500 the request could not
            be processed (read msg and check your parameters before retrying).
          enum:
            - 200
            - 401
            - 402
            - 404
            - 422
            - 429
            - 433
            - 455
            - 500
            - 501
            - 505
        msg:
          type: string
          description: Response message, error description upon failure
          examples:
            - success
        data:
          type: object
          required:
            - taskId
          properties:
            taskId:
              type: string
              description: >-
                The task ID can be used with the "Get Task Details" endpoint to
                query the task status.
              examples:
                - dc1928bfcbc77cb6c85f3359a9c718b3
          x-apidog-orders:
            - taskId
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - code
        - msg
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    BearerAuth:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: >-
        All API requests require a Bearer Token. Add the header `Authorization:
        Bearer YOUR_API_KEY` to authenticate requests.
    BearerAuth1:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: >-
        所有 API 请求都需要 Bearer Token。请在请求头中添加 `Authorization: Bearer YOUR_API_KEY`
        进行身份验证。
servers:
  - url: https://api.kie.ai
    description: 正式环境
security:
  - BearerAuth: []
    x-apidog:
      schemeGroups:
        - id: kn8M4YUlc5i0A0179ezwx
          schemeIds:
            - BearerAuth
      required: true
      use:
        id: kn8M4YUlc5i0A0179ezwx
      scopes:
        kn8M4YUlc5i0A0179ezwx:
          BearerAuth: []

```
