> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiid.edu.kg/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling Chuyển hình ảnh thành video

> Dòng này hỗ trợ định dạng tạo video OpenAI (xem chi tiết tại liên kết [Định dạng tương thích với Sora tạo video](/api-reference/vi/tao-video-dinh-dang-tuong-thich-sora/tao-video)).

Dùng mô hình Kling để tạo video từ hình ảnh.

Hỗ trợ truyền URL hình ảnh hoặc dữ liệu hình ảnh mã hóa Base64 thông qua tham số image.



## OpenAPI

````yaml api-reference/vi/openapi.json POST /kling/v1/videos/image2video
openapi: 3.0.0
info:
  title: Tài liệu tham khảo API của 出海营
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.aiid.edu.kg
security:
  - BearerAuth: []
tags:
  - name: Định dạng OpenAI (Chat)
  - name: Định dạng OpenAI (Responses)
  - name: Định dạng Gemini cho tạo ảnh
  - name: Tạo hình ảnhOpenAI định dạng DALL-E
  - name: Lấy danh sách mô hình
  - name: Tạo video HappyHorse và Wan
  - name: Định dạngKling tạo video
  - name: Định dạng Video Generation Omni và Veo
  - name: Tạo video Seedance
  - name: Định dạng tương thích Sora cho tạo video
  - name: Tạo video Vidu
  - name: Định dạng tác vụ tạo nhạc
paths:
  /kling/v1/videos/image2video:
    post:
      tags:
        - Định dạngKling tạo video
      summary: Kling Chuyển hình ảnh thành video
      description: >-
        Dòng này hỗ trợ định dạng tạo video OpenAI (xem chi tiết tại liên kết
        [Định dạng tương thích với Sora tạo
        video](/api-reference/vi/tao-video-dinh-dang-tuong-thich-sora/tao-video)).


        Dùng mô hình Kling để tạo video từ hình ảnh.


        Hỗ trợ truyền URL hình ảnh hoặc dữ liệu hình ảnh mã hóa Base64 thông qua
        tham số image.
      operationId: createKlingImage2Video
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoRequest'
            example:
              model: kling-v1
              prompt: 人物转身走开
              image: https://example.com/image.jpg
              duration: 5
              width: 1280
              height: 720
      responses:
        '200':
          description: Đã tạo tác vụ tạo video thành công
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoResponse'
          headers: {}
        '400':
          description: Tham số yêu cầu bị lỗi
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    VideoRequest:
      type: object
      description: Yêu cầu tạo video
      properties:
        model:
          type: string
          description: ID Mô hình/Phong cách
          example: kling-v1
        prompt:
          type: string
          description: Lời nhắc mô tả văn bản
          example: 宇航员站起身走了
        image:
          type: string
          description: Đầu vào hình ảnh (URL hoặc Base64)
          example: https://example.com/image.jpg
        duration:
          type: number
          description: Thời lượng video (giây)
          example: 5
        width:
          type: integer
          description: Chiều rộng video
          example: 1280
        height:
          type: integer
          description: Chiều cao video
          example: 720
        fps:
          type: integer
          description: Tốc độ khung hình video
          example: 30
        seed:
          type: integer
          description: Seed ngẫu nhiên
          example: 20231234
        'n':
          type: integer
          description: Số lượng video đã tạo
          example: 1
        response_format:
          type: string
          description: Định dạng phản hồi
          example: url
        user:
          type: string
          description: ID người dùng
          example: user-1234
        metadata:
          type: object
          description: Tham số mở rộng (như negative_prompt, style, quality_level, v.v.)
          additionalProperties: true
          properties: {}
    VideoResponse:
      type: object
      description: Phản hồi gửi nhiệm vụ tạo video
      properties:
        task_id:
          type: string
          description: ID nhiệm vụ
          example: abcd1234efgh
        status:
          type: string
          description: Trạng thái nhiệm vụ
          example: queued
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Thông báo lỗi
            type:
              type: string
              description: Loại lỗi
            param:
              type: string
              description: Các tham số liên quan
              nullable: true
            code:
              type: string
              description: Mã lỗi
              nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        Sử dụng xác thực Bearer Token.
        Định dạng: `Authorization: Bearer sk-xxxxxx`

````