Decode logoDecode

Generate and query videos

Video generation is asynchronous: submit a task to get its ID, then query the task until it finishes.

Submit a task

POST /api/v3/contents/generations/tasks

curl https://decode8.com/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer $DECODE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-2-0-261111",
    "content": [
      { "type": "text", "text": "An orange cat stretches on a sunny windowsill" }
    ],
    "resolution": "720p",
    "ratio": "16:9",
    "duration": 5,
    "generate_audio": true
  }'
Field Description
model Model name, required
content Array of inputs, required; see below
resolution 480p, 720p, 1080p
ratio adaptive, 16:9, 9:16, 1:1, 4:3, 3:4, 21:9
duration Video length in seconds; see Models for the range
generate_audio Whether to generate audio as well
bitrate_mode Output bitrate: standard or high. Seedance 2.0 uses high when it is omitted; other models use the upstream default. high is about three times the bitrate of standard at the same price, with larger files

For the international channel, set model to a dreamina-seedance-* model; the other fields stay the same.

Each content item:

Kind Form
Text prompt { "type": "text", "text": "..." }
First frame { "type": "image_url", "role": "first_frame", "image_url": { "url": "..." } }
Last frame { "type": "image_url", "role": "last_frame", "image_url": { "url": "..." } }
Reference image { "type": "image_url", "role": "reference_image", "image_url": { "url": "..." } }, see the limits below

An image address is a public URL or a material from your library, asset://<material ID> (see Material library).

Reference limits per request:

Model Images Videos Audios
doubao-seedance-2-5-261111, dreamina-seedance-2-5-261111 30 10 10
doubao-seedance-2-0-261111, dreamina-seedance-2-0-261111 9 3 3

These requests are rejected with 400 before they reach the upstream, and nothing is charged: more references than the limit; a duration that is neither -1 (the model picks the length) nor between 1 and the model's longest duration, such as 0; a bitrate_mode other than standard or high; no reference and no text prompt.

Reference review: every reference image, video and audio, including those given as public URLs or base64, is first saved to your material library and passes the upstream material library review before generation. A reference that fails the review is refused with 400, naming the item and the reason, such as content[2]: material mat_xxx failed the material library review: ...; nothing is charged.

callback_url is not supported; query the task for its result.

Response:

{ "id": "task_xxxxxxxx" }

id is Decode's task ID; use it to query the task. When the task runs on Ark, submit and query replies also carry provider_task_id, Ark's own task ID (cgt-…), which Ark support asks for when you report a problem.

Query a task

GET /api/v3/contents/generations/tasks/{id}

curl https://decode8.com/api/v3/contents/generations/tasks/task_xxxxxxxx \
  -H "Authorization: Bearer $DECODE_API_KEY"

Values of status:

Status Meaning
queued Waiting to start
running Generating
succeeded Done; the video is at content.video_url
failed Failed; the reason is in error.message
cancelled / expired Cancelled / expired

Query about every 10 seconds until the status is succeeded, failed, cancelled, or expired. Other response fields are the same as Ark's.

Decode keeps generated videos for a limited time. After that the link returns 410 artifact_expired, so download them promptly:

Models Kept for
doubao-* 14 days
dreamina-* 72 hours

The time counts from when the task finishes. The Artifacts column of the console's task log shows the time left, and shows Expired once it has passed.

Each file at content.video_url or content.last_frame_url can be downloaded 20 times (repeat requests from the same IP within 10 minutes count once, so seeking in a player does not add up); after that the link returns 403 artifact_download_limit. Playing and downloading in the console is not counted. Queries made through cn.decode8.com return video addresses in storage in China.

List tasks

GET /api/v3/contents/generations/tasks?page_num=1&page_size=20

Lists your account's video tasks, newest first. Tasks submitted with any of your keys are listed, and each task has the same fields as in Query a task.

Parameter Description
page_num Page number, starting at 1. Default 1
page_size Tasks per page. Default 20, at most 100
filter.status Filter by status, with the values in Query a task; repeat it, as in filter.status=queued&filter.status=running
filter.task_ids Filter by task ID (Decode's task_...); repeat it or separate IDs with commas, at most 100

filter.model and filter.service_tier are not supported yet and return 400.

curl "https://decode8.com/api/v3/contents/generations/tasks?page_size=2&filter.status=succeeded" \
  -H "Authorization: Bearer $DECODE_API_KEY"
{
  "total": 30,
  "items": [
    {
      "id": "task_xxxxxxxx",
      "provider_task_id": "cgt-2026xxxx-xxxxx",
      "model": "doubao-seedance-2-0-260128",
      "status": "succeeded",
      "content": { "video_url": "https://decode8.com/v1/tasks/task_xxxxxxxx/artifacts/video/content?access=..." }
    }
  ]
}

total is the number of matching tasks; use it to tell whether there is another page.

Billing

Submitting a task holds an estimated charge; when the task finishes, the charge is settled against the actual usage the upstream reports, and the difference is refunded or charged. A failed task refunds the held charge. Prices use the ratio of the key's group, and every charge appears in Usage Logs.

Budget models

Two budget models give good quality at a low price: 64% of the official price. Requests are the same as in China official; only the model name and the upstream line differ. When creating a key, pick the 国内特价px (China discount) group, which serves both:

Model Resolutions Duration (seconds)
seedance-2.0-px 480p, 720p, 1080p, 4k 4–15
seedance-2.5-px 480p, 720p, 1080p 4–30

Prices (per million tokens):

Model · resolution Without reference video With reference video
2.0 · 480p / 720p ¥29.44 ¥17.92
2.0 · 1080p ¥32.64 ¥19.84
2.0 · 4k ¥16.64 ¥10.24
2.5 · 480p / 720p ¥44.80 ¥26.88
2.5 · 1080p ¥49.28 ¥29.44

Differences from China official:

  • duration must be an integer (4–15 for 2.0, 4–30 for 2.5); -1 is not accepted. resolution is required. ratio does not take adaptive; use 16:9, 9:16, 1:1, 21:9, 4:3 or 3:4.
  • bitrate_mode is not supported (it is ignored; the line sets the bitrate), nor are return_last_frame, drafts (draft, draft_task), frames, execution_expires_after and callback_url. seed, watermark and camera_fixed accept only their defaults.
  • Reference media may be public URLs, base64 or asset:// references to the material library. Library materials reach the upstream as file links and are reviewed by this line itself, not by the Volcengine material library.
  • Task queries carry no Volcengine task ID (provider_task_id).

Contact us: pricing, volume and support

Need volume pricing, a dedicated discount group, higher concurrency or integration help? Reach out and mention "API partnership" with your expected volume.