ImagesOpenAI Images
查询图片异步任务
仅适用于在 /v1/images/generations?async=true 或 /v1/images/edits?async=true 提交后返回的图片任务 ID。
建议客户端按固定间隔轮询该接口:当任务为 succeeded 且 data.images 非空时读取图片结果;当任务为 failed 时读取 error 字段并停止轮询。图片结果可能包含 url 或 b64_json,具体取决于模型、渠道能力和提交请求中的 response_format。
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"
}
}