ModelSell 文档
图片系列OpenAI Images

查询图片异步任务

查询图片异步生成或编辑任务的状态与结果。提交图片请求后,如果接口返回任务 ID,可通过该接口轮询任务进度并读取生成图片。

GET
/v1/tasks/{id}

查询图片异步生成或编辑任务的状态与结果。提交图片请求后,如果接口返回任务 ID,可通过该接口轮询任务进度并读取生成图片。

Authorization

bearerAuth
AuthorizationBearer <token>

使用 Authorization Bearer API Key 进行鉴权。

In: header

Path Parameters

id*string

图片异步任务 ID。

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/tasks/task_abc123"
{
  "id": "task_abc123",
  "state": "succeeded",
  "progress": 100,
  "create_time": 0,
  "update_time": 0,
  "action": "generate",
  "data": {
    "images": [
      {
        "url": "http://example.com",
        "file_name": "string",
        "b64_json": "string"
      }
    ]
  },
  "error": {}
}
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string"
  }
}