Async flow
1
Submit
Call
POST /v1/images or POST /v1/videos and read data.task_id.2
Poll
Call the matching
GET .../{task_id} until status is terminal.3
Fetch result
On success, use
data.result.image_url or data.result.video_url. On failure, read data.error_message.Response shape
Successful calls returncode: 20000 with payload in data. Create and query share the same data schema.
Common codes
Best practices
- Persist media promptly: result URLs are kept about 3 days.
- Check the catalog: confirm live
modelIDs via the model catalog. - Reconcile with
cost:data.costis the charged amount (credits). - Protect keys: never commit API keys to public repos.