MaasUnionMaasUnion
API Reference
AI Model APIVideoDoubao Video

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_url is valid for 24 hours; please download or persist it in time.


Path Parameters

ParameterTypeRequiredDescription
task_idstringYesThe 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
}
FieldTypeDescription
idstringGateway task ID
modelstringModel name and version used by the task
statusstringUpstream status, see Task Status
errorobject / nullError info on failure; null on success
created_atintegerTask creation time as Unix timestamp (seconds)
updated_atintegerTask status update time as Unix timestamp (seconds)
content.video_urlstringGenerated video URL (mp4, valid for 24 hours)
content.last_frame_urlstringLast frame image URL (when created with return_last_frame: true, valid for 24 hours)
seedintegerRandom seed used for this request
resolutionstringResolution of the generated video
ratiostringAspect ratio of the generated video
durationintegerDuration of the generated video in seconds. Returned when frames is not specified
framesintegerFrame count of the generated video. Returned when frames was specified at creation (mutually exclusive with duration)
framespersecondintegerFrame rate of the generated video
generate_audiobooleanWhether synchronized audio is included (2.0 / 2.0 fast / 1.5 pro)
draftbooleanWhether the video is a Draft video (1.5 pro)
draft_task_idstringDraft task ID (returned when generating the official video based on a Draft)
toolsobject[]Tools actually used in this request
safety_identifierstringEnd-user identifier set at creation (returned as-is)
priorityintegerExecution priority
service_tierstringService tier actually used
execution_expires_afterintegerTask timeout threshold (seconds)
usage.completion_tokensintegerBilled token count (Seedance 2.0 has a minimum usage limit)
usage.total_tokensintegerTotal tokens (input tokens for video models are 0)
usage.tool_usageobjectTool usage info

Task Status

Upstream Status (status)

StatusDescription
queuedQueued
runningRunning
succeededSucceeded; read content.video_url
failedFailed; see error
cancelledCancelled (only cancellable while queued; auto-deleted after 24h)
expiredTask 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_id does 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?