Query Doubao Video Task
Dedicated route: GET https://maasunion.com/doubao/v1/video/generations/{task_id}
Compatible route: GET https://maasunion.com/v1/video/generations/{task_id}
Upstream capability: Volcano Engine Ark Seedance video generation (/api/v3/contents/generations/tasks)
Overview
Query task status and generation result using the id returned when creating the task.
Only task records from the last 7 days can be queried. The generated
video_urlis valid for 24 hours; please download or persist it in time.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | The id from the create response (format like task_xxxxxxxx) |
Request Example
TASK_ID="task_20260409120000_abc123"
curl -X GET "https://maasunion.com/doubao/v1/video/generations/${TASK_ID}" \
-H "Authorization: Bearer sk-xxxxxxxx"Query Task Response
GET https://maasunion.com/doubao/v1/video/generations/{task_id}
The gateway passes through the upstream Volcano Engine Ark Seedance query-task response as-is, only replacing id with the gateway public task ID.
Response example (success):
{
"id": "task_20260409120000_abc123",
"model": "doubao-seedance-2-0-260128",
"status": "succeeded",
"error": null,
"content": {
"video_url": "https://ark-content-generation-cn-beijing.tos-cn-beijing.volces.com/xxx.mp4",
"last_frame_url": "https://ark-content-generation-cn-beijing.tos-cn-beijing.volces.com/xxx.png"
},
"usage": {
"completion_tokens": 108900,
"total_tokens": 108900
},
"created_at": 1779348818,
"updated_at": 1779348874,
"seed": 78674,
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"framespersecond": 24,
"service_tier": "default",
"execution_expires_after": 172800,
"generate_audio": true,
"draft": false,
"priority": 0
}| Field | Type | Description |
|---|---|---|
id | string | Gateway task ID |
model | string | Model name and version used by the task |
status | string | Upstream status, see Task Status |
error | object / null | Error info on failure; null on success |
created_at | integer | Task creation time as Unix timestamp (seconds) |
updated_at | integer | Task status update time as Unix timestamp (seconds) |
content.video_url | string | Generated video URL (mp4, valid for 24 hours) |
content.last_frame_url | string | Last frame image URL (when created with return_last_frame: true, valid for 24 hours) |
seed | integer | Random seed used for this request |
resolution | string | Resolution of the generated video |
ratio | string | Aspect ratio of the generated video |
duration | integer | Duration of the generated video in seconds. Returned when frames is not specified |
frames | integer | Frame count of the generated video. Returned when frames was specified at creation (mutually exclusive with duration) |
framespersecond | integer | Frame rate of the generated video |
generate_audio | boolean | Whether synchronized audio is included (2.0 / 2.0 fast / 1.5 pro) |
draft | boolean | Whether the video is a Draft video (1.5 pro) |
draft_task_id | string | Draft task ID (returned when generating the official video based on a Draft) |
tools | object[] | Tools actually used in this request |
safety_identifier | string | End-user identifier set at creation (returned as-is) |
priority | integer | Execution priority |
service_tier | string | Service tier actually used |
execution_expires_after | integer | Task timeout threshold (seconds) |
usage.completion_tokens | integer | Billed token count (Seedance 2.0 has a minimum usage limit) |
usage.total_tokens | integer | Total tokens (input tokens for video models are 0) |
usage.tool_usage | object | Tool usage info |
Task Status
Upstream Status (status)
| Status | Description |
|---|---|
queued | Queued |
running | Running |
succeeded | Succeeded; read content.video_url |
failed | Failed; see error |
cancelled | Cancelled (only cancellable while queued; auto-deleted after 24h) |
expired | Task timed out |
Polling Recommendation
After creating a task, poll this endpoint at intervals of 10–30 seconds until status becomes succeeded or failed / expired / cancelled. You may also use callback_url to let the gateway notify you on status change.
Call Examples
6. Query Task
TASK_ID="task_20260409120000_abc123"
curl -X GET "https://maasunion.com/doubao/v1/video/generations/${TASK_ID}" \
-H "Authorization: Bearer sk-xxxxxxxx"7. Python Polling Example
import os
import time
import requests
TOKEN = os.environ["NEW_API_KEY"]
# Create task
resp = requests.post(
"https://maasunion.com/doubao/v1/video/generations",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"model": "doubao-seedance-1-0-pro-250528",
"content": [{"type": "text", "text": "City skyline at sunset, camera slowly pushes in"}],
"ratio": "16:9",
"duration": 5,
},
)
resp.raise_for_status()
task_id = resp.json()["id"]
print("task_id:", task_id)
# Poll
while True:
result = requests.get(
f"https://maasunion.com/doubao/v1/video/generations/{task_id}",
headers={"Authorization": f"Bearer {TOKEN}"},
).json()
status = result.get("status")
print("status:", status)
if status == "succeeded":
print("video_url:", result["content"]["video_url"])
break
if status in ("failed", "expired", "cancelled"):
print("error:", result.get("error"))
break
time.sleep(15)Error Handling
When status is failed / expired / cancelled, the task did not generate the video successfully. Check the error field or callback notification for error details. Common cases:
task_iddoes not exist or has expired (more than 7 days)- Invalid token or insufficient balance
- Upstream parameter validation failure
- Content safety block
Document updated: 2026-06-16
How is this guide?