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

# Kling Omni 동영상 만들기

> URL의 모델 ID로 Kling Omni 동영상 작업을 만든 다음 작업 ID로 결과를 가져옵니다.

`POST /omni-video/{model}`을 사용하여 비동기 Kling Omni 동영상 작업을 만듭니다. URL에 모델 ID를 지정하고 `contents`에 입력을 제공합니다.

## 모델 선택

* `kling-3.0-omni`: `720p`, `1080p`, 또는 `4k`; 3\~15초; `native`, `original` 또는 `off` 오디오.
* `kling-o1`: `720p` 또는 `1080p`; 3\~10초; `original` 또는 `off` 오디오.

텍스트 전용 예제에서는 `kling-3.0-omni`을 사용합니다. 무음 동영상을 만들려면 `settings.audio`을 `off`로 설정합니다.

## 요청 매개변수

| 필드 | 필수 | 설명 |
| - | - | - |
| 경로 `model` | 예 | URL의 모델 ID입니다. 위 목록에서 ID를 선택하고 요청 본문에 추가하지 마세요. |
| `contents` | 예 | 비어 있지 않은 동영상 입력 배열입니다. 텍스트 전용 요청의 경우 `prompt` 항목을 포함하세요. |
| `contents[].type` | 예 | `prompt`, `first_frame`, `last_frame`, `refer_image`, `feature_video`, 또는 `base_video`. `last_frame`에는 `first_frame`. |
| `contents[].text` | `prompt` 항목의 경우 | 동영상을 설명하는 텍스트입니다. |
| `contents[].url` | 이미지 또는 동영상 항목의 경우 | 이미지 URL 또는 Base64 이미지 데이터입니다. 동영상 항목에는 공개 동영상 URL을 사용합니다. |
| `settings.resolution` | 아니요 | 출력 해상도입니다. 생략하면 요청에서 `720p`가 사용됩니다. 사용 가능한 값은 `model`. |
| `settings.aspect_ratio` | 아니요 | 프레임 형태: `16:9`, `9:16` 또는 `1:1`. 생략 시 요청의 기본값은 다음과 같습니다: `16:9`. |
| `settings.duration` | 아니요 | 정수 초 단위의 동영상 길이입니다. 생략하면 요청에서 5초를 사용합니다. 선택한 모델의 범위 내에서 길이를 지정하세요. |
| `settings.multi_shot` | 아니요 | `kling-3.0-omni`의 경우 여러 샷에는 `true`을, 하나의 연속 샷에는 `false`을 설정하세요. 이 필드는 다음에 포함하지 마세요: `kling-o1`. |
| `settings.audio` | 아니요 | 선택한 모델 및 입력에 따라 `native`, `original` 또는 `off`를 설정하세요. |
| `options.callback_url` | 아니요 | 작업 상태 콜백을 수신하는 HTTPS URL입니다. |
| `options.external_task_id` | 아니요 | 상관관계 확인을 위한 자체 작업 식별자입니다. 쿼리 시 반환된 `data.id`을 유지하세요. |
| `options.watermark_info.enabled` | 아니요 | 워터마크를 요청하려면 `true`로 설정하세요. |

`kling-3.0-omni`의 경우 `feature_video` 입력에는 `settings.multi_shot: true` 및 `settings.audio: off`가 필요합니다. `base_video` 입력에는 `settings.multi_shot: false`가 필요하며 `settings.audio: native`을 사용할 수 없습니다. `base_video`을 첫 번째 또는 마지막 프레임과 함께 사용하지 마세요.

`kling-3.0-omni`의 공식 기본값은 `multi_shot: true`입니다. 정의된 샷 모드가 필요한 경우 필드를 명시적으로 설정하세요. `kling-o1`의 경우 프롬프트(Prompt)는 최대 2500자를 포함할 수 있습니다. 요청에 `first_frame`만 있고 다른 참조 이미지 또는 동영상이 없으면 5초 또는 10초 길이를 사용하세요.

5초 길이의 텍스트 전용 동영상을 만들려면 `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"
  }
}
```

응답은 비동기 작업의 `id`을 반환합니다:

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

`data.id` 값을 [Kling 작업 가져오기](https://apidoc.cometapi.com/ko/api/video/kling/model-routes/tasks.md) 와 함께 사용하여 작업이 완료될 때까지 기다리세요. 완료된 동영상 URL은 작업의 `outputs` 배열에서 읽으세요. 지속적인 액세스가 필요하면 자체 스토리지에 동영상을 저장하세요.

OpenAPI 패널에는 상응하는 Shell, Python 및 JavaScript 요청이 포함되어 있습니다. 더 많은 입력 조합은 다음을 참조하세요: [Kling 3.0 Omni 동영상 API 참조](https://kling.ai/document-api/api/video/3-0-omni/video-omni) 또는 [Kling O1 Omni 동영상 API 참조](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
      description: >-
        Omni video request fields exposed by the CometAPI route. The model ID is
        a path parameter, not a body field.
    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`. `kling-3.0-omni`
            accepts up to 3072 characters; `kling-o1` accepts up to 2500
            characters.
        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
      description: Content input fields exposed by the CometAPI route.
    OmniSettings:
      type: object
      description: >-
        Output settings exposed by the CometAPI route. Set model-specific fields
        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. For `kling-o1`, a
            request with only a `first_frame` and no other reference image or
            video must use 5 or 10 seconds.
        multi_shot:
          type: boolean
          description: >-
            For `kling-3.0-omni` only, set `true` for multiple shots or `false`
            for one continuous shot. Omit this field for `kling-o1`; the
            official default for `kling-3.0-omni` is `true`.
        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 fields exposed by the CometAPI route.
      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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.