# Wan-AI Wan2.7 图像任务状态

> 图像生成

查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。

## 请求地址

`GET https://api.modelverse.cn/v1/tasks/status`

## 请求参数

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| task_id | query | string | Yes | Asynchronous task identifier returned by `/v1/tasks/submit`. |

## 响应

- **200** — 任务状态响应。
- **400** — 任务标识无效或任务状态查询失败。
- **default** — 错误响应。

## OpenAPI 定义

```json
{
  "openapi": "3.1.0",
  "x-language": "zh-CN",
  "info": {
    "title": "Wan-AI-Wan2.7-Image接口文档",
    "version": "1.0.0",
    "description": "这是 ModelVerse 上 `Wan-AI-Wan2.7-Image` 的图片接口文档，说明如何发起图片生成或编辑请求、填写参数、读取结果以及处理错误。\n接口路径包括 `POST /v1/images/generations`、`POST /v1/tasks/submit`、`GET /v1/tasks/status`。\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "该模型文档中使用的 ModelVerse API 端点。"
    }
  ],
  "tags": [
    {
      "name": "Wan-AI/Wan2.7 Image",
      "description": "Synchronous and asynchronous image generation operations for Wan-AI/Wan2.7."
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/images/generations": {
      "post": {
        "tags": [
          "Wan-AI/Wan2.7 Image"
        ],
        "operationId": "createWanAIWan27ImageGeneration",
        "summary": "Wan-AI Wan2.7 图像生成",
        "description": "发起图片生成请求。请求体包含模型、提示词和可选生成参数，响应返回图片 URL 或 Base64 图像数据。\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WanAIWan27ImageGenerationRequest"
              },
              "examples": {
                "textToImage": {
                  "summary": "文生图",
                  "value": {
                    "model": "wan2.7-image",
                    "prompt": "A futuristic cloud data center floating above the sea at sunrise",
                    "size": "1K",
                    "seed": 123456,
                    "watermark": false
                  }
                },
                "singleImageEdit": {
                  "summary": "单图编辑",
                  "value": {
                    "model": "wan2.7-image-pro",
                    "prompt": "把这只猫改成赛博朋克风格，霓虹灯光，电影感构图",
                    "image": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
                    "size": "2K",
                    "thinking_mode": true,
                    "watermark": false
                  }
                },
                "multiImageFusion": {
                  "summary": "多图融合",
                  "value": {
                    "model": "wan2.7-image-pro",
                    "prompt": "融合两张参考图的主体特征，生成一张高级感品牌海报",
                    "images": [
                      "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
                      "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg"
                    ],
                    "size": "2048*2048",
                    "thinking_mode": true,
                    "seed": 20260402
                  }
                },
                "sequentialImageGeneration": {
                  "summary": "连续多图生成",
                  "value": {
                    "model": "wan2.7-image-pro",
                    "prompt": "生成一组同一角色在春夏秋冬四季中的海报，人物形象保持一致",
                    "size": "2K",
                    "thinking_mode": true,
                    "enable_sequential": true,
                    "n": 4
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image generation response. Generated image URLs are valid for 24 hours.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WanAIWan27ImageGenerationResponse"
                },
                "examples": {
                  "generatedImages": {
                    "summary": "生成图像 URL",
                    "value": {
                      "created": 1775558400,
                      "data": [
                        {
                          "url": "https://example.com/generated-image-1.png"
                        },
                        {
                          "url": "https://example.com/generated-image-2.png"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求参数无效或图像生成失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WanAIWan27ImageErrorResponse"
                },
                "examples": {
                  "invalidImageUrl": {
                    "$ref": "#/components/examples/WanAIWan27ImageInvalidImageUrlError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WanAIWan27ImageErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/WanAIWan27ImageInvalidImageUrlError"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/submit": {
      "post": {
        "tags": [
          "Wan-AI/Wan2.7 Image"
        ],
        "operationId": "submitWanAIWan27ImageTask",
        "summary": "Wan-AI Wan2.7 异步图像生成",
        "description": "提交异步任务。请求体中的模型和参数按本模型文档填写，响应会返回任务 ID。\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WanAIWan27ImageTaskSubmitRequest"
              },
              "examples": {
                "textToImage": {
                  "summary": "文生图任务",
                  "value": {
                    "model": "wan2.7-image",
                    "input": {
                      "prompt": "A futuristic cloud data center floating above the sea at sunrise"
                    },
                    "parameters": {
                      "size": "1K",
                      "seed": 123456
                    }
                  }
                },
                "singleImageEdit": {
                  "summary": "单图编辑任务",
                  "value": {
                    "model": "wan2.7-image-pro",
                    "input": {
                      "prompt": "把这只猫改成赛博朋克风格，霓虹灯光，电影感构图",
                      "img_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg"
                    },
                    "parameters": {
                      "size": "2K",
                      "prompt_extend": true,
                      "watermark": false
                    }
                  }
                },
                "multiImageFusion": {
                  "summary": "多图融合任务",
                  "value": {
                    "model": "wan2.7-image-pro",
                    "input": {
                      "prompt": "融合两张参考图的主体特征，生成一张高级感品牌海报",
                      "images": [
                        "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
                        "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg"
                      ]
                    },
                    "parameters": {
                      "size": "2048*2048",
                      "prompt_extend": true,
                      "seed": 20260402
                    }
                  }
                },
                "sequentialImageGeneration": {
                  "summary": "连续多图生成任务",
                  "value": {
                    "model": "wan2.7-image-pro",
                    "input": {
                      "prompt": "生成一组同一角色在春夏秋冬四季中的海报，人物形象保持一致"
                    },
                    "parameters": {
                      "size": "2K",
                      "prompt_extend": true,
                      "enable_sequential": true,
                      "n": 4
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务提交成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WanAIWan27ImageTaskSubmitResponse"
                },
                "examples": {
                  "submitted": {
                    "summary": "已提交任务",
                    "value": {
                      "output": {
                        "task_id": "3c7d6b6c-7cdb-4f37-bf41-7f2b0f1a9f0d"
                      },
                      "request_id": "req_202604021530000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters or task submission error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WanAIWan27ImageErrorResponse"
                },
                "examples": {
                  "invalidImageUrl": {
                    "$ref": "#/components/examples/WanAIWan27ImageInvalidImageUrlError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WanAIWan27ImageErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/WanAIWan27ImageInvalidImageUrlError"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/status": {
      "get": {
        "tags": [
          "Wan-AI/Wan2.7 Image"
        ],
        "operationId": "getWanAIWan27ImageTaskStatus",
        "summary": "Wan-AI Wan2.7 图像任务状态",
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n",
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "Asynchronous task identifier returned by `/v1/tasks/submit`.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "documented": {
                "summary": "源文档占位值",
                "value": "<task_id>"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WanAIWan27ImageTaskStatusResponse"
                },
                "examples": {
                  "success": {
                    "summary": "成功任务",
                    "value": {
                      "output": {
                        "task_id": "3c7d6b6c-7cdb-4f37-bf41-7f2b0f1a9f0d",
                        "task_status": "Success",
                        "urls": [
                          "https://example.com/generated-image-1.png",
                          "https://example.com/generated-image-2.png",
                          "https://example.com/generated-image-3.png",
                          "https://example.com/generated-image-4.png"
                        ],
                        "submit_time": 1775115000,
                        "finish_time": 1775115038
                      },
                      "usage": {
                        "completion_tokens": 4,
                        "total_tokens": 4
                      },
                      "request_id": ""
                    }
                  },
                  "failure": {
                    "summary": "失败任务",
                    "value": {
                      "output": {
                        "task_id": "3c7d6b6c-7cdb-4f37-bf41-7f2b0f1a9f0d",
                        "task_status": "Failure",
                        "submit_time": 1775115000,
                        "finish_time": 1775115012,
                        "error_message": "code=InvalidParameter, message=invalid image url"
                      },
                      "request_id": ""
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "任务标识无效或任务状态查询失败。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WanAIWan27ImageErrorResponse"
                },
                "examples": {
                  "invalidTaskId": {
                    "$ref": "#/components/examples/WanAIWan27ImageInvalidTaskIdError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WanAIWan27ImageErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/WanAIWan27ImageInvalidTaskIdError"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n"
      }
    },
    "schemas": {
      "WanAIWan27ImageModel": {
        "type": "string",
        "enum": [
          "wan2.7-image",
          "wan2.7-image-pro"
        ],
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n"
      },
      "WanAIWan27ImageGenerationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model"
        ],
        "anyOf": [
          {
            "required": [
              "prompt"
            ]
          },
          {
            "required": [
              "image"
            ]
          },
          {
            "required": [
              "images"
            ]
          }
        ],
        "properties": {
          "model": {
            "$ref": "#/components/schemas/WanAIWan27ImageModel"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "description": "Text prompt. At least one of `prompt`, `image`, or `images` must be provided."
          },
          "image": {
            "$ref": "#/components/schemas/WanAIWan27ImageInputImage"
          },
          "images": {
            "$ref": "#/components/schemas/WanAIWan27ImageInputImages"
          },
          "size": {
            "$ref": "#/components/schemas/WanAIWan27ImageSize"
          },
          "n": {
            "$ref": "#/components/schemas/WanAIWan27ImageCount"
          },
          "seed": {
            "type": "integer",
            "minimum": 0,
            "description": "Random seed. The source recommends a positive integer; `0` or omission is treated as unset."
          },
          "watermark": {
            "type": "boolean",
            "default": false,
            "description": "Whether to add a watermark."
          },
          "thinking_mode": {
            "type": "boolean",
            "default": true,
            "description": "Whether to enable deep thinking mode. This is effective only when\nsequential generation is disabled and no image input is provided.\nEnabling it can improve image quality but increases latency.\n"
          },
          "enable_sequential": {
            "type": "boolean",
            "default": false,
            "description": "Whether to enable sequential multi-image/group-image generation."
          }
        }
      },
      "WanAIWan27ImageTaskSubmitRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "$ref": "#/components/schemas/WanAIWan27ImageModel"
          },
          "input": {
            "$ref": "#/components/schemas/WanAIWan27ImageTaskInput"
          },
          "parameters": {
            "$ref": "#/components/schemas/WanAIWan27ImageTaskParameters"
          }
        }
      },
      "WanAIWan27ImageTaskInput": {
        "type": "object",
        "additionalProperties": false,
        "anyOf": [
          {
            "required": [
              "prompt"
            ]
          },
          {
            "required": [
              "images"
            ]
          },
          {
            "required": [
              "img_url"
            ]
          },
          {
            "required": [
              "first_frame_url"
            ]
          }
        ],
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "description": "文本提示词。"
          },
          "images": {
            "$ref": "#/components/schemas/WanAIWan27ImageInputImages"
          },
          "img_url": {
            "$ref": "#/components/schemas/WanAIWan27ImageInputImage"
          },
          "first_frame_url": {
            "$ref": "#/components/schemas/WanAIWan27ImageInputImage"
          }
        }
      },
      "WanAIWan27ImageTaskParameters": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "size": {
            "$ref": "#/components/schemas/WanAIWan27ImageSize"
          },
          "n": {
            "$ref": "#/components/schemas/WanAIWan27ImageCount"
          },
          "seed": {
            "type": "integer",
            "minimum": 0,
            "description": "Random seed. The source recommends a positive integer; `0` or omission is treated as unset."
          },
          "watermark": {
            "type": "boolean",
            "description": "Whether to add a watermark."
          },
          "enable_sequential": {
            "type": "boolean",
            "default": false,
            "description": "Whether to enable sequential multi-image/group-image generation."
          },
          "prompt_extend": {
            "type": "boolean",
            "description": "Prompt enhancement switch. Passing `true` maps to Wan2.7 `thinking_mode=true`."
          }
        }
      },
      "WanAIWan27ImageInputImage": {
        "type": "string",
        "minLength": 1,
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n",
        "examples": [
          "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg"
        ]
      },
      "WanAIWan27ImageInputImages": {
        "type": "array",
        "minItems": 1,
        "maxItems": 9,
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n",
        "items": {
          "$ref": "#/components/schemas/WanAIWan27ImageInputImage"
        }
      },
      "WanAIWan27ImageSize": {
        "type": "string",
        "default": "2K",
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n",
        "oneOf": [
          {
            "enum": [
              "1K",
              "2K",
              "4K"
            ]
          },
          {
            "pattern": "^[1-9][0-9]*[x*][1-9][0-9]*$"
          }
        ],
        "examples": [
          "1K",
          "2K",
          "4K",
          "1280*720",
          "1280x720"
        ]
      },
      "WanAIWan27ImageCount": {
        "type": "integer",
        "minimum": 1,
        "maximum": 12,
        "default": 1,
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n"
      },
      "WanAIWan27ImageGenerationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "created",
          "data"
        ],
        "properties": {
          "created": {
            "type": "integer",
            "description": "Unix timestamp in seconds for request creation."
          },
          "data": {
            "type": "array",
            "description": "Generated image URL list.",
            "items": {
              "$ref": "#/components/schemas/WanAIWan27ImageUrlData"
            }
          }
        }
      },
      "WanAIWan27ImageUrlData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Generated image download URL. Links are valid for 24 hours."
          }
        }
      },
      "WanAIWan27ImageTaskSubmitResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "task_id"
            ],
            "properties": {
              "task_id": {
                "type": "string",
                "description": "Asynchronous task identifier."
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "Request identifier."
          }
        }
      },
      "WanAIWan27ImageTaskStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/WanAIWan27ImageTaskStatusOutput"
          },
          "usage": {
            "$ref": "#/components/schemas/WanAIWan27ImageUsage"
          },
          "request_id": {
            "type": "string",
            "description": "Request identifier."
          }
        }
      },
      "WanAIWan27ImageTaskStatusOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id",
          "task_status"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "Asynchronous task identifier."
          },
          "task_status": {
            "type": "string",
            "enum": [
              "Pending",
              "Running",
              "Success",
              "Failure",
              "Cancelled"
            ],
            "description": "任务状态。"
          },
          "urls": {
            "type": "array",
            "description": "Generated image result URLs. Links are valid for 24 hours.",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "submit_time": {
            "type": "integer",
            "description": "任务提交时间戳。"
          },
          "finish_time": {
            "type": "integer",
            "description": "Task finish timestamp."
          },
          "error_message": {
            "type": "string",
            "description": "任务失败时返回的错误信息。"
          }
        }
      },
      "WanAIWan27ImageUsage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "completion_tokens": {
            "type": "integer",
            "description": "Optional output token count."
          },
          "total_tokens": {
            "type": "integer",
            "description": "Optional total token count."
          }
        }
      },
      "WanAIWan27ImageErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "错误码。",
                "examples": [
                  "InvalidParameter"
                ]
              },
              "message": {
                "type": "string",
                "description": "错误信息。",
                "examples": [
                  "invalid image url"
                ]
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "Optional request identifier."
          }
        }
      }
    },
    "examples": {
      "WanAIWan27ImageInvalidImageUrlError": {
        "summary": "无效图像 URL",
        "value": {
          "error": {
            "code": "InvalidParameter",
            "message": "invalid image url"
          },
          "request_id": "req_202604021530000001"
        }
      },
      "WanAIWan27ImageInvalidTaskIdError": {
        "summary": "无效任务 ID",
        "value": {
          "error": {
            "code": "InvalidParameter",
            "message": "invalid task_id"
          },
          "request_id": "req_202604021530000001"
        }
      }
    }
  }
}
```
