Public Task Contract
Create responses can include:/v1/tasks/{id} is the canonical fixed status endpoint for public async media jobs. Media-specific status routes may exist for compatibility, but new integrations should prefer poll_url or /v1/tasks/{id}.
Recommended Flow
- Validate the user request and send the create call with an explicit
model. - Persist
id/task_id,poll_url, endpoint, model, user ID, and your own job ID before returning control to the UI. - Poll every
5-10sfor long-running media tasks. - Stop only when the task is
completedorfailed. - On
completed, read the media-specific result fields and store final URLs or metadata. - On
failed, store the public error and offer retry only as a new user-visible job.
Polling Example
pending, processing, completed, and failed. Cancelled tasks are represented as failed with cancelled: true and cancellation_status: "cancelled" so older status handling keeps working.
Client Retry Rules
Network timeouts are the most common source of duplicate jobs. Use this rule:
Do not send a second create request just because the browser refreshed or a status poll failed.
Billing And Settlement
Async jobs can reserve an estimated amount when the create request is accepted. Final settlement happens after terminal status. When available, task status responses can exposebilling_transaction_id and the X-Billing-Transaction-ID header.
For reconciliation, join these identifiers in your logs:
request_idfrom the create request.task_id/idfrom the task.billing_transaction_idwhen present.- Your own user ID, project ID, or job ID.
Cancellation
DELETE /v1/tasks/{id} is intentionally narrow. It currently supports queued Seedance video tasks such as seedance-1.5-pro, seedance-2.0, and seedance-2.0-fast when cancellation is available for the selected task.
Unsupported tasks return 400 unsupported_task_cancel. Tasks that are already running or terminal return 409 task_not_cancellable. Build cancellation UI as “request cancellation” rather than a guaranteed stop button.
Troubleshooting
Support Packet
When contacting support, includerequest_id, task_id, billing_transaction_id when present, endpoint, model, timestamp, and a sanitized request shape. Do not include API keys, private media, signed URLs, or full prompts unless support asks for a redacted sample.