OmwAIOmwAI
API GuideAPI ReferenceProgramming Tools
GPT Image

Query Result

GPT Image async task result query endpoint

Queries the status and result of a GPT Image async generation task by task ID. After submitting an image generation task, poll this endpoint with the returned task_id until the task finishes.

Task status

  • queued / in_progress: running; progress holds the progress — retry later;
  • completed: done; the data array contains the final image (Base64 in b64_json);
  • failed: failed; error explains why.

Getting the image

Images are returned as b64_json Base64 strings (no url field is provided); decode and store them yourself.

GET
/v1/images/async/generations/{task_id}

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx 只能查询当前令牌所属账号下的任务。

In: header

Path Parameters

task_id*string

提交图片生成任务时返回的任务 ID(id / task_id)

Response Body

application/json

application/json

curl -X GET "https://www.omwai.xyz/v1/images/async/generations/task_01J8ABCDEFGHIJKLMNOPQRST"
{
  "id": "task_01J8ABCDEFGHIJKLMNOPQRST",
  "task_id": "task_01J8ABCDEFGHIJKLMNOPQRST",
  "object": "image.task",
  "model": "gpt-image",
  "status": "completed",
  "progress": "100%",
  "created_at": 1788256630,
  "completed_at": 1788256720,
  "error": {
    "code": "string",
    "message": "string"
  },
  "data": [
    {
      "b64_json": "string",
      "revised_prompt": "string"
    }
  ]
}
{
  "code": "task_not_exist",
  "message": "string"
}

Note

Only tasks belonging to the current token's account can be queried. A missing or inaccessible task returns 400.

How is this guide?

Last updated on