跳到正文
Cheapest Imagen
API 参考

查询任务

异步请求的状态:先是 `in_progress`,结束后是带图片的 `succeeded` 或带错误的 `failed`。任务在图片保存期内(72 小时)都能查。建议每隔几秒查一次;查询任务不占“进行中的请求”名额。同时等多个任务时,请用 `GET /images/tasks?ids=` 一次查完。

GET
/images/tasks/{id}

异步请求的状态:先是 in_progress,结束后是带图片的 succeeded 或带错误的 failed。任务在图片保存期内(72 小时)都能查。建议每隔几秒查一次;查询任务不占“进行中的请求”名额。同时等多个任务时,请用 GET /images/tasks?ids= 一次查完。

Authorization

apiKey
headerAuthorizationBearer <token>

你的 API 密钥,放在请求头里:Authorization: Bearer <密钥>。

Path Parameters

id*string

任务号:202 返回里的 id,也就是那次请求的 x-request-id。

Match^req_[0-9a-f]{24}$

Response Body

任务。

application/json
  1. response
id*string

任务号:202 返回里的 id,也就是那次请求的 x-request-id。

object*"image.task"
Value in"image.task"
status*string

请求结束前是 in_progress,之后是 succeeded 或 failed。

Value in"in_progress""succeeded""failed"
created*integer

请求被接受的时间,Unix 时间戳(秒)。

finished*|

结束时间;进行中时为 null。

model*string
result?

succeeded 时出现:和同步调用返回的内容相同。

error?

failed 时出现:和同步调用返回的错误相同。失败的任务不扣费,Nano Banana 稳定通道被内容检查拒绝的除外。

Example Request
curl -X GET 'https://api.cheapestimagen.com/v1/images/tasks/string'
Example Response
{  "id": "string",  "object": "image.task",  "status": "in_progress",  "created": 0,  "finished": 0,  "model": "string",  "result": {    "created": 0,    "data": [      {        "b64_json": "string",        "url": "http://example.com"      }    ]  },  "error": {    "message": "string",    "type": "string",    "param": "string",    "code": "string"  }}