TopenRouter
On this page
Download Markdown

1 Create Video Task

Seedance 2.0 video generation API, supporting text, images and other inputs.

Purpose: create a Seedance video generation task

Gateway EndpointPOSThttps://tp-api.topenrouter.vip/v1/video/tasks
Official EndpointRecommendedPOSThttps://tp-api.topenrouter.vip/api/v3/contents/generations/tasks

Request 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

FieldTypeRequiredDescription
modelstringYesVideo generation model ID, e.g. doubao-seedance-2.0
contentarrayYesInput content array; supports text, images, video, audio and draft task IDs
callback_urlstringNoTask callback URL
return_last_frameboolNoWhether to return the last frame
generate_audioboolNoWhether to generate synchronized audio
draftboolNoWhether to enable draft mode
toolsarray/objectNoTool configuration
safety_identifierstringNoUnique end-user identifier
execution_expires_afterintNoTask expiry time in seconds
resolutionstringNoVideo resolution, e.g. 720p or 1080p
ratiostringNoAspect ratio, e.g. 16:9 or 9:16
durationintNoVideo duration in seconds
seedintNoRandom seed
watermarkboolNoWhether to include a watermark

content Structure

content supports the following item types:

  • text – Text
  • image_url – Image
  • video_url – Video
  • audio_url – Audio

Supported role values include:

  • reference_image – Reference image
  • reference_video – Reference video
  • reference_audio – Reference audio

Response Example

{ "id": "task_xxxxxx" }

2 Query a Single Task

Purpose: query details of a video generation task

Gateway EndpointGEThttps://tp-api.topenrouter.vip/v1/video/tasks/{id}
Official EndpointRecommendedGEThttps://tp-api.topenrouter.vip/api/v3/contents/generations/tasks/{id}

Headers

Content-Type: application/json
Authorization: Bearer $API_KEY

Path Parameters

FieldTypeDescription
idstringVideo generation task ID

cURL Example

curl https://tp-api.topenrouter.vip/v1/video/tasks/task_xxxxxx \
  -H "Authorization: Bearer sk-xxxxxx"

Status Reference

  • queued: Queued
  • running: Running
  • cancelled: Cancelled
  • succeeded: Succeeded
  • failed: Failed
  • expired: Timed out

Response Fields

FieldTypeDescription
idstringTask ID
modelstringModel name and version used by the task
statusstringTask Status
errorobjectError details, returned on failure
created_atint64Creation time
updated_atint64Status update time
contentobjectOutput content, usually containing video_url
seedintSeed
resolutionstringResolution
ratiostringAspect Ratio
durationstring/intDuration
framespersecondintFrame Rate
generate_audioboolWhether audio is generated alongside the video
toolsobjectTools actually used
safety_identifierstringSafety identifier
draftboolWhether this is a draft video
draft_task_idstringDraft task ID
execution_expires_afterintTask timeout
usageobjectToken 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

Gateway EndpointGEThttps://tp-api.topenrouter.vip/v1/video/tasks
Official EndpointRecommendedGEThttps://tp-api.topenrouter.vip/api/v3/contents/generations/tasks

cURL 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-gateway

The 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

1

Create Verification Link

CreateVisualValidateSession

Creates an H5 identity verification page. After the end user completes liveness verification, the page redirects to CallbackURL.

2

Retrieve GroupId

GetVisualValidateResult

After verification succeeds, use BytedToken to retrieve the ID of the newly created asset group.

3

Upload Real-person Assets

CreateAsset

Upload image, video or audio assets to the specified GroupId; returns asset_id.

4

Wait Until the Asset Is Ready

GetAsset

Poll asset status. Status=Active means it is ready for video generation; Failed means ingestion failed.

5

Create Video Task

POST /v1/video/tasks

Pass asset://asset_id in content[].image_url.url to create a video.

Key Rules

  • Each Asset Group is 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 is default。
  • BytedToken is used to query verification results and expires after 30 minutes.
  • GetAsset / ListAssets The temporary URL returned typically expires after 12 hours. For video generation, use asset://asset_id。

CallbackURL Redirect Parameters

FieldDescription
bytedTokenVerification credential for calling GetVisualValidateResult Query GroupId。
resultCode10000 means verification passed. After failure, the H5 link is invalid; create a new verification session.
algorithmBaseRespCodeServer sub-error code, useful for diagnosing verification failures.
reqMeasureInfoValueWhether this operation is billed: 0 means no charge; 1 means billable.
verify_typeVerification 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

APIPurposeAccount-level Rate Limit
CreateVisualValidateSessionCreate H5 identity verification session3 QPS
GetVisualValidateResultRetrieve verification results and GroupId3 QPS
CreateAssetUpload media assetsConfigured by the advanced creation entitlement package
ListAssetGroups / GetAssetGroupQuery asset groups10 QPS
ListAssetsFilter assets by group, status or name10 QPS
GetAssetQuery a single asset's status100 QPS
UpdateAsset / UpdateAssetGroupUpdate asset or asset group information10 QPS
DeleteAssetDelete a single asset10 QPS
DeleteAssetGroupDelete an asset group5 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

POSThttps://tp-api.topenrouter.vip/v1/api/assets/upload

Purpose: 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

Content-Type: application/json
Authorization: Bearer $ARK_API_KEY

Required Query Parameters

FieldTypeRequiredDescription
modelstringYesSeedance model name, e.g. doubao-seedance-2.0

Request Body Fields

FieldTypeRequiredDescription
urlstringYesExternal asset HTTP(S) URL (must be publicly reachable when SSRF protection is enabled)
asset_typestringYesImage / Video / Audio
namestringNoCustom 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

FieldTypeDescription
codeint/string0 or "success" means success; non-zero values mean failure
messagestringError description
data.IdstringUpstream 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

GEThttps://tp-api.topenrouter.vip/v1/api/assets/{asset_id}

Purpose: query an asset's current status, signed URL and other metadata

Request Headers

Authorization: Bearer $ARK_API_KEY

Path Parameters

FieldTypeRequiredDescription
asset_idstringYesdata.Id returned at upload; only [a-zA-Z0-9_\-]+ is allowed

Required Query Parameters

FieldTypeRequiredDescription
modelstringYesSeedance 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

FieldTypeDescription
codeint/string0 or "success" means success
messagestringError description
data.IdstringAsset ID
data.NamestringCustom name
data.AssetTypestringImage / Video / Audio
data.StatusstringUpstream status: Active / Processing / Failed, etc.
data.URLstringTemporary signed URL (usually expires after 12 hours; query again as needed)
data.CreateTimestringCreation 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_id does 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

ResolutionWith Video InputWithout Video Input
480PCNY 28 / 1M tokensCNY 46 / 1M tokens
720PCNY 28 / 1M tokensCNY 46 / 1M tokens
1080PCNY 31 / 1M tokensCNY 51 / 1M tokens

For current prices, see the Model Catalog

Logo
TopenRouter

Next-generation AI semantic routing primitives platform. Built on the 2026 global intelligent network.

© 2026 TopenRouter