Guides
Media Task Workflow
Build reliable media generation flows with task submission, polling, completion handling, and failure recovery.
All image and video generation uses task mode. There is no synchronous media response mode: the generation endpoint returns 202 with a task envelope, and the result is read from the task resource.
Flow
- Submit an image or video generation request.
- Store the returned task ID.
- Poll
GET /v1/tasks/{taskId}. - Stop when the task reaches
successorfail. - Persist result URLs or download generated assets promptly.
Suggested polling policy
attempt 1: wait 1 second
attempt 2: wait 2 seconds
attempt 3: wait 4 seconds
attempt 4+: wait 8 to 15 seconds with jitterFailure handling
Show the public error message and keep the task ID and request ID available for support. Detailed diagnostics stay inside Xenodia and are not returned by the public task response.
User experience
For product flows, avoid blocking a page indefinitely. Persist the task and let users return to the result later when possible.