OpenAI
Retrieve an image generation task
Use CometAPI GET /v1/images/generations/ to poll an async OpenAI-compatible image generation task and retrieve final image data.
GET
cURL
Use this endpoint after you create an image with
POST /v1/images/generations and async: true. The create request returns data.task_id, and this endpoint returns the task state plus final image data when the task succeeds.
Poll an image task
1
Create the task
Send
POST /v1/images/generations with async: true, then store data.task_id.2
Poll the task
Call this endpoint with the stored task ID until
data.status is success or failure.3
Read the image data
When
data.status is success, read the first item in data.data. Depending on the selected model, the item can include b64_json, url, or revised_prompt.Status values
pending: The task is queued or generating.success: The task finished anddata.datacontains the generated image data.failure: The task failed. Checkdata.fail_reasonwhen it is returned.
Authorizations
Bearer token authentication. Use your CometAPI key.
Path Parameters
Task ID returned in data.task_id by the async create request.
Last modified on July 6, 2026