Skip to content

Query and manage tasks ​

Seedance API(v3)

Use https://api.tokenlio.ai with your platform Bearer Key and an exact model ID from the current catalog. Official references provide more field details; use the addresses, authentication and examples on this page for your calls.

Query the task UUID returned by creation every5–10 seconds until succeeded, failed, cancelled or expired. An HTTP query error does not justify creating a replacement task.

bash
curl -sS --fail-with-body "https://api.tokenlio.ai/api/v3/contents/generations/tasks/$TASK_ID" \
  -H "Authorization: Bearer $TOKENLIO_API_KEY"

List, cancel and delete ​

Lists are filtered by the current Workspace and the current platform API Key, with current membership checks. Another Key in the same Workspace does not list this Key's tasks. Both total and items use that scope; items use the individual-task shape. An empty list is {"total":0,"items":[]}. This differs from the Workspace-shared material library.

filter.task_ids accepts up to 500 platform UUIDs using repeated query keys, not commas or a JSON array. Other parameters cannot repeat. Omitting filter.service_tier filters default; explicitly use flex to list flex tasks.

Query parameterDescription
page_num1–500; default 1.
page_size1–500; default 20.
filter.statusqueued, running, succeeded, failed, cancelled or expired.
filter.modelExact public model ID.
filter.service_tierdefault or flex; default default.
filter.task_idsPlatform task IDs; repeat the query key for multiple IDs.

Lists cover the last 7 days. Drafts created from 2026-10-28 10:00 UTC+8 are listed for 14 days. This window does not extend result URLs or delete billing history.

bash
curl -sS --fail-with-body 'https://api.tokenlio.ai/api/v3/contents/generations/tasks?page_num=1&page_size=20&filter.status=succeeded' \
  -H "Authorization: Bearer $TOKENLIO_API_KEY"

curl -sS --fail-with-body -X DELETE 'https://api.tokenlio.ai/api/v3/contents/generations/tasks/TASK_ID' \
  -H "Authorization: Bearer $TOKENLIO_API_KEY"

Successful DELETE returns HTTP200 {}. A cancelled queued task remains queryable with status cancelled. New DELETE requests are not allowed for running or cancelled tasks. Deleting succeeded, failed or expired records makes them unavailable to GET and lists. Deletion does not refund successful generation or guarantee continued access to an existing video URL. Deleted drafts cannot be referenced by new tasks.

DELETE has no JSON body, separate /cancel path, or status/action/force fields. First GET the target and check its status. HTTP200 {} is an operation ACK; continue GET until cancellation is confirmed as cancelled. It does not prove a refund. Finished records can be deleted only after their original settlement; deletion does not refund captured charges.

ConditionHandling
queuedManually DELETE to cancel; cancellation can race generation.
running / cancelledNew DELETE is not allowed; another button cannot force cancellation or deletion.
succeeded / failed / expiredDelete after settlement; a successful deletion hides the record from GET and lists.
409Follow the actual TaskSubmissionPending, TaskSettlementPending, TaskInUse or other code/message.
503 / TaskOperationPending, timeout or uncertaintyBack off using Retry-After and query the original task. A404 or lost response does not prove cancellation or a refund.

Optional Idempotency-Key identifies one cancel/delete intent. Retry with the original platform Key, target and stable operation key; use a new key only for a new intent or target. Stored results retain the original HTTP status/body, including a definitive rejection such as404. Not every repeated request becomes200.

bash
curl -sS --fail-with-body --get 'https://api.tokenlio.ai/api/v3/contents/generations/tasks' \
  -H "Authorization: Bearer $TOKENLIO_API_KEY" \
  --data-urlencode 'filter.task_ids=TASK_ID_1' \
  --data-urlencode 'filter.task_ids=TASK_ID_2'

# Replace TASK_ID; keep TOKENLIO_OPERATION_KEY stable when retrying this intent.
curl -sS --fail-with-body -X DELETE 'https://api.tokenlio.ai/api/v3/contents/generations/tasks/TASK_ID' \
  -H "Authorization: Bearer $TOKENLIO_API_KEY" \
  -H "Idempotency-Key: ${TOKENLIO_OPERATION_KEY:?Set a stable operation key}"

Task response ​

json
{
  "id": "dfc68868-d388-4d83-a173-d44e47a8bec7",
  "model": "seedance-2.0",
  "status": "succeeded",
  "content": {
    "video_url": "https://example.com/result.mp4"
  },
  "resolution": "1080p",
  "duration": 5,
  "usage": {
    "completion_tokens": 108900,
    "total_tokens": 108900
  }
}
FieldMeaning
id / model / statusTask ID, model ID and current state.
content.video_urlVideo URL on success.
content.last_frame_urlLast-frame URL when requested and available.
usage.completion_tokens / usage.total_tokensActual generation token usage.
usage.tool_usage.web_searchActual search calls when returned.
error.code / error.messageFailure details.
draft_task_idReferenced draft ID.
resolution / ratio / duration / output_formatActual output settings when returned.
created_at / updated_atUnix timestamps when returned.
seed / frames / framespersecondGeneration metadata when returned.
execution_expires_after / priority / service_tier / generate_audio / draft / safety_identifier / toolsAdditional metadata when returned.
statusWhat to do
queued / runningKeep querying the original task; do not create it again.
succeededSave the result promptly. Temporary URLs are not renewed by another query.
failed / expired / cancelledStop polling and inspect error.

A failed/expired task still has an HTTP200 query response. A timeout or 429/5xx on the query does not prove generation failed. Back off and query the same ID. If creation itself times out, verify its outcome before creating another task.

Next steps ​

Official references ​

Access leading AI models through one unified API