# "văn bản thành video"

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

> 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/text-to-video/kling-3.0-turbo:
    post:
      summary: văn bản thành video
      deprecated: false
      description: ''
      operationId: post-kling-text-to-video-kling-3-0-turbo
      tags:
        - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Video/Kling/Keling 3.0turbo
        - 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: Accept
          in: header
          description: Content-Type dự kiến của phản hồi
          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
              properties:
                contents:
                  type: array
                  items:
                    type: object
                    required:
                      - type
                      - text
                    properties:
                      text:
                        type: string
                        description: >-
                          Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên
                          Markdown, mã, định danh, URL, đường dẫn, phần giữ chỗ,
                          cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch
                          và không để lại ký tự Hán nào.


                          Văn bản lời nhắc, tối đa 3072 ký tự.
                      type:
                        type: string
                        description: >-
                          Kiểu của text-to-video phải là "prompt"; "first_frame"
                          trả về mã lỗi 400.
                    x-apifox-orders:
                      - text
                      - type
                    x-apidog-orders:
                      - text
                      - type
                  description: >-
                    [Thay thế] Dạng mảng prompt, loại trừ lẫn nhau với prompt
                    cấp cao nhất. Loại của từng mục phải là "prompt" (chuyển văn
                    bản thành video không hỗ trợ first_frame). Gateway trích
                    xuất contents[].text vào prompt cấp cao nhất rồi chuyển tiếp
                    đến dịch vụ thượng nguồn.
                options:
                  type: object
                  properties:
                    callback_url:
                      type: string
                      format: uri
                      description: >-
                        URL callback ngược dòng sau khi tác vụ hoàn tất (phải có
                        thể truy cập công khai).
                    external_task_id:
                      type: string
                      description: >-
                        Mã định danh tác vụ bên ngoài do bên gọi xác định, dùng
                        cho các truy vấn có tính lũy đẳng và việc đối soát.
                    watermark_info:
                      type: object
                      description: >-
                        Cấu hình hình mờ do hệ thống nguồn xác định, được chuyển
                        tiếp nguyên trạng.
                      x-apidog-orders: []
                  description: Các tham số điều khiển tác vụ, tất cả đều không bắt buộc.
                  x-apifox-orders:
                    - callback_url
                    - external_task_id
                    - watermark_info
                  x-apidog-orders:
                    - callback_url
                    - external_task_id
                    - watermark_info
                prompt:
                  type: string
                  description: >-
                    [Khuyến nghị] Lời nhắc cấp cao nhất. Tối đa 3072 ký tự. Dấu
                    câu toàn chiều rộng (, ; : ) được cổng tự động chuyển đổi
                    thành dạng nửa chiều rộng. Loại trừ lẫn nhau với contents[];
                    nếu cả hai đều được thiết lập, contents[] sẽ bị bỏ qua.
                settings:
                  type: object
                  properties:
                    aspect_ratio:
                      type: string
                      enum:
                        - '16:9'
                        - '9:16'
                        - '1:1'
                      enumDetails:
                        - value: '16:9'
                          displayName: Khung ngang 16:9
                          description: Mặc định; dành cho chế độ ngang / máy tính để bàn
                        - value: '9:16'
                          displayName: Chân dung 9:16
                          description: >-
                            dành cho video ngắn / chế độ dọc trên thiết bị di
                            động
                        - value: '1:1'
                          displayName: hình vuông 1:1
                          description: dành cho ảnh bìa vuông trên mạng xã hội
                      description: Tỷ lệ khung hình, mặc định là 16:9.
                    duration:
                      type: integer
                      description: >-
                        Thời lượng video (giây), trong khoảng 3–15, mặc định là
                        5. Chi phí được tính tăng tuyến tính theo thời lượng.
                    resolution:
                      type: string
                      enum:
                        - 720p
                        - 1080p
                      enumDetails:
                        - value: 720p
                          displayName: SD 720p
                          description: Mặc định; hệ số nhân thanh toán cơ sở
                        - value: 1080p
                          displayName: HD 1080p
                          description: Chi phí ~1.5×, chất lượng cao hơn
                      description: >-
                        Độ phân giải đầu ra, mặc định là 720p. 1080p được tính
                        phí ~1,25×.
                  description: >-
                    Các tham số tạo, tất cả đều không bắt buộc. Giá trị mặc định
                    của Gateway khi bị thiếu: resolution=720p,
                    aspect_ratio=16:9, duration=5.
                  x-apifox-orders:
                    - aspect_ratio
                    - duration
                    - resolution
                  x-apidog-orders:
                    - aspect_ratio
                    - duration
                    - resolution
              description: >-
                Phần thân Kling 3.0 Turbo T2V. Cung cấp lời nhắc qua `prompt`
                cấp cao nhất hoặc `contents[]`; `prompt` cấp cao nhất được ưu
                tiên.
              x-apifox-orders:
                - contents
                - options
                - prompt
                - settings
              x-apidog-orders:
                - contents
                - options
                - prompt
                - settings
            examples:
              '1':
                value:
                  contents:
                    - text: Một con mèo đang chạy
                      type: prompt
                  settings:
                    duration: 5
                    resolution: 720p
                summary: '1'
              '2':
                value:
                  prompt: >-
                    Người phụ nữ trẻ đang đi bộ trên con phố Tokyo rực sáng ánh
                    đèn neon vào ban đêm, chuyển động chậm
                  settings:
                    aspect_ratio: '9:16'
                    duration: 5
                    resolution: 720p
                summary: '2'
              '3':
                value:
                  prompt: >-
                    Cà phê đang được rót vào một chiếc cốc thủy tinh, cảnh quay
                    cận cảnh, tông màu ấm
                  settings:
                    aspect_ratio: '1:1'
                    duration: 5
                    resolution: 720p
                summary: '3'
              '4':
                value:
                  prompt: >-
                    Toàn cảnh hùng vĩ từ trên cao của dãy núi Trương Gia Giới
                    nhô lên giữa biển mây, vào giờ vàng, cảnh quay điện ảnh bằng
                    thiết bị bay không người lái
                  settings:
                    aspect_ratio: '16:9'
                    duration: 10
                    resolution: 1080p
                summary: '4'
              '5':
                value:
                  prompt: >-
                    Người mẫu thời trang sải bước trên sàn diễn, ánh sáng biến
                    đổi linh hoạt, phong cách biên tập thời trang cao cấp
                  settings:
                    aspect_ratio: '9:16'
                    duration: 15
                    resolution: 1080p
                summary: '5'
              '6':
                value:
                  contents:
                    - text: >-
                        Lá thu rơi trong một khu vườn Nhật Bản, bóng phản chiếu
                        trên hồ cá koi, bầu không khí yên bình
                      type: prompt
                  options:
                    callback_url: https://your-server.com/webhook/kling
                    external_task_id: biz-order-20240623-001
                  settings:
                    aspect_ratio: '16:9'
                    duration: 8
                    resolution: 720p
                summary: '6'
              '7':
                value:
                  prompt: >-
                    Cảnh 1,2,một phụ nữ trẻ đứng bên cửa sổ nhìn ra ngoài, ánh
                    sáng ban mai lọt vào;Cảnh 2,3,cô ấy quay lại với nụ cười,
                    tay cầm tách cà phê;Cảnh 3,5,cô ấy bước ra ban công, đường
                    chân trời thành phố ở phía sau, giờ vàng;
                  settings:
                    aspect_ratio: '16:9'
                    duration: 10
                    resolution: 1080p
                summary: '7'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: 0 = thành công; khác 0 = thất bại; xem thông báo
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: ID tác vụ (ưu tiên)
                      status:
                        type: string
                        description: 'Trạng thái tác vụ ban đầu, ví dụ: đã gửi / đang chờ'
                      task_id:
                        type: string
                        description: >-
                          ID tác vụ (dự phòng; một số hệ thống nguồn trả về
                          trường này)
                      task_status:
                        type: string
                        description: >-
                          Giống như trạng thái; tên trường thay đổi tùy theo
                          nguồn cung cấp phía trên
                    description: >-
                      Thông tin tác vụ. Cả `id` và `task_id` đều có thể chứa mã
                      tác vụ; ưu tiên `id`.
                    x-apifox-orders:
                      - id
                      - status
                      - task_id
                      - task_status
                    x-apidog-orders:
                      - id
                      - status
                      - task_id
                      - task_status
                  message:
                    type: string
                    description: Vui lòng cung cấp nội dung tài liệu cần dịch.
                  request_id:
                    type: string
                    description: >-
                      ID yêu cầu phía thượng nguồn; cung cấp cho bộ phận hỗ trợ
                      phía thượng nguồn khi khắc phục sự cố
                x-apifox-orders:
                  - code
                  - data
                  - message
                  - request_id
                x-apidog-orders:
                  - code
                  - data
                  - message
                  - request_id
              examples:
                example:
                  summary: example
                  value:
                    code: 0
                    data:
                      id: string
                      status: string
                      task_id: chuỗi
                      task_status: chuỗi
                    message: chuỗi
          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/Keling 3.0turbo
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45209013-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.openaihub.net
    description: Prod Env
security: []

```
