跳转到主要内容
POST
/
v1
/
seedance2
/
real-avatar
curl --request POST \
  --url https://api.apimart.ai/v1/seedance2/real-avatar \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "callback_url": "https://example.com/callback",
    "project_name": "default"
  }'
{
  "code": 200,
  "data": {
    "id": "task_01K...",
    "status": "completed"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt

Use this file to discover all available pages before exploring further.

curl --request POST \
  --url https://api.apimart.ai/v1/seedance2/real-avatar \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "callback_url": "https://example.com/callback",
    "project_name": "default"
  }'
{
  "code": 200,
  "data": {
    "id": "task_01K...",
    "status": "completed"
  }
}

认证

Authorization
string
必填
所有接口均需要使用 Bearer Token 进行认证获取 API Key:访问 API Key 管理页面 获取您的 API Key使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY

请求参数

步骤一:创建真人认证会话

callback_url
string
必填
认证完成后的回调 URL用户完成 H5 认证后,系统会向该地址发送回调通知
project_name
string
默认值:"default"
项目名称默认值:default

响应

code
integer
响应状态码,成功时为 200
data
object
任务信息
查询该任务可获得 H5 认证链接:
GET /v1/tasks/task_01K...
{
  "code": 200,
  "data": {
    "id": "task_01K...",
    "status": "completed",
    "result": {
      "byted_token": "token_xxx",
      "h5_link": "https://...",
      "raw_response": {}
    }
  }
}

步骤二:查询真人认证结果

byted_token
string
必填
从步骤一任务结果中获取的认证令牌用户完成 H5 认证后,通过 GET /v1/tasks/{id} 查询任务获取 byted_token,再用此字段查询认证结果,拿到真人素材组 GroupId
project_name
string
默认值:"default"
项目名称默认值:default

步骤三:批量提交真人素材

group_id
string
必填
真人素材组 ID从步骤二认证结果中获取的 GroupId
project_name
string
默认值:"default"
项目名称默认值:default
asset_type
string
默认值:"Video"
素材类型可选值:
  • Video - 视频素材(默认,推荐用于真人人像)
  • Image - 图片素材
默认值:Video
assets
array
必填
素材列表,支持一次提交多个素材示例:
{
  "assets": [
    {
      "url": "https://example.com/avatar-a.png",
      "name": "avatar-a"
    },
    {
      "url": "https://example.com/avatar-b.png",
      "name": "avatar-b"
    }
  ]
}

响应

code
integer
响应状态码,成功时为 200
data
object
素材审核任务信息

查询审核结果

素材提交后为异步审核任务,使用 获取任务状态 接口查询:

全部通过

{
  "code": 200,
  "data": {
    "id": "task_01K...",
    "status": "completed",
    "progress": 100,
    "result": {
      "assets": [
        {
          "asset_id": "asset_a",
          "asset_url": "asset://asset_a",
          "status": "Active"
        },
        {
          "asset_id": "asset_b",
          "asset_url": "asset://asset_b",
          "status": "Active"
        }
      ],
      "usable_assets": [
        {
          "asset_id": "asset_a",
          "asset_url": "asset://asset_a",
          "status": "Active"
        },
        {
          "asset_id": "asset_b",
          "asset_url": "asset://asset_b",
          "status": "Active"
        }
      ],
      "failed_assets": []
    }
  }
}

部分失败

{
  "code": 200,
  "data": {
    "id": "task_01K...",
    "status": "failed",
    "progress": 100,
    "result": {
      "assets": [
        {
          "asset_id": "asset_a",
          "asset_url": "asset://asset_a",
          "status": "Active"
        },
        {
          "asset_id": "asset_b",
          "asset_url": "asset://asset_b",
          "status": "Failed"
        }
      ],
      "usable_assets": [
        {
          "asset_id": "asset_a",
          "asset_url": "asset://asset_a",
          "status": "Active"
        }
      ],
      "failed_assets": [
        {
          "asset_id": "asset_b",
          "asset_url": "asset://asset_b",
          "status": "Failed"
        }
      ]
    },
    "error": {
      "code": "task_failed",
      "message": "部分素材审核失败"
    }
  }
}
  • result.usable_assets[].asset_url 可直接用于 Seedance 2.0 视频生成
  • result.failed_assets 中的素材需更换源文件或重新提交

审核后使用素材

审核通过后,将 asset://... URL 直接传入 Seedance 2.0 视频生成 接口:
{
  "model": "doubao-seedance-2.0-face",
  "prompt": "使用参考人像生成视频",
  "image_with_roles": [
    {
      "url": "asset://asset_a",
      "role": "reference_image"
    }
  ]
}
  • 真人人像素材建议配合 doubao-seedance-2.0-facedoubao-seedance-2.0-fast-face 模型使用
  • 服务端识别到 asset:// 前缀后,会直接提交官方生成任务,不会再次触发素材审核