Retrieve task
Images / gpt-image-2
Retrieve image task
Retrieve the status and result of an image generation task.
GET
Retrieve task
After submitting an asynchronous image task, use its
task_id to retrieve the status. New integrations should prefer /v1/tasks/{task_id}.
Request
In-progress response
Successful response
Image URL formats
After the task succeeds, readresult.data[].url. It may be a relative path, a complete HTTP(S) URL, or a data:image/...;base64,... Data URL.
A Data URL is neither an error nor log output; it is the image itself. A webpage can display it directly, while a script must decode the base64 before saving it as a file.
Failed response
Status values
| Status | Meaning | Recommended caller action |
|---|---|---|
queued | Waiting to be processed | Continue polling. |
in_progress | Generating | Continue polling. |
succeeded | Completed | Display result.data[].url. |
failed | Failed | Display the error and allow the user to retry. |
Legacy route
GET /v1/images/tasks/{task_id} remains available for legacy clients. New integrations should not mix the two response structures.
Example response from the legacy route:
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Image or video task