International direct API (V4)
The international dreamina-seedance-* models also have a direct API, under paths starting with /api/v4/, which works the way the official BytePlus ModelArk API does: reference media in a request go upstream unchanged instead of through the Decode material library, materials are created straight in the upstream material library, and generated videos are returned as official links. The China doubao-seedance-* models cannot use the direct API; such a request returns 400.
Default API (/api/v3 + /v1/materials) |
Direct API (/api/v4) |
|
|---|---|---|
| Reference URLs / base64 in a request | Saved to the material library and reviewed first | Sent upstream unchanged |
| Material ID | mat_... (a Decode ID) |
asset-... (the official asset ID) |
| Generated video | Kept by Decode, returned as a Decode download URL | Official link, valid for 24 hours, not kept by Decode |
| Deleting materials | Single materials | Whole groups only |
| Material count | Limited by storage, removed after 30 days unused | At most 200 per key, never removed automatically |
Materials of the two APIs are not interchangeable: the direct API references only materials uploaded through the direct API, plus the platform's preset digital characters, and the default API cannot reference direct materials.
Generate a video (V4)
POST /api/v4/contents/generations/tasks: submit a task. The body is the same as in Submit a task;modelmust be adreamina-seedance-*model.GET /api/v4/contents/generations/tasks/{id}: query a task. The response is the same as in Query a task.GET /api/v4/contents/generations/tasks: list tasks, with the parameters in List tasks; video addresses are the official links.
curl https://decode8.com/api/v4/contents/generations/tasks \
-H "Authorization: Bearer $DECODE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-261111",
"content": [
{ "type": "text", "text": "The person in image 1 walks along the beach, slow dolly-in" },
{ "type": "image_url", "role": "reference_image", "image_url": { "url": "asset://asset-20261116180558-7kmn2" } }
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}'
- Reference media: images may be public URLs,
data:image/...;base64,...orasset://ID; videos may be public URLs orasset://ID, not base64; audio may be public URLs,data:audio/...;base64,...orasset://ID. - Images and videos with real human faces must first be uploaded through the material endpoints below and referenced as
asset://IDonce approved. Passed as a URL, they are blocked upstream. Media without faces, such as product shots, may be passed as URLs. - Referenced materials must have passed the review (
statusisactive): a refused material returns 400 and is not charged, and a material still under review is refused upstream, so wait foractivebefore submitting. - When a task succeeds,
content.video_urlis the official video link, valid for 24 hours. Decode keeps no copy and cannot recover an expired link, so download promptly. - The upstream platform trusts original outputs of the same account for 30 days: a face-containing video generated through the direct API can be reused as a reference video by passing the returned
content.video_url, subject to the upstream review. A downloaded and re-uploaded file loses this trust. - Billing is the same as in Billing.
Materials (V4)
Requests and responses follow /v1/materials in Material library, with the differences below.
POST /api/v4/materials: upload a material.
curl https://decode8.com/api/v4/materials \
-H "Authorization: Bearer $DECODE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/actor.png", "name": "Lead, front", "group_id": "group-20261116100548-0cind"}'
| Field | Required | Description |
|---|---|---|
file / url |
One | A local file (multipart/form-data), or a publicly reachable http(s) URL |
name |
No | Material name, the file name by default |
group_id |
No | Target group; without it the material goes to an automatically created default group |
type |
No | For url only: image, video or audio; by default taken from the URL's extension, otherwise an image |
- A
urlis handed to the upstream as is, so make sure the upstream can reach it. Afileis checked against the file requirements in Add a material, then staged for the upstream to fetch and deleted once the review ends. - The response is a material object whose
idis the official asset ID and whosereferenceisasset://ID. The file lives only upstream, sourlis empty.
{
"id": "asset-20261116180558-7kmn2",
"object": "material",
"type": "image",
"name": "Lead, front",
"status": "pending",
"reject_reason": "",
"group_id": "group-20261116100548-0cind",
"reference": "asset://asset-20261116180558-7kmn2",
"url": "",
"copies": [{ "library": "byteplus", "status": "processing" }],
"created_at": 1794823559
}
GET /api/v4/materials/{id}: one material. A new upload ispending, usuallyactivewithin tens of seconds; a refused one isrejected, with the reason inreject_reason.GET /api/v4/materials?group_id=&type=&status=&page=1&page_size=20: list materials, in the same shape as/v1/materials.PATCH /api/v4/materials/{id}with{"name": "..."}: rename. A material cannot move to another group; anothergroup_idreturns 400material_move_unsupported, so upload it again in that group.DELETE /api/v4/materials/{id}: not supported, returns 400material_delete_unsupported. The upstream deletes materials only by whole group, so delete the material's group.
Groups:
POST /api/v4/material-groupswith{"name": "..."}: create a group; itsidis the official group ID. Each key may create up to 20 groups.GET /api/v4/material-groups: list groups, withmaterial_count(materials held) andmaterial_limit(the limit).PATCH /api/v4/material-groups/{id}with{"name": "..."}: rename a group you created.DELETE /api/v4/material-groups/{id}: delete a group and every material in it, permanently. Tasks still using those materials may fail.
Notes:
- Materials belong to one API key: only the key that uploaded a material can see and reference it. Other keys get 404 when reading it and 400 when referencing it.
- Each key keeps at most 200 materials (refused ones included). At the limit, uploads return 403
material_quota_exceeded; delete groups you no longer need first. - When the upstream material library is full, uploads return 409
material_library_full; try again later or upload into a new group. - Materials are never removed for being unused. When an API key is deleted, its material groups are deleted within an hour.