# "Omni-Image"

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

> 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/images/omni-image:
    post:
      summary: Omni-Image
      deprecated: false
      description: ''
      operationId: post-kling-v1-images-omni-image
      tags:
        - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Video/Kling/Omni-Image
        - 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
                - prompt
              properties:
                aspect_ratio:
                  type: string
                  description: |-
                    Tỷ lệ khung hình (R:C)
                    enum: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, auto
                    auto: tự động xác định thông minh từ đầu vào
                    bị bỏ qua khi khớp với tỷ lệ khung hình của nguồn
                callback_url:
                  type: string
                  description: URL gọi lại được kích hoạt khi tác vụ hoàn tất
                external_task_id:
                  type: string
                  description: >-
                    Mã định danh tác vụ bên ngoài tùy chỉnh để đối chiếu phía
                    nghiệp vụ
                image_list:
                  type: array
                  items:
                    type: object
                    properties:
                      image:
                        type: string
                        description: URL hình ảnh hoặc Base64
                    x-apifox-orders:
                      - image
                    x-apidog-orders:
                      - image
                  description: danh sách hình ảnh tham chiếu
                model_name:
                  type: string
                  description: 'Liệt kê tên mô hình: kling-image-o1,kling-v3-omni'
                'n':
                  type: integer
                  description: 'Phạm vi số lượng hình ảnh cần tạo: [1,9]'
                prompt:
                  type: string
                  description: >-
                    lời nhắc dạng văn bản, có thể bao gồm mô tả tích cực và tiêu
                    cực

                    có thể sử dụng các mẫu cho những nhu cầu hình ảnh khác nhau

                    tối đa 2500 ký tự
                resolution:
                  type: string
                  description: |-
                    Liệt kê độ rõ đầu ra: 1k, 2k
                    1k: SD 1K
                    2k: HD 2K
                result_type:
                  type: string
                  description: |-
                    Chuyển đổi đơn / chuỗi
                    enum: single, series
                series_amount:
                  type: integer
                  description: |-
                    Hình ảnh trong chuỗi
                    ● range: [2, 9]
                    bị bỏ qua khi result_type là single
                watermark_info:
                  type: object
                  required:
                    - enabled
                  properties:
                    enabled:
                      type: boolean
                      description: Có được bật hay không
                  description: >-
                    có đồng thời tạo kết quả có hình mờ hay không

                    ● được xác định bởi enabled, dưới dạng khóa:giá trị, như
                    sau: : "watermark_info": { "enabled": boolean // true=tạo,
                    false=không tạo

                    }

                    ● hình mờ tùy chỉnh hiện chưa được hỗ trợ
                  x-apifox-orders:
                    - enabled
                  x-apidog-orders:
                    - enabled
              x-apifox-orders:
                - aspect_ratio
                - callback_url
                - external_task_id
                - image_list
                - model_name
                - 'n'
                - prompt
                - resolution
                - result_type
                - series_amount
                - watermark_info
              x-apidog-orders:
                - aspect_ratio
                - callback_url
                - external_task_id
                - image_list
                - model_name
                - 'n'
                - prompt
                - resolution
                - result_type
                - series_amount
                - watermark_info
            examples:
              example:
                value:
                  aspect_ratio: ''
                  callback_url: ''
                  element_list:
                    - element_id: '835266081714884677'
                  external_task_id: ''
                  model_name: kling-image-o1
                  'n': 1
                  prompt: Tạo một bức ảnh về cảnh nhảy múa bên bờ biển
                  resolution: ''
                summary: example
      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-Image
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208995-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.openaihub.net
    description: Prod Env
security: []

```
