# "Tạo tác vụ video Tusheng"

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

> 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:
  /ent/v2/img2video:
    post:
      summary: Tạo tác vụ video Tusheng
      deprecated: false
      description: Tạo một video từ khung hình đầu tiên của hình ảnh.
      operationId: vidu_img2video
      tags:
        - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Video/Ví dụ
        - Ví dụ
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - images
              properties:
                aspect_ratio:
                  type: string
                  enum:
                    - '16:9'
                    - '9:16'
                    - '4:3'
                    - '3:4'
                    - '1:1'
                    - auto
                  description: 'Tỷ lệ khung hình, ví dụ: 16:9, 9:16, 1:1'
                audio:
                  type: boolean
                  description: Tham số hoặc URL liên quan đến âm thanh
                callback_url:
                  type: string
                  description: URL gọi lại khi hoàn tất tác vụ
                duration:
                  type: integer
                  description: Thời lượng video (giây)
                images:
                  type: array
                  items:
                    type: string
                  description: URL hình ảnh khung hình đầu tiên, chỉ 1
                model:
                  type: string
                  description: Tên mô hình
                prompt:
                  type: string
                  description: từ gợi ý văn bản
                resolution:
                  type: string
                  description: Độ phân giải, chẳng hạn như 720p/1080p
                seed:
                  type: integer
                  description: Hạt giống ngẫu nhiên, 0 là ngẫu nhiên
                watermark:
                  type: boolean
                  description: Có thêm hình mờ hay không
              refName: PostEntV2Img2videoRequest
              x-apifox-orders:
                - aspect_ratio
                - audio
                - callback_url
                - duration
                - images
                - model
                - prompt
                - resolution
                - seed
                - watermark
              x-apidog-orders:
                - aspect_ratio
                - audio
                - callback_url
                - duration
                - images
                - model
                - prompt
                - resolution
                - seed
                - watermark
            examples:
              viduq2_pro:
                value:
                  duration: 5
                  images:
                    - https://example.com/frame.jpg
                  model: viduq2-pro
                  prompt: Máy quay từ từ tiến lại gần
                summary: viduq2_pro
                description: video từ ảnh
      responses:
        '200':
          description: thành công
          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: thành công
        '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/Ví dụ
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45209071-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.openaihub.net
    description: Prod Env
security: []

```
