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

# Get a Kling Omni image task

> Use CometAPI GET /kling/v1/images/omni-image/{task_id} to poll Kling Omni Image task status and retrieve generated image URLs.

Use this endpoint after you [create a Kling Omni image task](/api/image/kling/omni-image). Pass the `data.task_id` returned by the create request and poll until `data.task_status` is `succeed` or `failed`.

<Note>
  The CometAPI public query route is `GET /kling/v1/images/omni-image/{task_id}`. Do not use `GET /v1/images/omni-image`; that route is not a CometAPI public query endpoint for Kling Omni Image tasks.
</Note>

## Polling behavior

* Use the same CometAPI account that created the task
* Poll every 20-30 seconds until `task_status` is `succeed` or `failed`
* Read generated image URLs from `data.task_result.images` when the task succeeds
* Store finished images in your own storage if you need durable access

Tasks from another account, expired records, or unknown IDs return `task_not_exist`.

## Result fields

Successful query responses return generated images under `data.task_result.images`. Each item can include:

| Field           | Description                                               |
| --------------- | --------------------------------------------------------- |
| `index`         | Position of the generated image in the task result.       |
| `url`           | Generated image URL.                                      |
| `watermark_url` | Watermarked image URL when watermark output is requested. |

Generated asset URLs can expire or be cleared by the provider service. Store the finished images in your own storage layer when your workflow needs long retention.


## OpenAPI

````yaml api/openapi/image/kling/get-omni-image.openapi.json GET /kling/v1/images/omni-image/{task_id}
openapi: 3.1.0
info:
  title: Kling Omni Image Query API
  version: 1.0.0
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /kling/v1/images/omni-image/{task_id}:
    get:
      summary: Get a Kling Omni image task
      description: >-
        Get the status and result of a Kling Omni Image task by `task_id`. Use
        the `task_id` returned by `POST /kling/v1/images/omni-image`.
      operationId: get_kling_omni_image_task
      parameters:
        - name: task_id
          in: path
          required: true
          description: Task ID returned by `POST /kling/v1/images/omni-image`.
          schema:
            type: string
      responses:
        '200':
          description: Task status or result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: >-
                      Response code. `0` means the task was found and the status
                      payload was returned.
                  message:
                    type: string
                    description: Response message.
                  request_id:
                    type: string
                    description: Request identifier returned by CometAPI when present.
                  data:
                    type: object
                    required:
                      - task_id
                      - task_status
                      - created_at
                      - updated_at
                    properties:
                      task_id:
                        type: string
                        description: System-generated Kling task ID.
                      task_status:
                        type: string
                        description: Current task state.
                        enum:
                          - submitted
                          - processing
                          - succeed
                          - failed
                      task_status_msg:
                        type:
                          - string
                          - 'null'
                        description: Status detail or failure reason when returned.
                      task_info:
                        type: object
                        description: >-
                          Task metadata, including `external_task_id` when you
                          provided one during task creation.
                        properties:
                          external_task_id:
                            type:
                              - string
                              - 'null'
                            description: >-
                              User-defined task ID from the create request, when
                              provided.
                        additionalProperties: true
                      task_result:
                        type:
                          - object
                          - 'null'
                        description: >-
                          Generated output metadata. Present when the task
                          succeeds.
                        properties:
                          images:
                            type: array
                            description: Generated image results.
                            items:
                              type: object
                              properties:
                                index:
                                  type: integer
                                  description: Result image index.
                                url:
                                  type: string
                                  description: Generated image URL.
                                watermark_url:
                                  type: string
                                  description: >-
                                    Watermarked image URL when watermark output
                                    is requested.
                              additionalProperties: true
                        additionalProperties: true
                      created_at:
                        type: integer
                        description: Task creation timestamp in milliseconds.
                      updated_at:
                        type: integer
                        description: Task update timestamp in milliseconds.
                      final_unit_deduction:
                        type: string
                        description: >-
                          Final unit deduction after a successful task, when
                          returned.
                    additionalProperties: true
                additionalProperties: true
              examples:
                Succeed:
                  summary: Finished task
                  value:
                    code: 0
                    message: SUCCEED
                    request_id: <request_id>
                    data:
                      task_id: <task_id>
                      task_info: {}
                      created_at: 1782450245512
                      updated_at: 1782450286078
                      task_result:
                        images:
                          - url: https://your-image-host/generated.png
                      task_status: succeed
                      final_unit_deduction: '8'
                Processing:
                  summary: Task still running
                  value:
                    code: 0
                    message: SUCCEED
                    request_id: <request_id>
                    data:
                      task_id: <task_id>
                      task_info: {}
                      created_at: 1782450245512
                      updated_at: 1782450245512
                      task_status: processing
        '400':
          description: Task not found for the current account or invalid request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type:
                      - string
                      - integer
                      - 'null'
                  message:
                    type: string
                additionalProperties: true
              example:
                code: null
                message: task_not_exist
      x-codeSamples:
        - lang: Shell
          label: Poll task
          source: >
            TASK_ID="<task_id>"


            curl "https://api.cometapi.com/kling/v1/images/omni-image/$TASK_ID"
            \
              -H "Authorization: Bearer $COMETAPI_KEY"
        - lang: Python
          label: Poll task
          source: |
            import os
            import time
            import requests

            task_id = "<task_id>"
            headers = {"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]}

            while True:
                task = requests.get(
                    f"https://api.cometapi.com/kling/v1/images/omni-image/{task_id}",
                    headers=headers,
                ).json()
                status = task["data"]["task_status"]
                print(status)
                if status in ("succeed", "failed"):
                    break
                time.sleep(30)

            if status == "succeed":
                print(task["data"]["task_result"]["images"][0]["url"])
        - lang: JavaScript
          label: Poll task
          source: >
            const taskId = "<task_id>";

            const headers = { Authorization: `Bearer
            ${process.env.COMETAPI_KEY}` };


            let task;

            while (true) {
              task = await (await fetch(
                `https://api.cometapi.com/kling/v1/images/omni-image/${taskId}`,
                { headers },
              )).json();
              const status = task.data.task_status;
              console.log(status);
              if (status === "succeed" || status === "failed") break;
              await new Promise((resolve) => setTimeout(resolve, 30000));
            }


            if (task.data.task_status === "succeed") {
              console.log(task.data.task_result.images[0].url);
            }
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use your CometAPI API key.

````