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

# Ein Kling Omni-Video erstellen

> Verwenden Sie CometAPI POST /kling/v1/videos/omni-video, um Kling O1-Videotasks zu erstellen und den Status mit der Omni-Abfrageroute nachzuverfolgen.

Verwenden Sie diesen Endpoint für den O1-kompatiblen Kling Omni-Workflow, der über CometAPI bereitgestellt wird, einschließlich Text-zu-Video und Generation mit Referenz auf ein Bild des ersten Frames.

<Note>
  Die vollständige Referenz der Anbieterparameter finden Sie in der [Kling Omni Video-Dokumentation](https://kling.ai/document-api/api/video/o1/video-omni).
</Note>

## Eingabemodus wählen

* Text-zu-Video: Senden Sie `prompt`, `mode`, `aspect_ratio` und `duration`
* Referenzbild für den ersten Frame: Fügen Sie `image_list`-Elemente mit `image_url` und `type: first_frame` hinzu und referenzieren Sie dann das Bild in `prompt` als `<<<image_1>>>`
* Ausgabe mit Wasserzeichen: Fügen Sie `watermark_info.enabled: true` hinzu, wenn Sie in der Abfrageantwort eine Video-URL mit Wasserzeichen benötigen
* Model ID: Lassen Sie `model_name` weg, um den Standardwert der Route zu verwenden, oder senden Sie eine getestete Omni Video-Model ID wie `kling-video-o1` oder `kling-v3-omni`

## Dauer und Seitenverhältnis

| Einstellung                                 | Unterstützte Werte    | Standard       | Grenzverhalten                                                                                                                             |
| ------------------------------------------- | --------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `duration` für Text- oder First-Frame-Video | `"5"`, `"10"`         | `"5"`          | Senden Sie den Wert als String und verwenden Sie eine der beiden festen Generierungslängen.                                                |
| `aspect_ratio`                              | `16:9`, `9:16`, `1:1` | `16:9`         | Erforderlich, wenn kein Bild des ersten Frames den Frame steuert.                                                                          |
| `mode`                                      | `std`, `pro`          | Routenstandard | Senden Sie `std` für die Standardgenerierung oder `pro` nur dann, wenn Ihr ausgewähltes Modell den Modus mit höherer Qualität unterstützt. |

Kling Omni stellt kein exaktes Feld `size` bereit. Behandeln Sie `aspect_ratio` als Anfrage für die Frame-Form; eine Text-zu-Video-Anfrage mit `16:9` kann als Full-HD `1920x1080` gerendert werden.

## Task-Ablauf

<Steps>
  <Step title="Den Omni-Task erstellen">
    Senden Sie die Anfrage und speichern Sie das zurückgegebene `task_id`.
  </Step>

  <Step title="Den Omni-Task abfragen">
    Fahren Sie mit [Ein Kling Omni-Video abrufen](./omni-query) fort, bis der Task abgeschlossen ist.
  </Step>

  <Step title="Das fertige Video speichern">
    Verschieben Sie die zurückgegebene MP4-URL in Ihren eigenen Speicher, wenn Sie dauerhaften Zugriff benötigen.
  </Step>
</Steps>


## OpenAPI

````yaml api/openapi/video/kling/post-omni-video.openapi.json POST /kling/v1/videos/omni-video
openapi: 3.1.0
info:
  title: Omni Video API (Beta)
  version: 1.0.0
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /kling/v1/videos/omni-video:
    post:
      summary: Omni Video (Beta)
      operationId: omni_video
      parameters:
        - name: Content-Type
          in: header
          required: false
          description: Content type of the request body.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
              properties:
                model_name:
                  type: string
                  description: >-
                    Optional model ID for this Kling Omni video request. Omit
                    this field to use the route default.
                prompt:
                  type: string
                  description: >-
                    Text prompt describing the desired video. Maximum length is
                    2,500 characters. When you send `image_list`, reference the
                    image with `<<<image_1>>>`.
                image_list:
                  type: array
                  description: >-
                    Optional first-frame image reference for image-referenced
                    Omni generation.
                  items:
                    type: object
                    required:
                      - image_url
                      - type
                    properties:
                      image_url:
                        type: string
                        description: Image URL or Base64 image string.
                      type:
                        type: string
                        description: >-
                          Reference role for this image. Use `first_frame` for
                          the first video frame.
                        enum:
                          - first_frame
                    additionalProperties: false
                sound:
                  type: string
                  description: Whether to generate audio with the video. Use `on` or `off`.
                  enum:
                    - 'on'
                    - 'off'
                  default: 'off'
                mode:
                  type: string
                  description: >-
                    Generation mode. Use `std` for standard generation or `pro`
                    when the selected model supports the higher-quality mode.
                  enum:
                    - std
                    - pro
                aspect_ratio:
                  type: string
                  description: >-
                    Aspect ratio request for beta Kling Omni generation. The
                    endpoint does not expose an exact size field; a 16:9
                    text-to-video request can render as 1920x1080.
                  enum:
                    - '16:9'
                    - '9:16'
                    - '1:1'
                duration:
                  type: string
                  description: >-
                    Requested output length for text-to-video and first-frame
                    image-reference workflows. Use `5` or `10` as a string.
                  default: '5'
                  enum:
                    - '5'
                    - '10'
                watermark_info:
                  type: object
                  description: >-
                    Watermark options. When `enabled` is `true`, the task can
                    return watermarked result URLs in addition to original
                    result URLs.
                  properties:
                    enabled:
                      type: boolean
                      description: Whether to request watermarked result URLs.
                  additionalProperties: false
                callback_url:
                  type: string
                  description: >-
                    Webhook URL for task status notifications. The server sends
                    a callback when the task status changes.
                  format: uri
                external_task_id:
                  type: string
                  description: >-
                    Optional user-defined task ID for your own tracking. Does
                    not replace the system-generated task ID. Must be unique per
                    account.
              default:
                model_name: kling-v3-omni
                prompt: A paper boat drifts across a calm pond at sunrise.
                mode: std
                aspect_ratio: '16:9'
                duration: '5'
                sound: 'off'
            examples:
              Text to video:
                summary: Kling Omni text-to-video request
                value:
                  model_name: kling-v3-omni
                  prompt: A paper boat drifts across a calm pond at sunrise.
                  mode: std
                  aspect_ratio: '16:9'
                  duration: '5'
                  sound: 'off'
              Image reference:
                summary: Kling Omni first-frame request
                value:
                  model_name: kling-video-o1
                  prompt: Animate <<<image_1>>> with a slow camera move.
                  image_list:
                    - image_url: https://your-image-host/first-frame.png
                      type: first_frame
                  mode: std
                  aspect_ratio: '16:9'
                  duration: '5'
                  sound: 'off'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: Response code. `0` means the task request was accepted.
                  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
                      - task_info
                      - created_at
                      - updated_at
                    properties:
                      task_id:
                        type: string
                        description: Task ID generated by the system.
                      task_status:
                        type: string
                        description: Task status.
                        enum:
                          - submitted
                          - processing
                          - succeed
                          - failed
                      task_info:
                        type: object
                        description: >-
                          Task metadata, including `external_task_id` when
                          supplied.
                        properties:
                          external_task_id:
                            type:
                              - string
                              - 'null'
                        additionalProperties: true
                      task_status_msg:
                        type:
                          - string
                          - 'null'
                        description: Status details when present.
                      created_at:
                        type: integer
                        description: >-
                          Task creation time as a Unix timestamp in
                          milliseconds.
                      updated_at:
                        type: integer
                        description: Task update time as a Unix timestamp in milliseconds.
                    additionalProperties: true
                additionalProperties: true
                example:
                  code: 0
                  message: SUCCEED
                  data:
                    task_id: <task_id>
                    task_status: submitted
                    task_info:
                      external_task_id: null
                    task_status_msg: null
                    created_at: 1773366840306
                    updated_at: 1773366840306
      x-codeSamples:
        - lang: Shell
          label: Text to video
          source: |
            curl https://api.cometapi.com/kling/v1/videos/omni-video \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                  "model_name": "kling-v3-omni",
                  "prompt": "A paper boat drifts across a calm pond at sunrise.",
                  "mode": "std",
                  "aspect_ratio": "16:9",
                  "duration": "5",
                  "sound": "off"
                }'
        - lang: Python
          label: Text to video
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.cometapi.com/kling/v1/videos/omni-video",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                  "model_name": "kling-v3-omni",
                  "prompt": "A paper boat drifts across a calm pond at sunrise.",
                  "mode": "std",
                  "aspect_ratio": "16:9",
                  "duration": "5",
                  "sound": "off"
                },
            )

            result = response.json()
            print(result.get("code"), result.get("data", {}).get("task_id"))
        - lang: JavaScript
          label: Text to video
          source: >
            const response = await
            fetch("https://api.cometapi.com/kling/v1/videos/omni-video", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "model_name": "kling-v3-omni",
                "prompt": "A paper boat drifts across a calm pond at sunrise.",
                "mode": "std",
                "aspect_ratio": "16:9",
                "duration": "5",
                "sound": "off"
              }),
            });


            const result = await response.json();

            console.log(result.code, result.data?.task_id);
        - lang: Shell
          label: Image reference
          source: |
            curl https://api.cometapi.com/kling/v1/videos/omni-video \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                  "model_name": "kling-video-o1",
                  "prompt": "Animate <<<image_1>>> with a slow camera move.",
                  "image_list": [
                    {
                      "image_url": "https://your-image-host/first-frame.png",
                      "type": "first_frame"
                    }
                  ],
                  "mode": "std",
                  "aspect_ratio": "16:9",
                  "duration": "5",
                  "sound": "off"
                }'
        - lang: Python
          label: Image reference
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.cometapi.com/kling/v1/videos/omni-video",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                  "model_name": "kling-video-o1",
                  "prompt": "Animate <<<image_1>>> with a slow camera move.",
                  "image_list": [
                    {
                      "image_url": "https://your-image-host/first-frame.png",
                      "type": "first_frame"
                    }
                  ],
                  "mode": "std",
                  "aspect_ratio": "16:9",
                  "duration": "5",
                  "sound": "off"
                },
            )

            result = response.json()
            print(result.get("code"), result.get("data", {}).get("task_id"))
        - lang: JavaScript
          label: Image reference
          source: >
            const response = await
            fetch("https://api.cometapi.com/kling/v1/videos/omni-video", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "model_name": "kling-video-o1",
                "prompt": "Animate <<<image_1>>> with a slow camera move.",
                "image_list": [
                  {
                    "image_url": "https://your-image-host/first-frame.png",
                    "type": "first_frame"
                  }
                ],
                "mode": "std",
                "aspect_ratio": "16:9",
                "duration": "5",
                "sound": "off"
              }),
            });


            const result = await response.json();

            console.log(result.code, result.data?.task_id);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use your CometAPI key.

````