Skip to Content
goldflow.cc 文档
图片系列OpenAI Images

查询图片异步任务

GET
/v1/tasks/{id}

仅适用于在 /v1/images/generations?async=true 或 /v1/images/edits?async=true 提交后返回的图片任务 ID。

建议客户端按固定间隔轮询该接口:当任务为 succeeded 且 data.images 非空时读取图片结果;当任务为 failed 时读取 error 字段并停止轮询。图片结果可能包含 url 或 b64_json,具体取决于模型、渠道能力和提交请求中的 response_format。

Authorization

bearerAuth
headerAuthorizationBearer <API key>

使用 Authorization Bearer API Key 进行鉴权。

Path Parameters

id*string

图片异步任务 ID。

Response Body

成功响应。

application/json
  1. response

任务状态响应。

id?string

图片异步任务 ID。

state?string

图片任务状态。

progress?integer

任务进度百分比。

create_time?integer

任务创建时间,Unix 秒级时间戳。

update_time?integer

任务更新时间,Unix 秒级时间戳。

action?string

图片任务动作,例如 generate 或 edit。

data?

图片任务结果数据。

error?

任务失败时的错误信息。

Example Request
curl -X GET 'https://goldflow.cc/v1/tasks/string'
Example Response
{  "id": "string",  "state": "string",  "progress": 0,  "create_time": 0,  "update_time": 0,  "action": "string",  "data": {    "images": [      {        "url": "http://example.com",        "file_name": "string",        "b64_json": "string"      }    ]  },  "error": {}}