跳转到主要内容
可灵图像生成

查询图像生成任务结果

通过 task_id 轮询查询可灵图像生成任务的执行状态与生成图像。

GET
/tasks/{task_id}
查询任务结果
curl -X GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
{
  "request_id": "95146d89-9d70-481a-8c16-xxxxxx",
  "output": {
    "task_id": "2c502d25-12a9-4517-8972-xxxxxx",
    "task_status": "SUCCEEDED",
    "submit_time": "2026-03-27 22:46:01.536",
    "scheduled_time": "2026-03-27 22:46:01.580",
    "end_time": "2026-03-27 22:46:24.831",
    "finished": true,
    "choices": [
      {
        "finish_reason": "stop",
        "message": {
          "role": "assistant",
          "content": [
            {
              "image": "https://p4-fdl.klingai.com/xxx.png?xxx",
              "type": "image"
            },
            {
              "image": "https://p4-fdl.klingai.com/xxx.png?xxx",
              "type": "image"
            }
          ]
        }
      }
    ]
  },
  "usage": {
    "size": "1024*1024",
    "image_count": 2,
    "SR": "1080"
  }
}

鉴权

string
header
必填

千问云 API Key。详见获取 API Key

路径参数

string
必填

任务ID,由创建任务接口返回。

响应

200-application/json
string

请求唯一标识。可用于请求明细溯源和问题排查。

object

任务输出信息。

object

输出信息统计。只对成功的结果计数。

string

请求失败的错误码。请求成功时不会返回此参数。

string

请求失败的详细信息。请求成功时不会返回此参数。