# "Omni-Video"

Nguồn: https://docs.openaihub.net/api-45209016/

> API origin: `https://api.openaihub.net`. Chọn đúng nhóm API và model. Thông số dưới đây là bản tham chiếu kỹ thuật; chưa phải kết quả kiểm thử từng endpoint bằng tài khoản của bạn.


## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /kling/v1/videos/omni-video:
    post:
      summary: Omni-Video
      deprecated: false
      description: >-
        Tạo video hợp nhất với Kling Omni: chuyển văn bản thành video, tham
        chiếu hình ảnh, khung hình đầu/cuối, chỉnh sửa video, tham chiếu chủ thể
        và nhiều cảnh quay.
      operationId: kling_omni_video
      tags:
        - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Video/Kling/Omni-Video
        - Kling
      parameters:
        - name: Content-Type
          in: header
          description: Content-Type của phần thân yêu cầu, thường là application/json
          required: false
          example: application/json
          schema:
            type: string
        - name: Authorization
          in: header
          description: Khóa API Bearer
          required: false
          example: Bearer {{YOUR_API_KEY}}
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - model_name
              properties:
                aspect_ratio:
                  type: string
                  enum:
                    - '16:9'
                    - '9:16'
                    - '1:1'
                  enumDetails:
                    - value: '16:9'
                      displayName: Toàn cảnh
                    - value: '9:16'
                      displayName: Chân dung
                    - value: '1:1'
                      displayName: Hình vuông
                  description: >-
                    Tỉ lệ khung hình. Nên đặt trường này là bắt buộc khi không
                    sử dụng khung hình đầu tiên và không dùng cho việc chỉnh sửa
                    video.
                callback_url:
                  type: string
                  format: uri
                  description: >-
                    Địa chỉ gọi lại khi hoàn thành tác vụ phải có thể truy cập
                    được qua mạng công cộng
                duration:
                  oneOf:
                    - type: string
                    - type: integer
                  description: >-
                    Thời lượng video (giây). o1: 5/10; v3-omni: 3~15; khi
                    refer_type=base, thông số này được xác định qua quá trình
                    phát hiện video và không cần được truyền.
                element_list:
                  type: array
                  items:
                    type: object
                    required:
                      - element_id
                    properties:
                      element_id:
                        oneOf:
                          - type: string
                          - type: integer
                        description: ID principal, từ giao diện tạo principal
                    x-apifox-orders:
                      - element_id
                    x-apidog-orders:
                      - element_id
                  description: Danh sách tài liệu tham khảo theo chủ đề.
                external_task_id:
                  type: string
                  description: >-
                    Mã định danh tác vụ bên ngoài của bên gọi, được dùng để đối
                    chiếu nghiệp vụ
                image_list:
                  type: array
                  items:
                    type: object
                    properties:
                      image_url:
                        type: string
                        description: URL hình ảnh hoặc Base64
                      type:
                        type: string
                        enum:
                          - first_frame
                          - end_frame
                        enumDetails:
                          - value: first_frame
                            displayName: Khung hình đầu tiên
                            description: Khung hình bắt đầu video
                          - value: end_frame
                            displayName: Khung hình cuối
                            description: Phải được ghép cặp với first_frame
                        description: >-
                          Loại khung hình đầu và cuối. Phải có first_frame nếu
                          có end_frame.
                    x-apifox-orders:
                      - image_url
                      - type
                    x-apidog-orders:
                      - image_url
                      - type
                  description: >-
                    Danh sách hình ảnh tham chiếu. Được dùng để tham chiếu chủ
                    thể/khung cảnh/phong cách hoặc làm khung hình đầu và cuối.
                mode:
                  type: string
                  enum:
                    - std
                    - pro
                    - 4k
                  enumDetails:
                    - value: std
                      displayName: Tiêu chuẩn
                    - value: chuyên nghiệp
                      displayName: Chất lượng cao
                      description: Cổng mặc định
                    - value: 4k
                      displayName: 4K
                      description: kling-v3-omni only
                  description: >-
                    Tạo lược đồ. Cổng mặc định là pro; chỉ kling-v3-omni hỗ trợ
                    4k.
                model_name:
                  type: string
                  enum:
                    - kling-video-o1
                    - kling-v3-omni
                  enumDetails:
                    - value: kling-video-o1
                      displayName: Video O1
                      description: Omni tiêu chuẩn; thời lượng chỉ là 5/10 giây
                    - value: kling-v3-omni
                      displayName: V3 Toàn năng
                      description: Hỗ trợ âm thanh, 4k, multi_shot; thời lượng 3–15 giây
                  description: >-
                    Tên mô hình Omni, bắt buộc. o1 không hỗ trợ
                    sound/4k/multi_shot; v3-omni có đầy đủ chức năng.
                multi_prompt:
                  type: array
                  items:
                    type: object
                    required:
                      - index
                      - prompt
                      - duration
                    properties:
                      duration:
                        oneOf:
                          - type: string
                          - type: number
                          - type: integer
                        description: Thời lượng của bảng phân cảnh (giây), ≥1
                      index:
                        type: integer
                        description: Số thứ tự bảng phân cảnh, bắt đầu từ 1
                      prompt:
                        type: string
                        description: Nội dung nhắc tạo bảng phân cảnh, ≤512 ký tự
                    x-apifox-orders:
                      - duration
                      - index
                      - prompt
                    x-apidog-orders:
                      - duration
                      - index
                      - prompt
                  description: >-
                    Danh sách bảng phân cảnh tùy chỉnh. Bắt buộc khi
                    shot_type=customize, tối đa 6 cảnh quay.
                multi_shot:
                  type: boolean
                  description: >-
                    Có sử dụng nhiều ống kính hay không, mặc định là false. Chỉ
                    kling-v3-omni mới có thể là true.
                prompt:
                  type: string
                  description: >-
                    Từ nhắc văn bản, ≤2500 ký tự. Bắt buộc khi
                    `multi_shot=false`; không hợp lệ khi `multi_shot=true`.
                shot_type:
                  type: string
                  enum:
                    - customize
                  enumDetails:
                    - value: tùy chỉnh
                      displayName: Ảnh chụp tùy chỉnh
                      description: >-
                        Yêu cầu multi_prompt; tổng thời lượng của các cảnh quay
                        bằng thời lượng cấp cao nhất
                  description: >-
                    Phương pháp lập bảng phân cảnh. Bắt buộc khi
                    multi_shot=true; customize phải khớp với multi_prompt.
                sound:
                  type: string
                  enum:
                    - 'on'
                    - 'off'
                  enumDetails:
                    - value: bật
                      displayName: Bật âm thanh
                      description: Chỉ dành cho v3-omni
                    - value: tắt
                      displayName: Lên tiếng
                      description: Mặc định không hiển thị thông báo
                  description: >-
                    Chuyển đổi có âm thanh. Chỉ bật trên kling-v3-omni; truyền
                    giá trị bật từ o1 sẽ dẫn đến lỗi 400.
                video_list:
                  type: array
                  items:
                    type: object
                    required:
                      - video_url
                      - refer_type
                    properties:
                      keep_original_sound:
                        type: string
                        enum:
                          - 'yes'
                          - 'no'
                        enumDetails:
                          - value: có
                            displayName: Giữ
                          - value: không
                            displayName: Không giữ lại
                        description: Có giữ lại âm thanh gốc của video hay không
                      refer_type:
                        type: string
                        enum:
                          - feature
                          - base
                        enumDetails:
                          - value: tính năng
                            displayName: Tham khảo tính năng
                            description: Không thể sử dụng cùng với sound=on (v3-omni)
                          - value: cơ sở
                            displayName: Để chỉnh sửa
                            description: >-
                              duration bị bỏ qua; được thay thế bằng độ dài
                              video
                        description: >-
                          feature=tham chieu tinh nang; base=chinh sua video
                          (thoi luong duoc xac dinh boi viec phat hien video).
                      video_url:
                        type: string
                        description: URL video tham khảo, có thể truy cập từ mạng công cộng
                    x-apifox-orders:
                      - keep_original_sound
                      - refer_type
                      - video_url
                    x-apidog-orders:
                      - keep_original_sound
                      - refer_type
                      - video_url
                  description: Danh sách video tham khảo, tối đa 1.
                watermark_info:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                      description: true tạo ra các kết quả có hình mờ
                  description: Cấu hình hình mờ, truyền trong suốt qua cổng
                  x-apifox-orders:
                    - enabled
                  x-apidog-orders:
                    - enabled
              refName: PostKlingV1VideosOmniVideoRequest
              x-apifox-orders:
                - aspect_ratio
                - callback_url
                - duration
                - element_list
                - external_task_id
                - image_list
                - mode
                - model_name
                - multi_prompt
                - multi_shot
                - prompt
                - shot_type
                - sound
                - video_list
                - watermark_info
              x-apidog-orders:
                - aspect_ratio
                - callback_url
                - duration
                - element_list
                - external_task_id
                - image_list
                - mode
                - model_name
                - multi_prompt
                - multi_shot
                - prompt
                - shot_type
                - sound
                - video_list
                - watermark_info
            examples:
              '1':
                value:
                  aspect_ratio: '16:9'
                  duration: '5'
                  mode: chuyên nghiệp
                  model_name: kling-video-o1
                  multi_shot: false
                  prompt: >-
                    Một cảnh quay từ trên không đậm chất điện ảnh trên hồ miền
                    núi phủ sương vào lúc bình minh
                summary: '1'
                description: >-
                  Khuyến nghị cho người mới: Video Omni Vincent · Quy trình gửi
                  tối thiểu khả dụng (o1)
              '2':
                value:
                  aspect_ratio: '16:9'
                  duration: '5'
                  image_list:
                    - image_url: '{{image_url_1}}'
                    - image_url: '{{image_url_2}}'
                  mode: chuyên nghiệp
                  model_name: kling-video-o1
                  multi_shot: false
                  prompt: >-
                    Nhân vật bước qua một con hẻm rực ánh đèn neon, theo phong
                    cách cyberpunk
                summary: '2'
                description: 'Khuyến nghị cho người mới: Video Omni Mat Tusheng · image_list'
              '3':
                value:
                  duration: '5'
                  image_list:
                    - image_url: https://example.com/first-frame.jpg
                      type: first_frame
                    - image_url: '{{end_frame_url}}'
                      type: end_frame
                  mode: chuyên nghiệp
                  model_name: kling-video-o1
                  multi_shot: false
                  prompt: >-
                    Chuyển cảnh mượt mà từ ban ngày sang ban đêm trên cùng một
                    con phố
                summary: '3'
                description: >-
                  Khuyến nghị cho người mới bắt đầu: Khung hình đầu và cuối Omni
                  · first_frame + end_frame
              '4':
                value:
                  aspect_ratio: '16:9'
                  duration: 8
                  mode: chuyên nghiệp
                  model_name: kling-v3-omni
                  multi_shot: false
                  prompt: Một ban nhạc jazz biểu diễn ở góc phố dưới trời mưa
                  sound: bật
                summary: '4'
                description: >-
                  Khuyên dùng cho người mới bắt đầu: Omni V3 có âm thanh ·
                  sound=on
              '5':
                value:
                  mode: chuyên nghiệp
                  model_name: kling-v3-omni
                  multi_shot: false
                  prompt: Thay nền bằng đường chân trời của một thành phố tương lai
                  video_list:
                    - keep_original_sound: không
                      refer_type: cơ sở
                      video_url: '{{video_url}}'
                summary: '5'
                description: 'Đề xuất nâng cao: Chỉnh sửa video Omni · refer_type=base'
              '6':
                value:
                  aspect_ratio: '16:9'
                  duration: '10'
                  mode: chuyên nghiệp
                  model_name: kling-video-o1
                  multi_shot: false
                  prompt: >-
                    Một vũ công mô phỏng phong cách chuyển động của video tham
                    chiếu
                  video_list:
                    - keep_original_sound: có
                      refer_type: tính năng
                      video_url: '{{ref_video_url}}'
                summary: '6'
                description: >-
                  Đề xuất nâng cao: Tài liệu tham khảo tính năng video Omni ·
                  refer_type=feature
              '7':
                value:
                  aspect_ratio: '1:1'
                  duration: 6
                  element_list:
                    - element_id: '{{element_id}}'
                  mode: chuyên nghiệp
                  model_name: kling-v3-omni
                  multi_shot: false
                  prompt: >-
                    Đối tượng bước vào một studio ngập tràn ánh nắng và vẫy tay
                    trước máy quay
                summary: '7'
                description: 'Khuyến nghị nâng cao: Tham chiếu body Omni · element_list'
              '8':
                value:
                  aspect_ratio: '16:9'
                  mode: chuyên nghiệp
                  model_name: kling-v3-omni
                  multi_prompt:
                    - duration: '3'
                      index: 1
                      prompt: Cảnh toàn của một sân ga tàu hỏa vắng người
                    - duration: '4'
                      index: 2
                      prompt: Tàu đến, cửa mở, hành khách xuống tàu
                    - duration: '3'
                      index: 3
                      prompt: Cận cảnh một tấm vé bay phấp phới trong gió
                  multi_shot: true
                  shot_type: tùy chỉnh
                summary: '8'
                description: 'Đề xuất nâng cao: Tùy chỉnh đa ống kính Omni V3'
              '9':
                value:
                  aspect_ratio: '9:16'
                  callback_url: https://example.com/callback
                  duration: 5
                  external_task_id: '{{external_task_id}}'
                  mode: chuyên nghiệp
                  model_name: kling-v3-omni
                  multi_shot: false
                  prompt: Sản phẩm trưng bày xoay trên một bục trắng tinh
                summary: '9'
                description: 'Khuyến nghị nâng cao: callback Omni và external_task_id'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                x-apidog-orders: []
              examples:
                example:
                  summary: example
                  value:
                    code: 0
                    data:
                      task_id: task_example_001
                    message: thành công
          headers: {}
          x-apidog-name: ''
        '400':
          description: Yêu cầu không hợp lệ hoặc xác thực thất bại
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - message
                      - type
                    properties:
                      message:
                        type: string
                        description: Thông báo lỗi (thường kết thúc bằng mã yêu cầu)
                      type:
                        type: string
                        description: Loại lỗi; các lỗi cổng cục bộ thường là new_api_error
                        examples:
                          - new_api_error
                    x-apifox-orders:
                      - message
                      - type
                    x-apidog-orders:
                      - message
                      - type
                refName: NewApiError
                x-apifox-orders:
                  - error
                x-apidog-orders:
                  - error
              examples:
                example:
                  summary: example
                  value:
                    error:
                      message: >-
                        Yêu cầu không hợp lệ (mã yêu cầu:
                        20260805120000123456789AbCdEfGh)
                      type: new_api_error
          headers: {}
          x-apidog-name: Yêu cầu không hợp lệ hoặc xác thực thất bại
        '401':
          description: Khóa API bị thiếu hoặc không hợp lệ
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - message
                      - type
                    properties:
                      message:
                        type: string
                        description: Thông báo lỗi (thường kết thúc bằng mã yêu cầu)
                      type:
                        type: string
                        description: Loại lỗi; các lỗi cổng cục bộ thường là new_api_error
                        examples:
                          - new_api_error
                    x-apifox-orders:
                      - message
                      - type
                    x-apidog-orders:
                      - message
                      - type
                refName: NewApiError
                x-apifox-orders:
                  - error
                x-apidog-orders:
                  - error
              examples:
                example:
                  summary: example
                  value:
                    error:
                      message: >-
                        Mã thông báo không hợp lệ (request id:
                        20260805120000123456789AbCdEfGh)
                      type: new_api_error
          headers: {}
          x-apidog-name: Khóa API bị thiếu hoặc không hợp lệ
      security: []
      x-apidog-folder: OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Video/Kling/Omni-Video
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45209016-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.openaihub.net
    description: Prod Env
security: []

```
