# Gemini Omni Flash 1.2 Extend

## OpenAPI Specification

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


        Use this endpoint to extend an existing Gemini Omni Flash 1.2 video from
        the end. Each request returns a complete video (original + the new
        segment).


        <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>


        ### Usage notes


        - You can only extend from the end of the video. You cannot prepend or
        insert in the middle

        - The result is a complete video. Duration is about source length +
        `duration`. You do not need to stitch clips yourself

        - The source video must be **15 seconds or shorter**. A successful
        extend returns a new `taskId`. If the resulting video is still 15
        seconds or shorter, you can use that ID to extend again

        - Source resolution must be **360p** or **720p** (1080p / 4k is not
        supported yet)

        - The model mainly uses the ending of the source video as context. If a
        person or object only appeared earlier, describe it again in the prompt,
        or pass a reference image
      operationId: gemini-omni-flash-1-2-extend
      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-extend
                  default: google/gemini-omni-flash-1-2-extend
                  description: >-
                    The model name used to generate the task. This field is
                    required. This interface must use the
                    `google/gemini-omni-flash-1-2-extend` model.
                  examples:
                    - google/gemini-omni-flash-1-2-extend
                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 video-extend task.
                  required:
                    - task_id
                    - prompt
                    - duration
                  x-apidog-orders:
                    - task_id
                    - prompt
                    - duration
                    - image_urls
                  properties:
                    task_id:
                      type: string
                      minLength: 1
                      description: >-
                        ID of the source task to extend. Required. Must be a
                        completed `google/gemini-omni-flash-1-2` generation
                        task, or a completed
                        `google/gemini-omni-flash-1-2-extend` extend task. The
                        source video must be 360p or 720p (1080p / 4k is not
                        supported yet) and no longer than 15 seconds.
                      examples:
                        - task_xxxxxxxx
                    prompt:
                      type: string
                      minLength: 1
                      maxLength: 20000
                      description: >-
                        Extend prompt. Required and must be non-empty. Describe
                        what happens next, such as action, camera, environment,
                        and sound. Put anything you do not want in the prompt as
                        well.
                      examples:
                        - >-
                          The scene continues: the robot turns to the camera and
                          waves, the camera slowly pulls back.
                    duration:
                      type: integer
                      minimum: 3
                      maximum: 10
                      description: >-
                        How many seconds to extend from the end. Required.
                        Integer **3–10**. This is the length of the new segment,
                        not the full output. Full duration is about source
                        length + `duration`.
                      examples:
                        - 5
                    image_urls:
                      type: array
                      maxItems: 3
                      items:
                        type: string
                        format: uri
                      description: >-
                        Reference image URLs, max **3**. Used to keep people and
                        objects consistent.


                        Limits:

                        - Use publicly accessible image URLs

                        - Supported formats: png / jpeg / webp

                        - Each file must be no larger than `20MB`
                      examples:
                        - - https://example.com/stage-reference.png
                  x-apidog-ignore-properties: []
              x-apidog-orders:
                - model
                - callBackUrl
                - input
              x-apidog-ignore-properties: []
            example:
              model: google/gemini-omni-flash-1-2-extend
              callBackUrl: https://your-domain.com/api/callback
              input:
                task_id: task_xxxxxxxx
                prompt: >-
                  The scene continues: the robot turns to the camera and waves,
                  the camera slowly pulls back.
                duration: 5
                image_urls:
                  - https://example.com/stage-reference.png
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          taskId:
                            type: string
                            description: >-
                              Task ID. Use it to query task details. After
                              success, you can also pass it as `task_id` for the
                              next extend.
                            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-extend` 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-extend
                            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: >-
                                Returned on success. JSON string whose
                                `resultUrls` is the complete extended video
                                (original + new segment). 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-extend
                            state: success
                            param: >-
                              {"input":"{\"task_id\":\"task_xxxxxxxx\",\"prompt\":\"The
                              scene continues: the robot turns to the camera and
                              waves, the camera slowly pulls
                              back.\",\"duration\":5,\"image_urls\":[\"https://example.com/stage-reference.png\"]}","callBackUrl":"https://example.com/callback","model":"google/gemini-omni-flash-1-2-extend"}
                            resultJson: >-
                              {"resultUrls":["https://example.com/extended-full-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-extend
                            state: fail
                            param: >-
                              {"input":"{\"task_id\":\"task_xxxxxxxx\",\"prompt\":\"The
                              scene continues: the robot turns to the camera and
                              waves, the camera slowly pulls
                              back.\",\"duration\":5,\"image_urls\":[\"https://example.com/stage-reference.png\"]}","callBackUrl":"https://example.com/callback","model":"google/gemini-omni-flash-1-2-extend"}
                            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-46919629-run
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          description: >-
            请求状态码。请求失败时 HTTP 状态仍为 200，请始终以本字段判断：200 表示成功，其他值均表示失败，原因见
            msg。常见值：401 API key 无效或缺失；402 积分不足；429 超出频率限制；422 或 500 请求未能处理（请先查看
            msg、检查参数，再决定是否重试）。
          enum:
            - 200
            - 401
            - 402
            - 404
            - 422
            - 429
            - 433
            - 455
            - 500
            - 501
            - 505
          x-apidog-enum:
            - value: 200
              name: ''
              description: ''
            - value: 401
              name: ''
              description: ''
            - value: 402
              name: ''
              description: ''
            - value: 404
              name: ''
              description: ''
            - value: 422
              name: ''
              description: ''
            - value: 429
              name: ''
              description: ''
            - value: 433
              name: ''
              description: ''
            - value: 455
              name: ''
              description: ''
            - value: 500
              name: ''
              description: ''
            - value: 501
              name: ''
              description: ''
            - value: 505
              name: ''
              description: ''
        msg:
          type: string
          description: 响应消息，失败时的错误描述
        data:
          type: object
          properties:
            taskId:
              type: string
              description: 可以使用任务 ID 与“获取任务详细信息”端点一起查询任务状态。
          x-apidog-orders:
            - taskId
          required:
            - taskId
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - code
        - msg
        - data
      required:
        - code
        - msg
        - data
      title: response not with recordId
      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: []

```
