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

# Create a Kling Omni video

> Create a Kling Omni video task with the model ID in the URL, then retrieve the result by task ID.

Use `POST /omni-video/{model}` to create an asynchronous Kling Omni video task. Place the model ID in the URL and provide the input in `contents`.

## Choose a model

* `kling-3.0-omni`: `720p`, `1080p`, or `4k`; 3-15 seconds; `native`, `original`, or `off` audio.
* `kling-o1`: `720p` or `1080p`; 3-10 seconds; `original` or `off` audio.

The text-only example uses `kling-3.0-omni`. To create a silent video, set `settings.audio` to `off`.

## Request parameters

| Field                            | Required                 | Description                                                                                                                   |
| -------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `model`                          | Yes                      | Model ID in the URL. Choose an ID from the list above.                                                                        |
| `contents`                       | Yes                      | Nonempty array of video inputs. For a text-only request, include a `prompt` item.                                             |
| `contents[].type`                | Yes                      | `prompt`, `first_frame`, `last_frame`, `refer_image`, `feature_video`, or `base_video`. A `last_frame` needs a `first_frame`. |
| `contents[].text`                | For a `prompt` item      | Text that describes the video.                                                                                                |
| `contents[].url`                 | For image or video items | Image URL or Base64 image data; video items use a public video URL.                                                           |
| `settings.resolution`            | No                       | Output resolution. If omitted, the request uses `720p`. Available values depend on `model`.                                   |
| `settings.aspect_ratio`          | No                       | Frame shape: `16:9`, `9:16`, or `1:1`. If omitted, the request uses `16:9`.                                                   |
| `settings.duration`              | No                       | Video length in whole seconds. If omitted, the request uses 5 seconds. Use a duration within the selected model's range.      |
| `settings.multi_shot`            | No                       | Boolean multi-shot setting. Set explicitly; the example uses `false` for a single continuous shot.                            |
| `settings.audio`                 | No                       | Audio choice for the selected model. If omitted, the request uses `off`.                                                      |
| `options.callback_url`           | No                       | HTTPS URL that receives task status callbacks.                                                                                |
| `options.external_task_id`       | No                       | Your own task identifier for correlation; retain the returned `data.id` for queries.                                          |
| `options.watermark_info.enabled` | No                       | Set to `true` to request a watermark.                                                                                         |

For `kling-3.0-omni`, a `feature_video` input requires `settings.multi_shot: true` and `settings.audio: off`. A `base_video` input requires `settings.multi_shot: false` and cannot use `settings.audio: native`. Do not combine `base_video` with a first or last frame.

To create a five-second text-only video, send this request body to `POST /omni-video/kling-3.0-omni`:

```json theme={null}
{
  "contents": [
    {
      "type": "prompt",
      "text": "A paper boat drifts on a pond."
    }
  ],
  "settings": {
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5,
    "multi_shot": false,
    "audio": "off"
  }
}
```

The response returns an `id` for the asynchronous task:

```json theme={null}
{
  "code": 0,
  "message": "SUCCEED",
  "data": {
    "id": "example-task-id",
    "status": "submitted"
  }
}
```

Use the `data.id` value with [Get a Kling task](./tasks) until the task completes. Read the finished video URL from the task's `outputs` array. Store the video in your own storage if you need durable access.

The OpenAPI panel contains matching Shell, Python, and JavaScript requests. For more input combinations, see the [Kling 3.0 Omni video API reference](https://kling.ai/document-api/api/video/3-0-omni/video-omni) or [Kling O1 Omni video API reference](https://kling.ai/document-api/api/video/o1/video-omni).


## OpenAPI

````yaml api/openapi/video/kling/model-routes/post-omni-video.openapi.json POST /omni-video/{model}
openapi: 3.1.0
info:
  title: Kling Omni video model routes
  version: 1.0.0
  description: Create a Kling Omni video task with a model ID in the URL.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /omni-video/{model}:
    post:
      summary: Create a Kling Omni video task
      description: Submit video inputs and save the returned task ID for status queries.
      operationId: createKlingModelRouteOmniVideo
      parameters:
        - name: model
          in: path
          required: true
          description: >-
            Kling Omni model ID. The selected model controls resolution,
            duration, and audio choices.
          schema:
            type: string
            enum:
              - kling-3.0-omni
              - kling-o1
          example: kling-3.0-omni
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OmniVideoRequest'
            example:
              contents:
                - type: prompt
                  text: A paper boat drifts on a pond.
              settings:
                resolution: 720p
                aspect_ratio: '16:9'
                duration: 5
                multi_shot: false
                audio: 'off'
      responses:
        '200':
          description: Task created. Store `data.id` for a `GET /tasks` query.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
              example:
                code: 0
                message: SUCCEED
                data:
                  id: example-task-id
                  status: submitted
      x-codeSamples:
        - lang: Shell
          label: Create task
          source: |
            curl https://api.cometapi.com/omni-video/kling-3.0-omni \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              --data-binary @- <<'JSON'
            {
              "contents": [
                {
                  "type": "prompt",
                  "text": "A paper boat drifts on a pond."
                }
              ],
              "settings": {
                "resolution": "720p",
                "aspect_ratio": "16:9",
                "duration": 5,
                "multi_shot": false,
                "audio": "off"
              }
            }
            JSON
        - lang: Python
          label: Create task
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.cometapi.com/omni-video/kling-3.0-omni",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                    "contents": [
                        {
                            "type": "prompt",
                            "text": "A paper boat drifts on a pond.",
                        }
                    ],
                    "settings": {
                        "resolution": "720p",
                        "aspect_ratio": "16:9",
                        "duration": 5,
                        "multi_shot": False,
                        "audio": "off",
                    },
                },
            )
            response.raise_for_status()
            result = response.json()
            print(result["data"]["id"])
        - lang: JavaScript
          label: Create task
          source: |
            const response = await fetch(
              "https://api.cometapi.com/omni-video/kling-3.0-omni",
              {
                method: "POST",
                headers: {
                  Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                  "Content-Type": "application/json",
                },
                body: JSON.stringify({
                  "contents": [
                    {
                      "type": "prompt",
                      "text": "A paper boat drifts on a pond."
                    }
                  ],
                  "settings": {
                    "resolution": "720p",
                    "aspect_ratio": "16:9",
                    "duration": 5,
                    "multi_shot": false,
                    "audio": "off"
                  }
                }),
              },
            );
            if (!response.ok) throw new Error(`HTTP ${response.status}`);
            const result = await response.json();
            console.log(result.data.id);
components:
  schemas:
    OmniVideoRequest:
      type: object
      required:
        - contents
      properties:
        contents:
          type: array
          minItems: 1
          description: Video input items. Send a prompt item for text-only generation.
          items:
            $ref: '#/components/schemas/ContentItem'
        settings:
          $ref: '#/components/schemas/OmniSettings'
        options:
          $ref: '#/components/schemas/TaskOptions'
      additionalProperties: false
    SubmitResponse:
      type: object
      required:
        - code
        - message
        - data
      properties:
        code:
          type:
            - integer
            - string
          description: Result code. `0` indicates task creation.
        message:
          type: string
          description: Result message.
        msg:
          type: string
          description: Additional result message, when included.
        data:
          type: object
          description: Task identification and submission status.
          required:
            - id
            - status
          properties:
            id:
              type: string
              description: System task ID for a `GET /tasks` query.
            status:
              type: string
              enum:
                - submitted
                - processing
                - succeeded
                - failed
              description: Task status.
    ContentItem:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - prompt
            - first_frame
            - last_frame
            - refer_image
            - feature_video
            - base_video
          description: >-
            Input role. Use `prompt` for text, an image role for a frame or
            image reference, or a video role for a video reference. A last frame
            requires a first frame.
        text:
          type: string
          maxLength: 3072
          description: Text prompt, required when `type` is `prompt`.
        url:
          type: string
          description: >-
            Required for non-prompt items. Image items accept a public URL or
            Base64 JPG/PNG; video items accept a public MP4/MOV URL.
      allOf:
        - if:
            properties:
              type:
                const: prompt
                description: Text-prompt input role.
          then:
            required:
              - text
          else:
            required:
              - url
      additionalProperties: false
    OmniSettings:
      type: object
      description: >-
        Output settings. Set multi_shot and audio explicitly for the intended
        result.
      properties:
        resolution:
          type: string
          enum:
            - 720p
            - 1080p
            - 4k
          default: 720p
          description: Output resolution. `4k` applies only to `kling-3.0-omni`.
        aspect_ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
          default: '16:9'
          description: Output frame shape.
        duration:
          type: integer
          minimum: 3
          maximum: 15
          default: 5
          description: >-
            Requested duration in whole seconds. `kling-o1` accepts 3 to 10
            seconds; `kling-3.0-omni` accepts 3 to 15 seconds.
        multi_shot:
          type: boolean
          default: false
          description: >-
            Set `false` for one continuous shot or `true` for a multi-shot
            request.
        audio:
          type: string
          enum:
            - native
            - original
            - 'off'
          default: 'off'
          description: >-
            `native` creates audio with `kling-3.0-omni`; `original` retains
            sound from an input video; `off` makes silent output. `kling-o1`
            accepts only `original` and `off`.
      additionalProperties: false
    TaskOptions:
      type: object
      description: Optional task notification and identification settings.
      properties:
        callback_url:
          type: string
          format: uri
          description: HTTPS URL that receives task status callbacks.
        external_task_id:
          type: string
          description: >-
            Your own task identifier, unique within your account. The response
            still returns the system task ID.
        watermark_info:
          type: object
          description: Watermark setting for the generated output.
          required:
            - enabled
          properties:
            enabled:
              type: boolean
              description: Set to `true` to request a watermarked result.
          additionalProperties: false
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Authenticate with your CometAPI API key.

````