Seedance API Integration Guide & Examples
Beyond the standard video protocols, the Doubao Seedance series (doubao-seedance-*) can also be called over Volcengine Ark's own paths, with request and response bodies following Ark's content-generation protocol:
| Method | Path | Use |
|---|---|---|
POST | /ark/api/v3/contents/generations/tasks | Create a content generation (video) task |
GET | /ark/api/v3/contents/generations/tasks/{task_id} | Poll task status and result |
DELETE | /ark/api/v3/contents/generations/tasks/{task_id} | Cancel an unfinished task and release its preauthorization (upstream-dependent, see below) |
The official Ark SDKs actually request /api/v3/contents/generations/tasks (with base_url set to https://api.modelgo.ai/api/v3) or /v1/contents/generations/tasks (with base_url set to https://api.modelgo.ai/v1); the gateway accepts both spellings too — see "Using the official Ark SDK" below. Whether a model is offered on this entrypoint follows the protocols listed for it in the Model Catalog.
The platform also offers a generic path for the same protocol: the request body is written as in the example below (model plus a content array) and it returns the same Ark task object. The code samples in the Model Catalog use this path:
| Method | Path | Use |
|---|---|---|
POST | /v1/content_generation/tasks | Create a task |
GET | /v1/content_generation/tasks/{task_id} | Poll a task |
DELETE | /v1/content_generation/tasks/{task_id} | Cancel a task |
Create a task
model is the platform logical model name (e.g. doubao-seedance-2.0-mini):
curl https://api.modelgo.ai/ark/api/v3/contents/generations/tasks \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<model>",
"content": [
{ "type": "text", "text": "a neon city cat" },
{ "type": "image_url", "image_url": { "url": "https://example.com/first.jpg" }, "role": "first_frame" }
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}'content elements are tagged by role; the media combination determines the generation mode:
| content element | role | Generation mode |
|---|---|---|
text only | — | Text-to-video (t2v) |
image_url | first_frame | First-frame image-to-video (i2v) |
image_url | first_frame + last_frame | First/last-frame (flf2v) |
image_url / video_url / audio_url | reference_image / reference_video / reference_audio | Multimodal reference-to-video |
An audio reference (audio_url) must carry "role": "reference_audio"; without it the upstream rejects the request or cannot treat it as reference generation. doubao-seedance-2.5 accepts audio-only references.
Parameter and mode constraints
Valid values for resolution / ratio / duration vary by model; Ark extension parameters such as camera_fixed, generate_audio, return_last_frame and watermark also vary by generation mode, so do not assume a parameter that works in one mode works in another.
Seedance 2.5 duration: 4–30 (seconds) or -1. When omitted, the official default -1 applies and the model chooses a length within 4–30 seconds; billing follows actual usage, the 30-second maximum is pre-authorized at creation and the unused part is released at settlement.
The platform validates request structure only; it does not keep a per-model parameter capability table:
- An out-of-range value, or one that conflicts with the current generation mode, is validated by the upstream and usually returns
400provider_invalid. For example, first/last-frame (bothfirst_frameandlast_frame) does not supportcamera_fixed, and a request carrying it is refused (camera_fixed ... must be empty); for a locked-off camera, use text-to-video or single first-frame. - Only send fields the current model supports: a field that does not belong to the model may be silently ignored while creation still returns
200. Use the vendor's parameter table for that model to see which fields it supports.
Poll a task
curl https://api.modelgo.ai/ark/api/v3/contents/generations/tasks/{task_id} \
-H "Authorization: Bearer $MODELGO_API_KEY"The response is an Ark task object (status, content.video_url, error, usage). id is the gateway task id, and it is the only id polling and cancelling accept.
Cancel a task
curl -X DELETE https://api.modelgo.ai/ark/api/v3/contents/generations/tasks/{task_id} \
-H "Authorization: Bearer $MODELGO_API_KEY"- A successful cancel releases the preauthorization; nothing is charged.
- Whether a task can be cancelled depends on the upstream serving it:
400 provider_unsupportedwhen it cannot,409 task_already_terminalwhen the task has already finished. - When a cancel fails the preauthorization is not released early, so do not treat "create then cancel" as a reliable way to back out of a charge.
Using the official Ark SDK
With the official Volcengine Ark SDK (volcenginesdkarkruntime), point base_url at https://api.modelgo.ai/api/v3 and use your ModelGo API key as api_key. This is the same SDK setup as Seedream image generation, so one client can both generate images and create video tasks.
import os, time
from volcenginesdkarkruntime import Ark
client = Ark(api_key=os.environ["MODELGO_API_KEY"], base_url="https://api.modelgo.ai/api/v3")
task = client.content_generation.tasks.create(
model="<model>",
content=[{"type": "text", "text": "a neon city cat"}],
resolution="720p",
ratio="16:9",
duration=5,
)
while True:
r = client.content_generation.tasks.get(task_id=task.id)
if r.status in ("succeeded", "failed"): # a cancelled task also ends as failed
break
time.sleep(10)
print(r.status, r.content.video_url if r.status == "succeeded" else r.error)client.content_generation.tasks.delete(task_id=...)is the cancel; the same parameter constraints apply.- The BytePlus SDK (e.g.
Ark.byteplus(...)fromarkruntime) works the same way — onlybase_urlandapi_keychange. content.video_urlpoints athttps://api.modelgo.ai/v1/videos/{task_id}/content. No credential is required: the link itself is the credential, so do not share it publicly, log it, or store it long-term.
For a more standardized entrypoint, see OpenAI Video.