On this page
1 Create Video Task
Seedance 2.0 video generation API, supporting text, images and other inputs.
Purpose: create a Seedance video generation task
https://tp-api.topenrouter.vip/v1/video/taskshttps://tp-api.topenrouter.vip/api/v3/contents/generations/tasksRequest Examples
curl https://tp-api.topenrouter.vip/v1/video/tasks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxx" \
-d '{
"model": "doubao-seedance-2.0",
"content": [
{"type": "text", "text": "A cat runs along the beach at sunset, cinematic style,4k"},
{"type": "image_url", "image_url": {"url": "https://example.com/input.jpg"}, "role": "reference_image"}
],
"ratio": "16:9",
"duration": 4,
"resolution": "720p",
"execution_expires_after": 3600,
"watermark": false
}'Main Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Video generation model ID, e.g. doubao-seedance-2.0 |
content | array | Yes | Input content array; supports text, images, video, audio and draft task IDs |
callback_url | string | No | Task callback URL |
return_last_frame | bool | No | Whether to return the last frame |
generate_audio | bool | No | Whether to generate synchronized audio |
draft | bool | No | Whether to enable draft mode |
tools | array/object | No | Tool configuration |
safety_identifier | string | No | Unique end-user identifier |
execution_expires_after | int | No | Task expiry time in seconds |
resolution | string | No | Video resolution, e.g. 720p or 1080p |
ratio | string | No | Aspect ratio, e.g. 16:9 or 9:16 |
duration | int | No | Video duration in seconds |
seed | int | No | Random seed |
watermark | bool | No | Whether to include a watermark |
content Structure
content supports the following item types:
text– Textimage_url– Imagevideo_url– Videoaudio_url– Audio
Supported role values include:
reference_image– Reference imagereference_video– Reference videoreference_audio– Reference audio
Response Example
{ "id": "task_xxxxxx" }2 Query a Single Task
Purpose: query details of a video generation task
https://tp-api.topenrouter.vip/v1/video/tasks/{id}https://tp-api.topenrouter.vip/api/v3/contents/generations/tasks/{id}Headers
Authorization: Bearer $API_KEY
Path Parameters
| Field | Type | Description |
|---|---|---|
id | string | Video generation task ID |
cURL Example
curl https://tp-api.topenrouter.vip/v1/video/tasks/task_xxxxxx \ -H "Authorization: Bearer sk-xxxxxx"
Status Reference
queued: Queuedrunning: Runningcancelled: Cancelledsucceeded: Succeededfailed: Failedexpired: Timed out
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Task ID |
model | string | Model name and version used by the task |
status | string | Task Status |
error | object | Error details, returned on failure |
created_at | int64 | Creation time |
updated_at | int64 | Status update time |
content | object | Output content, usually containing video_url |
seed | int | Seed |
resolution | string | Resolution |
ratio | string | Aspect Ratio |
duration | string/int | Duration |
framespersecond | int | Frame Rate |
generate_audio | bool | Whether audio is generated alongside the video |
tools | object | Tools actually used |
safety_identifier | string | Safety identifier |
draft | bool | Whether this is a draft video |
draft_task_id | string | Draft task ID |
execution_expires_after | int | Task timeout |
usage | object | Token usage |
Success Response Example
{
"id": "cgt-2026xxxxxx",
"model": "doubao-seedance-2.0",
"status": "succeeded",
"error": null,
"created_at": 1718049470,
"updated_at": 1718049870,
"content": {
"video_url": "https://example.com/video.mp4"
},
"seed": 12345,
"resolution": "720p",
"ratio": "16:9",
"duration": 4,
"framespersecond": 24,
"generate_audio": false,
"tools": {},
"safety_identifier": "",
"draft": false,
"draft_task_id": "",
"execution_expires_after": 3600,
"usage": {
"completion_tokens": 35800,
"total_tokens": 35800
}
}Failure Response Example
{
"id": "cgt-2026xxxxxx",
"model": "doubao-seedance-2.0",
"status": "failed",
"error": {
"code": "OutputVideoSensitiveContentDetected",
"message": "The request failed because the output video may contain sensitive information. Request ID: {id}"
},
"created_at": 1718049470,
"updated_at": 1718049870
}3 List Tasks
Purpose: list video generation tasks
https://tp-api.topenrouter.vip/v1/video/taskshttps://tp-api.topenrouter.vip/api/v3/contents/generations/taskscURL Example
curl https://tp-api.topenrouter.vip/v1/video/tasks \ -H "Authorization: Bearer sk-xxxxxx"
4 Real-person Asset Guide
base_url
https://tp-api.topenrouter.vip/seedance-gatewayThe private real-person asset library stores authorized likenesses for use in Seedance 2.0. Pass asset://asset_id as a trusted asset when generating video. Complete H5 identity verification first. Each Asset Group is uniquely bound to one real person.
Authentication: Volcengine Ark identity verification, Asset Group and Asset management APIs use Access Key / Secret Key request signing. TopenRouter video task creation continues to use Authorization: Bearer YOUR_API_KEY。
Integration Workflow
Create Verification Link
CreateVisualValidateSessionCreates an H5 identity verification page. After the end user completes liveness verification, the page redirects to CallbackURL.
Retrieve GroupId
GetVisualValidateResultAfter verification succeeds, use BytedToken to retrieve the ID of the newly created asset group.
Upload Real-person Assets
CreateAssetUpload image, video or audio assets to the specified GroupId; returns asset_id.
Wait Until the Asset Is Ready
GetAssetPoll asset status. Status=Active means it is ready for video generation; Failed means ingestion failed.
Create Video Task
POST /v1/video/tasksPass asset://asset_id in content[].image_url.url to create a video.
Key Rules
- Each
Asset Groupis bound to one person. Additional looks can be uploaded to the same group. - Uploaded assets are checked for facial consistency against the verification reference image. Assets showing a different person or multiple faces may be rejected.
- Asset libraries are isolated by
ProjectName. Assets and inference endpoints must be in the same project. The default project isdefault。 BytedTokenis used to query verification results and expires after 30 minutes.GetAsset/ListAssetsThe temporaryURLreturned typically expires after 12 hours. For video generation, useasset://asset_id。
CallbackURL Redirect Parameters
| Field | Description |
|---|---|
bytedToken | Verification credential for calling GetVisualValidateResult Query GroupId。 |
resultCode | 10000 means verification passed. After failure, the H5 link is invalid; create a new verification session. |
algorithmBaseRespCode | Server sub-error code, useful for diagnosing verification failures. |
reqMeasureInfoValue | Whether this operation is billed: 0 means no charge; 1 means billable. |
verify_type | Verification type; currently fixed to real_time。 |
Volcengine Ark Action
ServiceName: ark
Version: 2024-01-01
Region: cn-beijing
CreateVisualValidateSession {
"CallbackURL": "https://example.com/callback",
"ProjectName": "default"
}
GetVisualValidateResult {
"BytedToken": "20260331145619...",
"ProjectName": "default"
}
CreateAssetGroup {
"Name": "figure-group",
"Description": "figure group",
"GroupType": "AIGC",
"ProjectName": "default"
}
CreateAsset {
"GroupId": "group-20260318070359-xxxxx",
"URL": "https://example.com/person-front.jpg",
"AssetType": "Image",
"Name": "person-front",
"ProjectName": "default"
}
GetAsset {
"Id": "asset-20260318071009-xxxxx",
"ProjectName": "default"
}
ListAssets {
"Filter": {
"GroupIds": ["group-20260318070359-xxxxx"],
"GroupType": "AIGC",
"Statuses": ["Active"]
},
"PageNumber": 1,
"PageSize": 10,
"ProjectName": "default"
}
ListAssetGroups {
"Filter": {
"Name": "figure",
"GroupType": "AIGC"
},
"PageNumber": 1,
"PageSize": 10,
"ProjectName": "default"
}
GetAssetGroup {
"Id": "group-20260318070359-xxxxx",
"ProjectName": "default"
}
UpdateAsset {
"Id": "asset-20260318071009-xxxxx",
"Name": "new-asset-name",
"ProjectName": "default"
}
UpdateAssetGroup {
"Id": "group-20260318070359-xxxxx",
"Name": "new-group-name",
"Description": "new-description",
"ProjectName": "default"
}
DeleteAsset {
"Id": "asset-20260318071009-xxxxx",
"ProjectName": "default"
}
DeleteAssetGroup {
"Id": "group-20260318070359-xxxxx",
"ProjectName": "default"
}Go Example Code
The examples call https://tp-api.topenrouter.vip/seedance-gateway through the Volcengine Go SDK. Set the following environment variables first: VOLC_ACCESS_KEY and VOLC_SECRET_KEY。
CreateVisualValidateSession - Create H5 identity verification link
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("CreateVisualValidateSession", map[string]any{
"CallbackURL": "https://example.com/callback",
"ProjectName": "default",
})
}GetVisualValidateResult - Retrieve identity verification results and GroupId
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("GetVisualValidateResult", map[string]any{
"BytedToken": "20260331145619xxxxxxxx",
"ProjectName": "default",
})
}CreateAssetGroup - Create asset group
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("CreateAssetGroup", map[string]any{
"Name": "figure-group",
"Description": "figure group",
"GroupType": "AIGC",
"ProjectName": "default",
})
}CreateAsset - Upload asset
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("CreateAsset", map[string]any{
"GroupId": "group-20260622183525-xxxxx",
"URL": "https://example.com/person-front.jpg",
"AssetType": "Image",
"Name": "person-front",
"ProjectName": "default",
})
}GetAsset - Query a single asset
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("GetAsset", map[string]any{
"Id": "asset-20260622185318-xxxxx",
"ProjectName": "default",
})
}ListAssets - List assets
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("ListAssets", map[string]any{
"Filter": map[string]any{
"GroupIds": []string{"group-20260622183525-xxxxx"},
"GroupType": "AIGC",
"Statuses": []string{"Active", "Processing"},
"Name": "person",
},
"PageNumber": 1,
"PageSize": 10,
"SortBy": "CreateTime",
"SortOrder": "Desc",
"ProjectName": "default",
})
}ListAssetGroups - List asset groups
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("ListAssetGroups", map[string]any{
"Filter": map[string]any{
"Name": "figure",
"GroupType": "AIGC",
},
"PageNumber": 1,
"PageSize": 10,
"SortBy": "CreateTime",
"SortOrder": "Desc",
"ProjectName": "default",
})
}GetAssetGroup - Query a single asset group
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("GetAssetGroup", map[string]any{
"Id": "group-20260622183525-xxxxx",
"ProjectName": "default",
})
}UpdateAsset - Update asset
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("UpdateAsset", map[string]any{
"Id": "asset-20260622185318-xxxxx",
"Name": "new-asset-name",
"ProjectName": "default",
})
}UpdateAssetGroup - Update asset group
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("UpdateAssetGroup", map[string]any{
"Id": "group-20260622183525-xxxxx",
"Name": "new-group-name",
"Description": "new-description",
"ProjectName": "default",
})
}DeleteAsset - Delete asset
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("DeleteAsset", map[string]any{
"Id": "asset-20260622185318-xxxxx",
"ProjectName": "default",
})
}DeleteAssetGroup - Delete an asset group
package main
import (
"fmt"
"os"
"github.com/bytedance/sonic"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
"github.com/volcengine/volcengine-go-sdk/volcengine/universal"
)
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}
func callArk(action string, body map[string]any) {
ak := os.Getenv("VOLC_ACCESS_KEY")
sk := os.Getenv("VOLC_SECRET_KEY")
if ak == "" || sk == "" {
fmt.Println("Set VOLC_ACCESS_KEY and VOLC_SECRET_KEY")
return
}
endpoint := getEnv("SEEDANCE_GATEWAY_BASE_URL", "https://tp-api.topenrouter.vip/seedance-gateway")
config := volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion("cn-beijing")
config.Endpoint = volcengine.String(endpoint)
config.DisableRestProtocolURICleaning = volcengine.Bool(true)
sess, err := session.NewSession(config)
if err != nil {
fmt.Printf("create session failed: %v\n", err)
return
}
resp, err := universal.New(sess).DoCall(
universal.RequestUniversal{
ServiceName: "ark",
Action: action,
Version: "2024-01-01",
HttpMethod: universal.POST,
ContentType: universal.ApplicationJSON,
},
&body,
)
if err != nil {
fmt.Printf("sdk call failed: %+v\n", err)
return
}
data, _ := sonic.Marshal(resp)
fmt.Println(string(data))
}
func main() {
callArk("DeleteAssetGroup", map[string]any{
"Id": "group-20260622183525-xxxxx",
"ProjectName": "default",
})
}Create Video Using Real-person Assets
curl https://tp-api.topenrouter.vip/v1/video/tasks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxx" \
-d '{
"model": "doubao-seedance-2.0",
"content": [
{
"type": "text",
"text": "Image1 features the presenter introducing the facial cream in image2 in a close-up shot with spoken Mandarin。"
},
{
"type": "image_url",
"image_url": { "url": "asset://asset-20260318071009-xxxxx" },
"role": "reference_image"
},
{
"type": "image_url",
"image_url": { "url": "https://example.com/product.jpg" },
"role": "reference_image"
}
],
"ratio": "16:9",
"duration": 8,
"resolution": "720p",
"generate_audio": true
}'In prompts, refer to assets in order, e.g. "image 1" or "video 1". Do not expect the model to interpret asset_id。
Management APIs and Rate Limits
| API | Purpose | Account-level Rate Limit |
|---|---|---|
CreateVisualValidateSession | Create H5 identity verification session | 3 QPS |
GetVisualValidateResult | Retrieve verification results and GroupId | 3 QPS |
CreateAsset | Upload media assets | Configured by the advanced creation entitlement package |
ListAssetGroups / GetAssetGroup | Query asset groups | 10 QPS |
ListAssets | Filter assets by group, status or name | 10 QPS |
GetAsset | Query a single asset's status | 100 QPS |
UpdateAsset / UpdateAssetGroup | Update asset or asset group information | 10 QPS |
DeleteAsset | Delete a single asset | 10 QPS |
DeleteAssetGroup | Delete an asset group | 5 QPS |
Asset / Asset Group management APIs can query, update or delete only the current account's asset groups and assets.
5 Upload Asset API (Supports AIGC Real-person Assets) Legacy
https://tp-api.topenrouter.vip/v1/api/assets/uploadPurpose: upload an image, video or audio asset from an external URL to the upstream library. After ingestion, the stable asset_id can be referenced in video creation fields such as content[].image_url.url.
Request Headers
Authorization: Bearer $ARK_API_KEY
Required Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Seedance model name, e.g. doubao-seedance-2.0 |
Request Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | External asset HTTP(S) URL (must be publicly reachable when SSRF protection is enabled) |
asset_type | string | Yes | Image / Video / Audio |
name | string | No | Custom name, usable for name filtering in list queries |
Request Examples
curl -X POST 'https://tp-api.topenrouter.vip/v1/api/assets/upload?model=doubao-seedance-2.0' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ARK_API_KEY" \
-d '{
"url": "https://example.com/lion.jpg",
"asset_type": "Image",
"name": "lion01"
}'Response Fields
| Field | Type | Description |
|---|---|---|
code | int/string | 0 or "success" means success; non-zero values mean failure |
message | string | Error description |
data.Id | string | Upstream asset_id, e.g. asset-20260507175358-hmw2h |
Response Example
{
"code": 0,
"message": "ok",
"data": {
"Id": "asset-20260507175358-hmw2h"
}
}Error Reference
- missing
?model:HTTP 400 - missing
url/asset_type:HTTP 400 - The upstream URL matches the SSRF blocklist (when protection is enabled): HTTP 400
- Upstream API failure: its HTTP status and error body are passed through unchanged
6 Query Single Asset API (Supports AIGC Real-person Assets) Legacy
https://tp-api.topenrouter.vip/v1/api/assets/{asset_id}Purpose: query an asset's current status, signed URL and other metadata
Request Headers
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
asset_id | string | Yes | data.Id returned at upload; only [a-zA-Z0-9_\-]+ is allowed |
Required Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Seedance model name for channel routing; use the same value as at upload |
Ownership
The caller must be the asset_id uploader, i.e. the user associated with the token used to upload it.
- Found: returns the result
- Not found: returns HTTP 404
Request Examples
curl 'https://tp-api.topenrouter.vip/v1/api/assets/asset-20260507175358-hmw2h?model=doubao-seedance-2.0' \ -H "Authorization: Bearer $ARK_API_KEY"
Response Fields
| Field | Type | Description |
|---|---|---|
code | int/string | 0 or "success" means success |
message | string | Error description |
data.Id | string | Asset ID |
data.Name | string | Custom name |
data.AssetType | string | Image / Video / Audio |
data.Status | string | Upstream status: Active / Processing / Failed, etc. |
data.URL | string | Temporary signed URL (usually expires after 12 hours; query again as needed) |
data.CreateTime | string | Creation time |
Response Example
{
"code": 0,
"message": "ok",
"data": {
"Id": "asset-20260507175358-hmw2h",
"Name": "lion01",
"AssetType": "Image",
"Status": "Active",
"URL": "https://cdn.example.com/asset-...?Signature=...",
"CreateTime": "2026-05-07T17:53:58Z"
}
}Error Reference
asset_iddoes not match[a-zA-Z0-9_\-]+:HTTP 400- The current token is not the uploader of
asset_id: HTTP 404 - missing
?model:HTTP 400
7 Create Video Using Assets
After an asset is successfully uploaded to the library, use asset_id to create a video task.
⚠️ Note:image_url in url can be constructed using asset:// + asset_id (preferred for real-person reference images to avoid sensitive-content risk controls), or set to a regular HTTPS URL.
Request Examples
{
"model": "doubao-seedance-2.0",
"content": [
{
"type": "text",
"text": "A cat runs along the beach at sunset, cinematic style,4k"
},
{
"type": "image_url",
"image_url": {
"url": "asset://asset-20260507175358-hmw2h"
},
"role": "reference_image"
}
],
"ratio": "16:9",
"duration": 4,
"resolution": "720p",
"execution_expires_after": 3600,
"watermark": false
}8 Billing Rules
| Resolution | With Video Input | Without Video Input |
|---|---|---|
| 480P | CNY 28 / 1M tokens | CNY 46 / 1M tokens |
| 720P | CNY 28 / 1M tokens | CNY 46 / 1M tokens |
| 1080P | CNY 31 / 1M tokens | CNY 51 / 1M tokens |
For current prices, see the Model Catalog

