/tasks/submit. Returns whatever’s known right now
— pending, running, or one of three terminal states (completed,
failed, cancelled).
For real-time delivery (server-pushed state changes instead of
client-pulled polls), use GET /v1/tasks/stream/{task_id} (SSE) or a
callback_url registered on submit.
When to use
- Cheap polling loop —
/tasks/queryis free; call it on a cadence matched to the task’sestimated_seconds - Reconciling after process restart — your client died, you only
have the
out_task_idin your DB; query by that to recover the current state - Final output retrieval — once
statusiscompleted, theoutputarray holds the generated images / videos
Request
By task_id
By out_task_id (idempotency key)
Body
Exactly one of
task_id or out_task_id is required. Sending both
returns 400 invalid_param.
Response
While running
After completion
After failure
Response fields
Polling cadence
Match your poll interval to the model’sestimated_seconds from the
submit response. A good default for video:
callback_url (set on submit) or
the SSE stream endpoint.
Errors
Pricing
Free. Polling does not consume credits. Onlycompleted tasks bill
(via the original submit). Re-querying a completed task as many times
as you like is zero-cost.
Next
POST /tasks/cancel— abort a non-terminal taskPOST /tasks/submit— kick a task off