cURL (Submit task)
Get an API key and set it as an environment variable. If using the SDK, install it.
Workflow
- Submit a task via
POST /services/aigc/image-generation/generationwith theX-DashScope-Async: enableheader. - Poll for results via
GET /tasks/{task_id}untiltask_statusreachesSUCCEEDEDorFAILED. Poll every 10 seconds.
Authorizations
string
header
required
DashScope API Key. Create one in the QwenCloud console.
Header Parameters
enum<string>
required
Must be set to enable for asynchronous task submission. Missing this header returns the error: "current user api does not support synchronous calls".
enable