# "Tạo tác vụ"

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

> 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:
  /volc/v1/contents/generations/tasks:
    post:
      summary: Tạo tác vụ
      deprecated: false
      description: Gửi tác vụ tạo video Seedance/Doubao.
      operationId: volc_sample
      tags:
        - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Video/Doubao
        - Doubao Volc
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - content
              properties:
                callback_url:
                  type: string
                  description: URL gọi lại được kích hoạt khi tác vụ hoàn tất
                content:
                  type: array
                  items:
                    type: object
                    properties:
                      image_url:
                        type: object
                        properties:
                          url:
                            type: string
                            description: URL tài nguyên
                        description: URL hình ảnh
                        x-apifox-orders:
                          - url
                        x-apidog-orders:
                          - url
                      role:
                        type: string
                        enum:
                          - first_frame
                          - last_frame
                          - reference_image
                        description: >-
                          Vai trò của tin nhắn, ví dụ: system / user / assistant
                          / model
                      text:
                        type: string
                        description: Vui lòng cung cấp nội dung văn bản cần dịch.
                      type:
                        type: string
                        enum:
                          - text
                          - image_url
                        description: Kiểu
                    x-apifox-orders:
                      - image_url
                      - role
                      - text
                      - type
                    x-apidog-orders:
                      - image_url
                      - role
                      - text
                      - type
                  description: Mảng nội dung văn bản/hình ảnh
                model:
                  type: string
                  description: Tên mô hình
                  examples:
                    - doubao-seedance-2-0-260128
              refName: VolcSampleRequest
              x-apifox-orders:
                - callback_url
                - content
                - model
              x-apidog-orders:
                - callback_url
                - content
                - model
            examples:
              doubao_seedance_1_5_pro_251215:
                value:
                  content:
                    - text: >-
                        Cô gái ôm con cáo, cô gái mở mắt, dịu dàng nhìn về phía
                        máy quay, con cáo thân thiện ôm cô gái, máy quay từ từ
                        lùi ra xa, tóc cô gái lay động trong gió, có thể nghe
                        thấy tiếng gió.
                      type: text
                    - image_url:
                        url: >-
                          https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png
                      type: image_url
                  duration: 4
                  model: doubao-seedance-1-5-pro-251215
                  ratio: thích ứng
                  watermark: false
                summary: doubao_seedance_1_5_pro_251215
                description: seedance-1-5-pro
              doubao_seedance_2_0_260128:
                value:
                  content:
                    - text: Một con mèo đang chạy trên đồng cỏ.
                      type: text
                  model: doubao-seedance-2-0-260128
                summary: doubao_seedance_2_0_260128
                description: Video Vincent
              doubao_seedance_2_0_260128_2:
                value:
                  content:
                    - image_url:
                        url: https://example.com/frame.jpg
                      role: first_frame
                      type: image_url
                    - text: Máy quay tiến gần
                      type: text
                  model: doubao-seedance-2-0-260128
                summary: doubao_seedance_2_0_260128_2
                description: video từ ảnh
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - status
                properties:
                  id:
                    type: string
                    description: ID tài nguyên hoặc tác vụ
                  status:
                    type: string
                    description: Trạng thái
                refName: VolcSampleResponse
                x-apifox-orders:
                  - id
                  - status
                x-apidog-orders:
                  - id
                  - status
              examples:
                '1':
                  summary: '1'
                  value:
                    id: cgt-20250918170228-dw9rb
                    status: submitted
                '2':
                  summary: '2'
                  value:
                    id: cgt-20260108111352-gwv4p
                    status: submitted
          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/Doubao
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45209046-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.openaihub.net
    description: Prod Env
security: []

```
