Prefer asynchronous generation
For new integrations, use:image or images for URL or base64 reference images.
Text-to-image
Reference images
For remote images, put public OSS or CDN URLs in the asynchronous JSON request:Reading results
An image request may return an image URL,b64_json, or an asynchronous task ID. Do not hard-code only one response field. Save results that need long-term access to your own object storage.
Polling jobs
- Create a job with
POST /v1/images/generations/jobs. - Save the returned
idand current status. - Poll
GET /v1/images/generations/jobs/{job_id}every two to three seconds initially. - Continue while the status is
queuedorrunning. - Read
datawhen the status issucceeded. - Read
error.messagewhen the status isfailed.