> ## Documentation Index
> Fetch the complete documentation index at: https://powower.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 取消视频任务

> 取消仍在队列中的异步视频任务。当前支持 BytePlus（Seedance 系列）与 MiniMax Overseas H3 两个渠道。



## OpenAPI

````yaml api-reference/zh-Hans/zmodelVideo/minimax/cancel-video-task.json DELETE /v1/videos/{task_id}
openapi: 3.0.1
info:
  title: 取消视频任务
  version: 1.0.0
  description: 网关统一异步视频任务取消接口。当前支持 BytePlus（Seedance 等字节跳动视频模型）与 MiniMax Overseas H3 两个渠道。
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://baze-api.powerbuyin.top
    description: Baze API 服务地址
security: []
tags:
  - name: Hailuo Video
    description: Hailuo 视频任务状态查询与取消
paths:
  /v1/videos/{task_id}:
    delete:
      tags:
        - Hailuo Video
      summary: 取消视频任务
      description: 取消仍在队列中的异步视频任务。当前支持 BytePlus（Seedance 系列）与 MiniMax Overseas H3 两个渠道。
      operationId: cancelVideoTask
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
          description: >-
            待取消的任务 ID。必须是本网关公开的任务 ID（`tasks.task_id`），不是上游
            `provider_task_id`。只能取消当前账号创建的任务
      responses:
        '200':
          description: 取消成功。网关原样透传上游 DELETE 的状态码与响应体。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelVideoTaskResponse'
              examples:
                byteplus_cancelled:
                  summary: BytePlus 取消成功
                  value:
                    id: upstream_task_id
                    status: cancelled
                minimax_cancelled:
                  summary: MiniMax H3 取消成功
                  value:
                    action: cancel
                    status: cancelled
        '400':
          description: 前置条件不满足，网关自行组装错误响应，不会触达上游 DELETE。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                task_not_queueing:
                  summary: 上游任务非队列中
                  value:
                    error:
                      code: task_not_queueing
                      message: >-
                        upstream task status is running, only queued tasks can
                        be cancelled
                      type: invalid_request_error
                unsupported_platform:
                  summary: 渠道不支持取消
                  value:
                    error:
                      code: unsupported_platform
                      message: task cancellation is not supported for this platform
                      type: invalid_request_error
                invalid_request:
                  summary: 请求参数无效
                  value:
                    error:
                      code: invalid_request
                      message: task_id is required
                      type: invalid_request_error
        '401':
          description: 鉴权失败，例如未提供令牌或令牌无效。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: 未授权
                  value:
                    error:
                      code: access_denied
                      message: 无效的令牌
                      type: invalid_request_error
        '404':
          description: 任务不存在、不属于当前账号，或查询上游状态时上游返回 404。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                task_not_found:
                  summary: 任务不存在
                  value:
                    error:
                      code: task_not_found
                      message: task not found
                      type: invalid_request_error
                upstream_task_not_found:
                  summary: 上游任务不存在
                  value:
                    error:
                      code: upstream_task_not_found
                      message: upstream task not found
                      type: invalid_request_error
        '500':
          description: 网关内部处理失败，例如查询本地任务或渠道信息失败。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                db_error:
                  summary: 查询本地任务失败
                  value:
                    error:
                      code: db_error
                      message: failed to query task
                      type: invalid_request_error
                channel_not_found:
                  summary: 渠道配置缺失
                  value:
                    error:
                      code: channel_not_found
                      message: channel not found
                      type: invalid_request_error
        '502':
          description: 网关访问上游时发生网络故障。请求可能未成功发出，客户端可主动重试。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                upstream_query_failed:
                  summary: 查询上游状态失败
                  value:
                    error:
                      code: upstream_query_failed
                      message: failed to query upstream task status
                      type: invalid_request_error
                upstream_request_failed:
                  summary: 上游 DELETE 请求失败
                  value:
                    error:
                      code: upstream_request_failed
                      message: failed to request upstream cancellation
                      type: invalid_request_error
                upstream_read_failed:
                  summary: 读取上游响应失败
                  value:
                    error:
                      code: upstream_read_failed
                      message: failed to read upstream response
                      type: invalid_request_error
      security:
        - BearerAuth: []
components:
  schemas:
    CancelVideoTaskResponse:
      type: object
      description: 取消结果由上游原样返回，不同渠道字段略有差异。
      properties:
        id:
          type: string
          description: 上游任务 ID（BytePlus）。
        task_id:
          type: string
          description: 上游任务 ID（MiniMax H3）。
        action:
          type: string
          description: 执行的操作（MiniMax H3），例如 `cancel`。
        status:
          type: string
          description: 操作结果：`cancelled`（取消成功）或 `deleted`（记录已删除）。
          enum:
            - cancelled
            - deleted
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                错误码，如
                `task_not_queueing`、`unsupported_platform`、`task_not_found`。
            message:
              type: string
              description: 错误说明。
            type:
              type: string
              description: 错误类型，例如 `invalid_request_error`。
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '在请求头中传入 `Authorization: Bearer <token>`。'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.