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

# wan2-task-query

> 轮询视频生成任务的状态，直到 `status` 变为 `succeeded` 或 `failed`。



## OpenAPI

````yaml zh/api-reference/model-api/alibaba/openapi/wan2-task-query/openapi.yaml GET /v1/video/generations/{task_id}
openapi: 3.1.0
info:
  title: Wan 视频任务查询
  description: 查询 Wan2 视频生成任务的状态和结果
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/video/generations/{task_id}:
    get:
      summary: 查询视频任务
      description: 轮询视频生成任务的状态，直到 `status` 变为 `succeeded` 或 `failed`。
      operationId: queryWanVideoTask
      parameters:
        - name: task_id
          in: path
          required: true
          description: 创建任务接口返回的任务 ID。
          schema:
            type: string
            example: task_abc123
      responses:
        '200':
          description: 查询成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: 0 表示成功。
                    example: 0
                  data:
                    type: object
                    properties:
                      task_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - queued
                          - processing
                          - succeeded
                          - failed
                        description: 任务状态。
                      format:
                        type: string
                        description: 视频格式（如 `mp4`）。
                      url:
                        type: string
                        description: 成功后的视频下载链接（有效期约 24 小时）。
                      error:
                        type: string
                        description: 失败时的错误信息。
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: 任务不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````