Material groups and assets
Seedance API(v3)
Use https://api.tokenlio.ai with your platform Bearer Key and an exact model ID from the current catalog. Official references provide more field details; use the addresses, authentication and examples on this page for your calls.
Manage groups and image, video or audio assets. AIGC groups and verified-person groups use the same material Actions. Obtain GroupId through person verification when that workflow is needed.
For an uncertain mutation, save X-Tokenlio-Operation-Id and follow recovery. Materials are shared within a Workspace; see access scope.
| Method | Path |
|---|---|
| POST | /?Action={Action}&Version=2024-01-01 |
| POST | /api/v3/assets?Action={Action} |
Actions
| Action | Request body example | Result |
|---|---|---|
CreateAssetGroup | {"Name":"Characters"} | Id |
GetAssetGroup | {"Id":"GROUP_ID"} | Group details |
ListAssetGroups | {} | Items and pagination |
UpdateAssetGroup | {"Id":"GROUP_ID","Name":"New name"} | Id |
DeleteAssetGroup | {"Id":"GROUP_ID"} | {} |
CreateAsset | {"GroupId":"GROUP_ID","URL":"https://example.com/character.png","AssetType":"Image"} | Id |
GetAsset | {"Id":"ASSET_ID"} | Asset details and status |
ListAssets | {"Filter":{"GroupIds":["GROUP_ID"]}} | Items and pagination |
UpdateAsset | {"Id":"ASSET_ID","Name":"New name"} | Id |
DeleteAsset | {"Id":"ASSET_ID"} | {} |
Request parameters
| Field | Type | Description |
|---|---|---|
Id | string | Group/asset ID for query, update and delete. Case-sensitive. |
GroupId | string | Parent group for CreateAsset. |
Name | string | 1–128 characters. Required for CreateAssetGroup and UpdateAsset. Optional for CreateAsset: when omitted, Tokenlio generates a 16-character name using lowercase letters and digits. Supplied names are preserved. |
Description | string | Up to 1024 characters; an empty value clears a group description. UpdateAssetGroup needs Name or Description. |
GroupType | string | Defaults to AIGC only when absent; explicit values are preserved. |
AssetType | string | Image, Video or Audio. Required for asset creation. |
URL | string | Accessible HTTPS media URL, up to 8192 characters. |
ProjectName | string | Optional, 1–128 characters; omitted means project default. Keep related operations in the same project. |
NextToken / MaxResults | string / integer | Cursor mode; MaxResults 1–100, default 10. |
PageNumber / PageSize | integer | Explicit page mode: 1–1000000 / 1–100, defaults 1 / 10; cannot be combined with cursor parameters. |
SortBy / SortOrder | string | CreateTime / UpdateTime; ListAssets also accepts GroupId. Asc / Desc; defaults CreateTime / Desc. |
Filter.GroupType | string | Defaults to AIGC; use LivenessFace for verified-person groups. |
Filter.GroupIds | string[] | Up to 100 distinct group IDs. |
Filter.Name | string | Name substring. |
Filter.Statuses | string[] | ListAssets: Pending, Processing, Active or Failed. |
For the next cursor page, keep the same filters, ordering and page size. Use Id for Get/Delete Actions, not GroupId or an Id query parameter.
Lengths in this table are request acceptance limits; actual processing and parameter results follow the response. Use the original JSON types.
Create and query assets
The minimal CreateAsset body in the Action table omits Name. Tokenlio generates a 16-character name from a-z and 0-9; view it with GetAsset or ListAssets. The examples below show an explicit Name, which is preserved. This default applies only to CreateAsset; CreateAssetGroup and UpdateAsset still require Name.
curl -sS --fail-with-body "https://api.tokenlio.ai/api/v3/assets?Action=CreateAssetGroup&Version=2024-01-01" \
-H "Authorization: Bearer $TOKENLIO_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"Name": "Characters"
}'
curl -sS --fail-with-body "https://api.tokenlio.ai/api/v3/assets?Action=CreateAsset" \
-H "Authorization: Bearer $TOKENLIO_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"GroupId": "GROUP_ID",
"Name": "Portrait",
"URL": "https://example.com/character.png",
"AssetType": "Image"
}'
curl -sS --fail-with-body "https://api.tokenlio.ai/api/v3/assets?Action=GetAsset" \
-H "Authorization: Bearer $TOKENLIO_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"Id": "ASSET_ID"
}'import os
import requests
BASE_URL = "https://api.tokenlio.ai"
headers = {
"Authorization": f"Bearer {os.environ['TOKENLIO_API_KEY']}",
"Content-Type": "application/json",
}
def action(name, body):
response = requests.post(
f"{BASE_URL}/api/v3/assets?Action={name}",
headers=headers, json=body, timeout=30,
)
response.raise_for_status()
data = response.json()
error = data.get("ResponseMetadata", {}).get("Error") or (data.get("Result") or {}).get("Error")
if error:
raise RuntimeError(error)
return data["Result"]
group = action("CreateAssetGroup", {"Name": "Characters"})
asset = action("CreateAsset", {
"GroupId": group["Id"],
"Name": "Portrait",
"URL": "https://example.com/character.png",
"AssetType": "Image",
})
print(action("GetAsset", {"Id": asset["Id"]}))const baseUrl = "https://api.tokenlio.ai";
const headers = {
Authorization: `Bearer ${process.env.TOKENLIO_API_KEY}`,
"Content-Type": "application/json",
};
async function action(name, body) {
const response = await fetch(`${baseUrl}/api/v3/assets?Action=${name}`, {
method: "POST", headers, body: JSON.stringify(body),
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
const data = await response.json();
const error = data.ResponseMetadata?.Error || data.Result?.Error;
if (error) throw new Error(JSON.stringify(error));
return data.Result;
}
const group = await action("CreateAssetGroup", { Name: "Characters" });
const asset = await action("CreateAsset", {
GroupId: group.Id, Name: "Portrait", URL: "https://example.com/character.png", AssetType: "Image",
});
console.log(await action("GetAsset", { Id: asset.Id }));GetAsset returns the latest asset status. Pending/Processing are not completion; Active means ready for use, and Failed includes failure information. To reference an asset in generation, use asset://ASSET_ID in the create video tasks.
Lists and pagination
Without pagination fields, cursor mode defaults to MaxResults=10. Result contains Items and includes NextToken only when another page exists. Resubmit that token unchanged with the same project, filters, sort and MaxResults. Do not send an empty NextToken or reuse a cursor across Workspaces/material services.
Explicit PageNumber/PageSize selects page mode with Items/TotalCount/PageNumber/PageSize. Never combine the modes. Lists do not refresh every asset status; use GetAsset for a fresh status.
curl -sS --fail-with-body 'https://api.tokenlio.ai/api/v3/assets?Action=ListAssetGroups&Version=2024-01-01' \
-H "Authorization: Bearer $TOKENLIO_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"ProjectName": "default",
"Filter": {
"GroupType": "AIGC"
},
"PageNumber": 1,
"PageSize": 10,
"SortBy": "CreateTime",
"SortOrder": "Desc"
}'
curl -sS --fail-with-body 'https://api.tokenlio.ai/api/v3/assets?Action=ListAssets' \
-H "Authorization: Bearer $TOKENLIO_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"ProjectName": "default",
"Filter": {
"GroupIds": [
"GROUP_ID"
],
"GroupType": "AIGC"
},
"MaxResults": 10
}'Responses and errors
{
"ResponseMetadata": {
"RequestId": "REQUEST_ID",
"Action": "CreateAssetGroup",
"Version": "2024-01-01",
"Service": "ark",
"Region": "cn-beijing"
},
"Result": {
"Id": "GROUP_ID"
}
}List results contain Items and, when another cursor page exists, NextToken. Explicit page mode returns TotalCount, PageNumber and PageSize. Deleting a group also deletes its assets; check the target carefully before deletion. Successful DeleteAsset and DeleteAssetGroup return HTTP200 and an empty Result: {}, without Id. Asset deletion does not cancel existing generation tasks or refund their charges; use each task's actual outcome if deletion races generation.
{
"ResponseMetadata": {
"RequestId": "REQUEST_ID",
"Action": "GetAsset",
"Version": "2024-01-01",
"Service": "ark",
"Region": "cn-beijing",
"Error": {
"Code": "InvalidParameter",
"Message": "One or more parameters specified in the request are not valid."
}
}
}Check the HTTP status and ResponseMetadata.Error.Code/Message. Common errors include MissingParameter/InvalidParameter, AuthenticationError, AccessDenied, ResourceNotFound, OperationConflict, RequestTooLarge, RequestLimitExceeded and ServiceUnavailable. A verification result that is not ready is an error response, not a successful GroupId.
Observed HTTP statuses, full ResponseMetadata/Result, error fields and valid extensions are retained rather than all becoming 503. Correct a definitive parameter rejection using Code/Message. An internal timeout encoded as HTTP422 may already have submitted; never automatically create a new intent. Recover an unknown mutation with its original body, stable key and operation ID. ResourceNotFound may also mean the asset is outside the authorized management scope, even when it exists elsewhere.
