After creating a GPT Image 2 generation task, poll this endpoint with the task ID to check progress and retrieve the generated image URL when the task is complete. Because generation is asynchronous, you’ll need to call this endpoint periodically until the task reaches a terminal state (Documentation Index
Fetch the complete documentation index at: https://docs.xingchaoyiqing.com/llms.txt
Use this file to discover all available pages before exploring further.
completed or failed).
Base URL
Endpoint
Authentication
Include your API key as a Bearer token in theAuthorization header on every request:
Path Parameters
The task ID returned by the Create Image Task endpoint. Example:
image_fd35ee52-2a98-44a6-b930-29a88ce9b8fd.Response Fields
The unique task ID for this generation job.
The object type. Always
image.generation.Unix timestamp indicating when the task was created.
The model name used for this generation task.
The current task status.
| Value | Meaning |
|---|---|
queued | Task is waiting in the queue |
processing | Task is actively being processed |
completed | Generation succeeded — image_url is now available |
failed | Generation failed — see the error field |
The URL of the generated image. Only present (and non-null) when
status is completed. Image URLs are valid for 24 hours — download and store the image promptly.An error message describing what went wrong. Only present when
status is failed.Status Flow
Tasks move through the following states in order. Once a task reachescompleted or failed, it will not change again.
| Stage | Description |
|---|---|
queued | Task has been created and is waiting for a worker |
processing | A worker has picked up the task and is generating your image |
completed | Image generation succeeded — retrieve the URL from image_url |
failed | Image generation failed — retrieve the reason from error |
Code Example
cURL