Query the task result
Polling strategy
- Call Create an image generation task to get a
task_id. - Poll this endpoint every 5 seconds until
task_statusisSUCCEEDEDorFAILED. - On success, download the image from
output.choices[].message.content[].image.
Notes
- URL expiration: The image URL expires after 24 hours. Download the image promptly.
- Task ID expiration: A
task_idis valid for 24 hours. After that, the status is returned asUNKNOWN. - Task status flow:
PENDING→RUNNING→SUCCEEDEDorFAILED.CANCELEDmeans the task was canceled. - Avoid duplicate submissions: Poll for the result instead of submitting the task again.
Output
| Field | Description |
|---|---|
output.task_status | Task status. |
output.choices[].message.content[].image | Download URL of the generated PNG image. Valid for 24 hours. |
usage.image_count | Number of generated images. |
usage.size | Output resolution in width*height format. |
usage.SR | Resolution tier: 1K, 2K, or 4K. |
Authorizations
string
header
required
QwenCloud API key. See Get an API key.
Path Parameters
string
required
The task ID returned by the create operation. It is valid for queries for 24 hours.