Asset Library
Create and manage asset groups and referenced media through ten signed public Actions.
Generate video from media URLs
For automatic asset preparation from HTTPS URLs, use the separate URL video entry. It still requires an enabled asset key; existing native and manual-asset workflows remain available.
Quick use
Sign every request to the single public endpoint. Create a group first, synchronously create the asset with its GroupId, then pass the returned stable asset URI to a supported generation workflow.
Generate AK/SK
Create an enabled asset key in Console and store both values securely.
CreateAssetGroup
Save the returned group Id.
CreateAsset
The synchronous success response returns the completed asset Id.
asset://<Id>
Use the returned Id as a stable asset reference immediately.
1. POST /api/v1/asset?Action=CreateAssetGroup&Version=2024-01-01
{"Name":"reference-images","GroupType":"AIGC","ProjectName":"default"}
-> Result.Id = group_123
2. POST /api/v1/asset?Action=CreateAsset&Version=2024-01-01
{"GroupId":"group_123","URL":"https://cdn.example.com/reference.png","Name":"reference-image","AssetType":"Image","ProjectName":"default"}
-> creation completes; Result.Id = asset_123
3. Use asset://asset_123 in a supported generation request
Call flow
CreateAsset completes synchronously. A successful response returns Id only after creation is complete, so no GetAsset readiness polling is required.
Signed client request
POST Action and Version in query with the exact signed JSON body.
POST /api/v1/asset
Token168 verifies the key, time, hash, canonical request, and replay window.
Synchronous result
Creation finishes before a successful response; otherwise the request returns a public error.
Result.Id
Use the returned Id immediately as asset://<Id>.
Public error
Correct the request or media from the public error, then sign a new request.
Generate AK/SK
Asset library keys are separate from Bearer API keys. Each account can have only one enabled asset key pair. Generate and manage it from Console.
| Step | Operation |
|---|---|
| 1 | Open Console, enter Asset Library, and select key management. |
| 2 | Coordinate the client cutover before creating a key. Creating a new asset key immediately disables the account's currently enabled asset key, then issues one new AK and SK. |
| 3 | Store AK and SK in a server-side secret manager; never place them in browser code, URLs, or logs. |
| 4 | The SK is masked by default. Explicitly viewing it again returns the plaintext and creates an immutable audit record. |
| 5 | Disable the key to invalidate new signed requests immediately. Use this for revocation; creating a replacement already disables the previous key. |
Key handling
Treat SK as a password. Rotate it after suspected disclosure and do not persist the example credentials shown below.
Signing and verification
Hash the exact UTF-8 request body bytes. JSON whitespace, field order, and escaping are part of the signed payload.
Build the canonical query from the single Action and Version values. Use the actual request Host, lowercase header names, normalized header values, and the required trailing newline after canonical headers.
Use the credential scope date/ap-southeast-1/ark/request, derive the four HMAC-SHA256 keys, and encode the final signature as lowercase hexadecimal.
The server recomputes the body hash, canonical request, scope, and signature with the SK bound to the AK. X-Date must be within 15 minutes, and an identical signed request is rejected as a replay during the 15-minute window.
Clients must not send xrealip. It is ingress transport metadata, is not a public parameter, and is excluded from the canonical query.
Send the following HTTP header values and Authorization fields with every signed request. Authorization carries the AK, credential scope, signed-header list, and final signature; Authorization itself is not included in the canonical signed headers.
| Header or field | Value or format | Description |
|---|---|---|
| Authorization | HMAC-SHA256 Credential=<AK>/<scope>, SignedHeaders=<headers>, Signature=<signature> | Carries the AK and credential scope, the exact SignedHeaders list, and the lowercase hexadecimal signature. |
| Content-Type | application/json | Must be application/json and is included in the canonical headers. |
| Host | <actual request host> | Use the actual request host, normalize the value, and include it in the canonical headers. |
| X-Content-Sha256 | lowercase_hex(SHA256(body bytes)) | Lowercase hexadecimal SHA-256 of the exact UTF-8 request body bytes. |
| X-Date | YYYYMMDDTHHMMSSZ | UTC timestamp in YYYYMMDDTHHMMSSZ format; it must be within the 15-minute acceptance window. |
| SignedHeaders | content-type;host;x-content-sha256;x-date | The exact lowercase, semicolon-delimited canonical header names. Do not include Authorization itself. |
payloadHash = lowercase_hex(SHA256(exact UTF-8 body bytes))
canonicalRequest =
"POST\n" +
"/api/v1/asset\n" +
"Action=<Action>&Version=2024-01-01\n" +
"content-type:application/json\n" +
"host:<actual request host>\n" +
"x-content-sha256:<payloadHash>\n" +
"x-date:<YYYYMMDDTHHMMSSZ>\n\n" +
"content-type;host;x-content-sha256;x-date\n" +
payloadHash
scope = YYYYMMDD + "/ap-southeast-1/ark/request"
stringToSign = "HMAC-SHA256\n" + xDate + "\n" + scope + "\n" +
lowercase_hex(SHA256(canonicalRequest))
kDate = HMAC-SHA256(SK, YYYYMMDD)
kRegion = HMAC-SHA256(kDate, "ap-southeast-1")
kService = HMAC-SHA256(kRegion, "ark")
kSigning = HMAC-SHA256(kService, "request")
signature = lowercase_hex(HMAC-SHA256(kSigning, stringToSign))
export TOKEN168_ASSET_AK=AKIDEXAMPLE
export TOKEN168_ASSET_SK=SECRETEXAMPLE
export TOKEN168_ASSET_ENDPOINT=https://www.token168.cc/api/v1/asset
export TOKEN168_ASSET_DATE=20260815T123456Z
export TOKEN168_ASSET_DRY_RUN=1
export TOKEN168_ASSET_EXPECTED_SIGNATURE=36d6f63685fd44c8939ba44920343337e7b4222015b4cfb384d29c39b0640f51
node asset-library-signing.mjs
go run main.go
# Both commands print:
# HMAC-SHA256 Credential=AKIDEXAMPLE/20260815/ap-southeast-1/ark/request, SignedHeaders=content-type;host;x-content-sha256;x-date, Signature=36d6f63685fd44c8939ba44920343337e7b4222015b4cfb384d29c39b0640f51
Rejected authentication shapes
Authorization: Bearer, legacy X-Asset headers, Action/Version/Service in the JSON body, unknown body fields, and client-added query parameters are rejected.
Run with the built-in node:crypto module. Dry-run mode prints and verifies Authorization without sending a network request.
import crypto from "node:crypto";
const accessKey = process.env.TOKEN168_ASSET_AK;
const secretKey = process.env.TOKEN168_ASSET_SK;
const endpoint = process.env.TOKEN168_ASSET_ENDPOINT || "https://www.token168.cc/api/v1/asset";
const action = "ListAssetGroups";
const version = "2024-01-01";
const region = "ap-southeast-1";
const service = "ark";
const signedHeaders = "content-type;host;x-content-sha256;x-date";
const body = '{"Filter":{"Name":"demo","GroupType":"AIGC"},"PageNumber":1,"PageSize":10,"SortBy":"CreateTime","SortOrder":"Desc"}';
if (!accessKey || !secretKey) {
throw new Error("Set TOKEN168_ASSET_AK and TOKEN168_ASSET_SK");
}
const sha256 = (value) => crypto.createHash("sha256").update(value).digest("hex");
const hmac = (key, value) => crypto.createHmac("sha256", key).update(value).digest();
const requestUrl = new URL(endpoint);
requestUrl.search = new URLSearchParams({ Action: action, Version: version }).toString();
const xDate = process.env.TOKEN168_ASSET_DATE ||
new Date().toISOString().replace(/[:-]|\.\d{3}/g, "");
const shortDate = xDate.slice(0, 8);
const payloadHash = sha256(Buffer.from(body, "utf8"));
const canonicalHeaders = [
"content-type:application/json",
"host:" + requestUrl.host,
"x-content-sha256:" + payloadHash,
"x-date:" + xDate
].join("\n") + "\n";
const canonicalRequest = [
"POST",
requestUrl.pathname,
requestUrl.searchParams.toString(),
canonicalHeaders,
signedHeaders,
payloadHash
].join("\n");
const scope = shortDate + "/" + region + "/" + service + "/request";
const stringToSign = ["HMAC-SHA256", xDate, scope, sha256(canonicalRequest)].join("\n");
const kDate = hmac(Buffer.from(secretKey, "utf8"), shortDate);
const kRegion = hmac(kDate, region);
const kService = hmac(kRegion, service);
const kSigning = hmac(kService, "request");
const signature = crypto.createHmac("sha256", kSigning).update(stringToSign).digest("hex");
const authorization = "HMAC-SHA256 Credential=" + accessKey + "/" + scope +
", SignedHeaders=" + signedHeaders + ", Signature=" + signature;
console.log(authorization);
if (process.env.TOKEN168_ASSET_DRY_RUN === "1") {
const expected = process.env.TOKEN168_ASSET_EXPECTED_SIGNATURE;
if (expected && signature !== expected) throw new Error("signature mismatch");
} else {
const response = await fetch(requestUrl, {
method: "POST",
headers: {
Authorization: authorization,
"Content-Type": "application/json",
"X-Content-Sha256": payloadHash,
"X-Date": xDate
},
body
});
console.log(response.status, await response.text());
}
Common response metadata
Every success response includes the same ResponseMetadata envelope in addition to the Action-specific Result.
| Field | Type | Description |
|---|---|---|
| ResponseMetadata.RequestId | string | Unique request identifier to retain for troubleshooting and support. |
| ResponseMetadata.Action | string | Action value processed for this response. |
| ResponseMetadata.Version | 2024-01-01 | Public asset API version. The current value is 2024-01-01. |
| ResponseMetadata.Service | ark | Signing service identifier. The fixed value is ark. |
| ResponseMetadata.Region | ap-southeast-1 | Signing region identifier. The fixed value is ap-southeast-1. |
Asset groups
CreateAssetGroup
POST /api/v1/asset?Action=CreateAssetGroup&Version=2024-01-01
Create an account-scoped asset group and associate it with the requested Project.
| Field | Type | Presence | Description |
|---|---|---|---|
| Name | string | Required | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| Description | string | Optional | Human-readable asset-group description. |
| GroupType | AIGC | Optional | Asset-group classification. The only accepted value is AIGC. |
| ProjectName | string | Optional | Project scope for create, list, and get operations. An omitted or empty value defaults to default. |
{
"Name": "reference-images",
"Description": "Reference image assets",
"GroupType": "AIGC",
"ProjectName": "default"
}
| Success Result field | Type | Description |
|---|---|---|
| Result.Id | string | Stable Token168 identifier returned by the completed create or update operation. |
{
"ResponseMetadata": {
"RequestId": "req_CreateAssetGroup",
"Action": "CreateAssetGroup",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {
"Id": "group_123"
}
}
Action constraints
Name must be non-empty. GroupType defaults to AIGC and rejects other values; ProjectName defaults to default.
ListAssetGroups
POST /api/v1/asset?Action=ListAssetGroups&Version=2024-01-01
List groups visible in a Project with filters, sorting, and pagination.
| Field | Type | Presence | Description |
|---|---|---|---|
| Filter | object | Required | Required filter object that scopes the list operation. |
| Filter.GroupType | AIGC | Required | Asset-group classification. The only accepted value is AIGC. |
| Filter.GroupIds | string[] | Optional | Limit results to these asset-group identifiers. Omit the field to include every visible group. |
| Filter.Name | string | Optional | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| PageNumber | integer | Required | One-based page number. The minimum accepted value is 1. |
| PageSize | integer | Required | Number of records per page. Accepted values are 1 through 100. |
| SortBy | CreateTime | UpdateTime | Optional | Asset-group sort field. Accepted values are CreateTime or UpdateTime. |
| SortOrder | Asc | Desc | Optional | Sort direction. Accepted values are Asc or Desc. |
| ProjectName | string | Optional | Project scope for create, list, and get operations. An omitted or empty value defaults to default. |
{
"Filter": {
"Name": "demo",
"GroupType": "AIGC"
},
"PageNumber": 1,
"PageSize": 10,
"SortBy": "CreateTime",
"SortOrder": "Desc"
}
| Success Result field | Type | Description |
|---|---|---|
| Result.Items | AssetGroup[] | Asset groups returned for the current page. |
| Result.Items[].Id | string | Token168 identifier of the target resource. |
| Result.Items[].Name | string | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| Result.Items[].Title | string | Display title currently derived from the asset-group name. |
| Result.Items[].Description | string? | Human-readable asset-group description. |
| Result.Items[].GroupType | AIGC | Asset-group classification. The only accepted value is AIGC. |
| Result.Items[].ProjectName | string | Project name represented by this response projection. |
| Result.Items[].CreateTime | RFC3339 | RFC3339 timestamp recorded by Token168 for this resource event. |
| Result.Items[].UpdateTime | RFC3339 | RFC3339 timestamp recorded by Token168 for this resource event. |
| Result.TotalCount | integer | Total number of matching records before pagination. |
| Result.PageNumber | integer | One-based page number represented by this response. |
| Result.PageSize | integer | Maximum number of records requested for this response page. |
{
"ResponseMetadata": {
"RequestId": "req_ListAssetGroups",
"Action": "ListAssetGroups",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {
"Items": [
{
"Id": "group_123",
"Name": "reference-images",
"Title": "reference-images",
"Description": "Reference image assets",
"GroupType": "AIGC",
"ProjectName": "default",
"CreateTime": "2026-08-15T12:00:00Z",
"UpdateTime": "2026-08-15T12:00:00Z"
}
],
"TotalCount": 1,
"PageNumber": 1,
"PageSize": 10
}
}
Action constraints
Filter.GroupType must be AIGC. Filter.Name is at most 64 Unicode characters; PageNumber is at least 1 and PageSize is 1-100. SortBy accepts CreateTime or UpdateTime; SortOrder accepts Asc or Desc.
GetAssetGroup
POST /api/v1/asset?Action=GetAssetGroup&Version=2024-01-01
Get one asset group by Id in the selected Project scope.
| Field | Type | Presence | Description |
|---|---|---|---|
| Id | string | Required | Token168 identifier of the target resource. |
| ProjectName | string | Optional | Project scope for create, list, and get operations. An omitted or empty value defaults to default. |
{
"Id": "group_123",
"ProjectName": "default"
}
| Success Result field | Type | Description |
|---|---|---|
| Result.Id | string | Token168 identifier of the target resource. |
| Result.Name | string | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| Result.Title | string | Display title currently derived from the asset-group name. |
| Result.Description | string? | Human-readable asset-group description. |
| Result.GroupType | AIGC | Asset-group classification. The only accepted value is AIGC. |
| Result.ProjectName | string | Project name represented by this response projection. |
| Result.CreateTime | RFC3339 | RFC3339 timestamp recorded by Token168 for this resource event. |
| Result.UpdateTime | RFC3339 | RFC3339 timestamp recorded by Token168 for this resource event. |
{
"ResponseMetadata": {
"RequestId": "req_GetAssetGroup",
"Action": "GetAssetGroup",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {
"Id": "group_123",
"Name": "reference-images",
"Title": "reference-images",
"Description": "Reference image assets",
"GroupType": "AIGC",
"ProjectName": "default",
"CreateTime": "2026-08-15T12:00:00Z",
"UpdateTime": "2026-08-15T12:00:00Z"
}
}
Action constraints
ProjectName defaults to default. A group outside the account or Project scope is returned as ResourceNotFound.
UpdateAssetGroup
POST /api/v1/asset?Action=UpdateAssetGroup&Version=2024-01-01
Update asset group metadata without changing Project associations.
| Field | Type | Presence | Description |
|---|---|---|---|
| Id | string | Required | Token168 identifier of the target resource. |
| Name | string | Optional | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| Description | string | Optional | Human-readable asset-group description. |
| ProjectName | string | Optional | Accepted for request-shape compatibility. Update and delete operations are account-scoped and select the target by Id; ProjectName does not scope, authorize, or move the mutation. |
{
"Id": "group_123",
"Name": "campaign-images",
"Description": "Campaign references",
"ProjectName": "default"
}
| Success Result field | Type | Description |
|---|---|---|
| Result.Id | string | Stable Token168 identifier returned by the completed create or update operation. |
{
"ResponseMetadata": {
"RequestId": "req_UpdateAssetGroup",
"Action": "UpdateAssetGroup",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {
"Id": "group_123"
}
}
Action constraints
Only Name and Description are mutable. A blank Name is treated as omitted, and the default group cannot be renamed. Omitting Description clears the existing description; send the current Description to retain it. ProjectName does not scope this account-level mutation; Id selects the group.
DeleteAssetGroup
POST /api/v1/asset?Action=DeleteAssetGroup&Version=2024-01-01
Delete a non-default asset group and make its assets unavailable.
| Field | Type | Presence | Description |
|---|---|---|---|
| Id | string | Required | Token168 identifier of the target resource. |
| ProjectName | string | Optional | Accepted for request-shape compatibility. Update and delete operations are account-scoped and select the target by Id; ProjectName does not scope, authorize, or move the mutation. |
{
"Id": "group_123",
"ProjectName": "default"
}
| Success Result field | Type | Description |
|---|---|---|
| Result | object (empty) | Empty object confirming that the delete operation succeeded. |
{
"ResponseMetadata": {
"RequestId": "req_DeleteAssetGroup",
"Action": "DeleteAssetGroup",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {}
}
Action constraints
The system default group cannot be deleted. Deleting a group also deletes its associated assets. ProjectName does not scope this account-level mutation; Id selects the group.
Assets
CreateAsset
POST /api/v1/asset?Action=CreateAsset&Version=2024-01-01
Synchronously create an asset from a public media URL inside an existing group and return its Id after creation completes.
| Field | Type | Presence | Description |
|---|---|---|---|
| GroupId | string | Required | Identifier of the existing asset group that owns the asset. |
| URL | HTTP/HTTPS URL | Required | Public HTTP or HTTPS media URL. Base64 and direct file-upload bodies are not accepted. |
| AssetType | Image | Video | Audio | Required | Declared media type. Accepted values are Image, Video, or Audio. |
| Name | string | Optional | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| Moderation | object | Optional | Optional object that selects the moderation strategy for this asset. |
| Moderation.Strategy | Default | Skip | Optional | Moderation behavior. Accepted values are Default or Skip. |
| ProjectName | string | Optional | Project scope for create, list, and get operations. An omitted or empty value defaults to default. |
{
"GroupId": "group_123",
"URL": "https://cdn.example.com/reference.png",
"Name": "reference-image",
"AssetType": "Image",
"Moderation": {
"Strategy": "Default"
},
"ProjectName": "default"
}
| Success Result field | Type | Description |
|---|---|---|
| Result.Id | string | Stable Token168 identifier returned by the completed create or update operation. |
{
"ResponseMetadata": {
"RequestId": "req_CreateAsset",
"Action": "CreateAsset",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {
"Id": "asset_123"
}
}
Action constraints
GroupId, URL, and AssetType must be present and non-blank. AssetType accepts Image, Video, or Audio; Name is at most 64 Unicode characters; Moderation.Strategy accepts Default or Skip.
ListAssets
POST /api/v1/asset?Action=ListAssets&Version=2024-01-01
List assets visible in a Project with group, status, name, sorting, and pagination filters.
| Field | Type | Presence | Description |
|---|---|---|---|
| Filter | object | Required | Required filter object that scopes the list operation. |
| Filter.GroupType | AIGC | Required | Asset-group classification. The only accepted value is AIGC. |
| Filter.GroupIds | string[] | Optional | Limit results to these asset-group identifiers. Omit the field to include every visible group. |
| Filter.Statuses | (Active | Processing | Failed)[] | Optional | Limit assets to the selected aggregate statuses: Active, Processing, or Failed. |
| Filter.Name | string | Optional | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| PageNumber | integer | Required | One-based page number. The minimum accepted value is 1. |
| PageSize | integer | Required | Number of records per page. Accepted values are 1 through 100. |
| SortBy | CreateTime | UpdateTime | GroupId | Optional | Asset sort field. Accepted values are CreateTime, UpdateTime, or GroupId. |
| SortOrder | Asc | Desc | Optional | Sort direction. Accepted values are Asc or Desc. |
| ProjectName | string | Optional | Project scope for create, list, and get operations. An omitted or empty value defaults to default. |
{
"Filter": {
"GroupIds": [
"group_123"
],
"GroupType": "AIGC",
"Statuses": [
"Processing",
"Active"
],
"Name": "reference"
},
"PageNumber": 1,
"PageSize": 20,
"SortBy": "UpdateTime",
"SortOrder": "Desc",
"ProjectName": "default"
}
| Success Result field | Type | Description |
|---|---|---|
| Result.Items | Asset[] | Assets returned for the current page. |
| Result.Items[].Id | string | Token168 identifier of the target resource. |
| Result.Items[].Name | string | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| Result.Items[].URL | string | Current media fetch location; it may be temporary and is not the durable asset identity. |
| Result.Items[].GroupId | string | Identifier of the existing asset group that owns the asset. |
| Result.Items[].AssetType | Image | Video | Audio | Declared media type. Accepted values are Image, Video, or Audio. |
| Result.Items[].Status | Active | Processing | Failed | Aggregate asset status: Active, Processing, or Failed. |
| Result.Items[].Error | object? | Public failure details when the asset has an exposed processing error. |
| Result.Items[].Error.Code | string? | Stable public code describing the asset processing failure. |
| Result.Items[].Error.Message | string? | Human-readable public explanation of the asset processing failure. |
| Result.Items[].Moderation | object? | Moderation settings recorded for the asset when available. |
| Result.Items[].Moderation.Strategy | Default | Skip | Moderation behavior. Accepted values are Default or Skip. |
| Result.Items[].LastInferenceTime | RFC3339? | RFC3339 timestamp of the latest inference use when available. |
| Result.Items[].ProjectName | string | Project name represented by this response projection. |
| Result.Items[].CreateTime | RFC3339 | RFC3339 timestamp recorded by Token168 for this resource event. |
| Result.Items[].UpdateTime | RFC3339 | RFC3339 timestamp recorded by Token168 for this resource event. |
| Result.TotalCount | integer | Total number of matching records before pagination. |
| Result.PageNumber | integer | One-based page number represented by this response. |
| Result.PageSize | integer | Maximum number of records requested for this response page. |
{
"ResponseMetadata": {
"RequestId": "req_ListAssets",
"Action": "ListAssets",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {
"Items": [
{
"Id": "asset_123",
"Name": "reference-image",
"URL": "https://cdn.example.com/reference.png",
"GroupId": "group_123",
"AssetType": "Image",
"Status": "Active",
"Moderation": {
"Strategy": "Default"
},
"ProjectName": "default",
"CreateTime": "2026-08-15T12:01:00Z",
"UpdateTime": "2026-08-15T12:01:30Z"
}
],
"TotalCount": 1,
"PageNumber": 1,
"PageSize": 20
}
}
Action constraints
Filter.GroupType must be AIGC. Filter.Name is at most 64 Unicode characters. Statuses accept Active, Processing, or Failed. PageNumber is at least 1 and PageSize is 1-100. SortBy accepts CreateTime, UpdateTime, or GroupId; SortOrder accepts Asc or Desc.
GetAsset
POST /api/v1/asset?Action=GetAsset&Version=2024-01-01
Get one asset, including its public aggregate status and current fetch URL.
| Field | Type | Presence | Description |
|---|---|---|---|
| Id | string | Required | Token168 identifier of the target resource. |
| ProjectName | string | Optional | Project scope for create, list, and get operations. An omitted or empty value defaults to default. |
{
"Id": "asset_123",
"ProjectName": "default"
}
| Success Result field | Type | Description |
|---|---|---|
| Result.Id | string | Token168 identifier of the target resource. |
| Result.Name | string | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| Result.URL | string | Current media fetch location; it may be temporary and is not the durable asset identity. |
| Result.GroupId | string | Identifier of the existing asset group that owns the asset. |
| Result.AssetType | Image | Video | Audio | Declared media type. Accepted values are Image, Video, or Audio. |
| Result.Status | Active | Processing | Failed | Aggregate asset status: Active, Processing, or Failed. |
| Result.Error | object? | Public failure details when the asset has an exposed processing error. |
| Result.Error.Code | string? | Stable public code describing the asset processing failure. |
| Result.Error.Message | string? | Human-readable public explanation of the asset processing failure. |
| Result.Moderation | object? | Moderation settings recorded for the asset when available. |
| Result.Moderation.Strategy | Default | Skip | Moderation behavior. Accepted values are Default or Skip. |
| Result.LastInferenceTime | RFC3339? | RFC3339 timestamp of the latest inference use when available. |
| Result.ProjectName | string | Project name represented by this response projection. |
| Result.CreateTime | RFC3339 | RFC3339 timestamp recorded by Token168 for this resource event. |
| Result.UpdateTime | RFC3339 | RFC3339 timestamp recorded by Token168 for this resource event. |
{
"ResponseMetadata": {
"RequestId": "req_GetAsset",
"Action": "GetAsset",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {
"Id": "asset_123",
"Name": "reference-image",
"URL": "https://cdn.example.com/reference.png",
"GroupId": "group_123",
"AssetType": "Image",
"Status": "Active",
"Moderation": {
"Strategy": "Default"
},
"ProjectName": "default",
"CreateTime": "2026-08-15T12:01:00Z",
"UpdateTime": "2026-08-15T12:01:30Z"
}
}
Action constraints
ProjectName defaults to default. Optional Error, Moderation, and LastInferenceTime fields appear only when available.
UpdateAsset
POST /api/v1/asset?Action=UpdateAsset&Version=2024-01-01
Rename an existing asset without changing its group, source, type, or Project associations.
| Field | Type | Presence | Description |
|---|---|---|---|
| Id | string | Required | Token168 identifier of the target resource. |
| Name | string | Optional | Human-readable resource name. Asset names and list name filters are limited to 64 Unicode characters where noted. |
| ProjectName | string | Optional | Accepted for request-shape compatibility. Update and delete operations are account-scoped and select the target by Id; ProjectName does not scope, authorize, or move the mutation. |
{
"Id": "asset_123",
"Name": "hero-reference",
"ProjectName": "default"
}
| Success Result field | Type | Description |
|---|---|---|
| Result.Id | string | Stable Token168 identifier returned by the completed create or update operation. |
{
"ResponseMetadata": {
"RequestId": "req_UpdateAsset",
"Action": "UpdateAsset",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {
"Id": "asset_123"
}
}
Action constraints
Only Name is mutable. Omitting Name clears the current name; send the current Name to retain it. ProjectName does not scope this account-level mutation; Id selects the asset.
DeleteAsset
POST /api/v1/asset?Action=DeleteAsset&Version=2024-01-01
Delete an asset by Id so it is no longer available to public reads or generation workflows.
| Field | Type | Presence | Description |
|---|---|---|---|
| Id | string | Required | Token168 identifier of the target resource. |
| ProjectName | string | Optional | Accepted for request-shape compatibility. Update and delete operations are account-scoped and select the target by Id; ProjectName does not scope, authorize, or move the mutation. |
{
"Id": "asset_123",
"ProjectName": "default"
}
| Success Result field | Type | Description |
|---|---|---|
| Result | object (empty) | Empty object confirming that the delete operation succeeded. |
{
"ResponseMetadata": {
"RequestId": "req_DeleteAsset",
"Action": "DeleteAsset",
"Version": "2024-01-01",
"Service": "ark",
"Region": "ap-southeast-1"
},
"Result": {}
}
Action constraints
Deletion returns an empty Result object and is irreversible from the public API. ProjectName does not scope this account-level mutation; Id selects the asset.
Public errors
| HTTP status | Error code | Client action |
|---|---|---|
| 400 | InvalidParameter | Fix the query, JSON shape, required fields, enums, filters, or pagination before retrying. |
| 401 | Unauthorized | Check AK status, body hash, Host, X-Date, credential scope, signature, and replay behavior. |
| 403 | Forbidden | Do not rename or delete protected defaults; verify account permissions. |
| 404 | ResourceNotFound | Check the Id and Project scope without assuming another account owns the resource. |
| 409 | Conflict | Resolve the conflicting name or state, then send a new signed request. |
| 500 | InternalError | Retry with backoff and retain RequestId for support. |
| 504 | InternalError | The operation timed out; retry with backoff and re-check state before creating duplicates. |
Media limits
CreateAsset accepts public HTTP/HTTPS URLs only. Base64 and direct file-upload bodies are not accepted. Token168 probes URL safety and media type; downstream processing can also reject media outside these documented limits.
| AssetType | Formats | Limits |
|---|---|---|
| Image | jpeg, png, webp, bmp, tiff, gif, heic, heif | Aspect ratio (0.4, 2.5), width and height (300, 6000) px, under 30 MB. |
| Video | mp4, mov | 480p/720p/1080p/4K, 2-30 seconds, aspect ratio [0.4, 2.5], width and height [300, 6000] px, total pixels [407696, 2086876], up to 200 MB, FPS [24, 60]. |
| Audio | wav, mp3 | 2-30 seconds and up to 15 MB. |
Asset status and temporary URLs
ListAssets and GetAsset may expose Active, Processing, or Failed on existing records. A successful CreateAsset has already completed and does not require readiness polling. URL may be a temporary upstream fetch URL valid for 12 hours and must not be stored as durable asset identity.
| Status | Meaning | Client action |
|---|---|---|
| Processing | Preprocessing or upstream synchronization is incomplete. | Treat the queried record as unavailable until a later read reports a terminal status; this is not a post-create requirement. |
| Active | The asset is ready for supported generation workflows. | Persist Id or asset://<Id>; treat URL as a fetch location only. |
| Failed | Preprocessing failed and public Error may be present. | Check URL, format, type, and limits before creating a corrected asset. |
Stable identity
Persist Token168 Id or asset://<Id>, never a temporary response URL. Calling GetAsset again reads the current snapshot and does not renew an expired temporary URL.
Capability boundaries
Asset groups, Projects, keys, and assets are account-scoped. ProjectName defaults to default, and public CreateAsset always requires an explicit GroupId.
Liveness-specific asset flows, direct file upload bodies, subtitle removal, generic task cancellation, and provider-only lifecycle controls are outside this public contract.
Strict public shape
Action and Version belong only in query. Request and response fields use PascalCase; create and update return {Id}, and delete returns an empty Result object.