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

# Wan2.2 和 Wan2.6 视频生成

> 返回 task_id 后，使用 GET /v1/video/generations/{task_id} 查询状态和结果。



## OpenAPI

````yaml api-reference/model-api/alibaba/openapi/wan-video/openapi.yaml POST /v1/video/generations
openapi: 3.1.0
info:
  title: Wan2.2 和 Wan2.6 视频生成
  version: 1.0.0
  description: 通过 AnyFast 国内站异步创建 Wan2.2 和 Wan2.6 视频任务。
servers:
  - url: https://www.anyfast.com.cn
security:
  - bearerAuth: []
paths:
  /v1/video/generations:
    post:
      summary: 创建视频生成任务
      description: 返回 task_id 后，使用 GET /v1/video/generations/{task_id} 查询状态和结果。
      operationId: createWanVideoGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVideoRequest'
            examples:
              imageToVideo:
                summary: 图生视频
                value:
                  model: wan2.6-i2v
                  prompt: 镜头缓慢推进，海浪拍打礁石
                  image: https://example.com/first-frame.jpg
              textToVideo:
                summary: 文生视频
                value:
                  model: wan2.2-t2v-plus
                  prompt: 一艘帆船驶过平静的海面
      responses:
        '200':
          description: 任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateVideoResponse'
        '400':
          description: 请求参数错误
        '401':
          description: API Key 无效或缺失
        '403':
          description: 账户权限或额度不足
        '429':
          description: 请求频率超限
components:
  schemas:
    CreateVideoRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          enum:
            - wan2.2-i2v-flash
            - wan2.2-i2v-plus
            - wan2.2-kf2v-flash
            - wan2.2-t2v-plus
            - wan2.6-i2v
            - wan2.6-i2v-flash
        prompt:
          type: string
          description: 视频内容提示词。
        image:
          type: string
          format: uri
          description: 图生视频模型使用的首帧图片 URL。
        first_frame_image:
          type: string
          format: uri
          description: 首尾帧任务使用的首帧图片 URL；具体字段兼容性以端点校验为准。
        last_frame_image:
          type: string
          format: uri
          description: 首尾帧任务使用的尾帧图片 URL；具体字段兼容性以端点校验为准。
        duration:
          type: number
          description: 输出时长（秒）；可用范围随模型版本变化。
        width:
          type: integer
          description: 输出宽度（像素）。
        height:
          type: integer
          description: 输出高度（像素）。
        seed:
          type: integer
          description: 随机种子。
        metadata:
          type: object
          additionalProperties: true
          description: 传递给模型的其他受支持参数。
    CreateVideoResponse:
      type: object
      properties:
        id:
          type: string
        task_id:
          type: string
        object:
          type: string
          example: video
        model:
          type: string
          example: wan2.6-i2v
        status:
          type: string
          example: queued
        progress:
          type: integer
          example: 0
        created_at:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````