cURL - Query task result
Query task status and results.
Poll this endpoint with the returned
Polling strategy
Poll this endpoint with the returned task_id. We recommend polling every 5-10 seconds.
Important notes
- URL expiration: Image URLs expire in 24 hours. Download promptly.
- Task status flow:
PENDING→RUNNING→SUCCEEDEDorFAILED. - Other statuses:
CANCELED(task canceled),UNKNOWN(invalid or expired task ID). - Task ID validity: Task IDs are valid for 24 hours. After the task ID expires, the status and results cannot be queried.
- Avoid duplicate tasks: Use polling to retrieve results. Do not resubmit requests.
Authorizations
string
header
required
DashScope API Key. Create one in the QwenCloud console.
Path Parameters
string
required
Task identifier returned by the async task creation endpoint.
Response
200-application/json
string
Unique request identifier for troubleshooting.
object
Task output information.
object
Usage statistics. Counts only successful results. Returned in the top-level usage field, at the same level as output. Read them as response.usage["image_count"], where image_count is the total number of images generated by the task. The output object does not carry statistics: response.output.usage is returned as {} and contains no image_count.
string
Error code. Returned only when the request fails.
string
Detailed error message. Returned only when the request fails.