Tripo-3D-Animation 调用指南

0. 简介与支持的模型 ID

Tripo 动画重定向:把一套预设动画应用到已绑骨的 3D 模型上,输出带动画的模型文件 (GLB 或 FBX),可直接放进 Web 页面、游戏引擎或 DCC 工具里播放。

模型 ID说明状态
tripo-3d-animationTripo 动画重定向,输入已绑骨模型 + 预设动画,输出带动画的模型文件已支持(本文档的接口、参数、响应均以它为准)

[!IMPORTANT] 本接口与「Tripo-3D 模型生成」「Tripo-3D-Rigging-Check」「Tripo-3D-Rigging」共用同一对入口 (POST /v1/3d/generations 与 GET /v1/3d/generations/{task_id}),只靠 model 字段取值区分能力。 模型名大小写不敏感,网关会统一归一化为小写后转发上游。

[!WARNING] 本接口的输入必须是**已绑骨(rigged)**的模型。把未绑骨的裸模型直接送进来会失败—— 请先用 tripo-3d-rigging 完成绑骨(不确定能不能绑骨可先用 tripo-3d-rigging-check 探一下)。


1. 接口一览

能力路径请求方式说明
提交动画任务/v1/3d/generationsPOST提交已绑骨模型与预设动画,立即返回任务 ID
查询动画结果/v1/3d/generations/{task_id}GET轮询任务状态,完成后返回带动画的模型文件地址
取消任务/v1/3d/generations/{task_id}DELETE非终态任务可尝试取消

基础调用地址:

https://newapi.huizhitv.com

鉴权(三选一,与本站其它 OpenAI 兼容接口一致):

Authorization: Bearer sk-your_token_string_here
https://newapi.huizhitv.com/v1/3d/generations?key=sk-your_token_string_here

2. 提交动画任务

  • 路径: /v1/3d/generations
  • 请求方式: POST
  • Content-Type: application/json

2.1 请求参数

参数类型必填说明
modelstring是模型 ID,本文档固定为 tripo-3d-animation
inputstring是已绑骨模型标识,即上一步绑骨任务响应里的 output.task_id
animationstring条件必选单个预设动画标识符,如 preset:walk。与 animations 互斥,二选一
animationsstring[]条件必选多个预设动画标识符数组,如 ["preset:walk","preset:run"]。与 animation 互斥
out_formatstring否输出格式:glb(二进制 glTF,适用于 Web)/ fbx(适用于 DCC 工具与游戏引擎),默认 glb
bake_animationboolean否把动画烘焙进模型。仅对 glb 输出有效,默认 true
export_with_geometryboolean否导出时包含几何体,默认 true。传 false 只导出骨骼与动画数据
animate_in_placeboolean否原地播放动画、不产生位移,默认 false

[!IMPORTANT] animation 与 animations 必须且只能填其中一个: 两个都不填或同时都填,上游会判定为参数错误。只要一个动画用 animation, 想把多套动作合进同一个文件(如走 + 跑)用 animations。

[!IMPORTANT] input 怎么拿:先完成绑骨(tripo-3d-rigging),在绑骨任务的轮询响应里取 output.task_id 这个值,原样填进本接口的 input。

// GET /v1/3d/generations/{绑骨任务ID} 的响应
{
  "status": "completed",
  "output": { "task_id": "e75f13f2-8681-4d93-8bb4-e19629cb304a", ... },
  "data": [{ "url": "https://.../rig/output/....glb?..." }]
}
//                    ↑ 这个 task_id 就是本接口要的 input

⚠️ 不要填别的,以下三种写法都会被上游拒绝:

错误写法上游报错
绑骨产物的文件 URL(https://.../rig/output/xxx.glb?...)FailedOperation.JobNotExist 任务不存在
产物文件名里的 UUID(5e13212b-18b5-...)The task is not found
绑骨任务的站点任务 ID(形如 1503... 的数字串)同上

[!NOTE] 本接口不接受 prompt:动作由预设动画标识符指定,传文字描述不会参与。

2.2 预设动画标识符

标识符统一以 preset: 开头。按骨骼类型分为三组,请与模型实际的骨骼类型匹配, 例如在四足模型上用双足动作会得到异常姿态。

通用简写(不分骨骼前缀)

分类标识符
双足preset:idle、preset:walk、preset:run、preset:dive、preset:climb、preset:jump、preset:slash、preset:shoot、preset:hurt、preset:fall、preset:turn
四足preset:quadruped:walk
六足 / 八足preset:hexapod:walk、preset:octopod:walk
蛇形 / 水生preset:serpentine:march、preset:aquatic:march

双足完整动作表(preset:biped:*)

preset:biped:afraidpreset:biped:agreepreset:biped:angry_01preset:biped:angry_02
preset:biped:angry_03preset:biped:basketball_shotpreset:biped:bowpreset:biped:box_01
preset:biped:box_02preset:biped:box_03preset:biped:cast_a_spellpreset:biped:cheer
preset:biped:choppreset:biped:clappreset:biped:climbpreset:biped:complain_01
preset:biped:complain_02preset:biped:cross_body_crunchpreset:biped:crossover_dribblepreset:biped:cry
preset:biped:dance_01preset:biped:dance_02preset:biped:dance_03preset:biped:dance_04
preset:biped:dance_05preset:biped:dance_06preset:biped:defeat_02preset:biped:defeat_03
preset:biped:depressedpreset:biped:digpreset:biped:divepreset:biped:dribble
preset:biped:fallpreset:biped:firepreset:biped:flee_01preset:biped:flee_02
preset:biped:flippreset:biped:fold_armspreset:biped:football_catchpreset:biped:football_save
preset:biped:football_passpreset:biped:freakypreset:biped:frightenedpreset:biped:front_kick_01
preset:biped:front_kick_02preset:biped:frustrated_01preset:biped:frustrated_02preset:biped:golf
preset:biped:greet_01preset:biped:greet_02preset:biped:greet_03preset:biped:greet_04
preset:biped:heart_posepreset:biped:hit_to_body_01preset:biped:hit_to_body_02preset:biped:hit_to_head
preset:biped:hit_to_sidepreset:biped:hit_to_stomachpreset:biped:hugpreset:biped:hurt
preset:biped:idlepreset:biped:jump_downpreset:biped:jumppreset:biped:jump_rope_01
preset:biped:jump_rope_02preset:biped:laugh_01preset:biped:laugh_02preset:biped:lift_heavy
preset:biped:look_aroundpreset:biped:make_a_call_01preset:biped:make_a_call_02preset:biped:pitch_baseball
preset:biped:play_mobile_gamepreset:biped:play_video_gamepreset:biped:press-uppreset:biped:run_upstairs
preset:biped:runpreset:biped:scared_01preset:biped:scared_02preset:biped:scratch
preset:biped:shootpreset:biped:shovelpreset:biped:sing_01preset:biped:sing_02
preset:biped:sing_03preset:biped:sing_04preset:biped:sitpreset:biped:slash
preset:biped:sobpreset:biped:standing_relaxpreset:biped:surfpreset:biped:swagger
preset:biped:swimpreset:biped:turnpreset:biped:victory_celebrationpreset:biped:volleyball
preset:biped:waitpreset:biped:walkpreset:biped:warm_uppreset:biped:wave_goodbye_01
preset:biped:wave_goodbye_02

2.3 调用示例:单个动画

curl -X POST https://newapi.huizhitv.com/v1/3d/generations \
  -H "Authorization: Bearer sk-your_token_string_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tripo-3d-animation",
    "input": "e75f13f2-8681-4d93-8bb4-e19629cb304a",
    "animation": "preset:walk"
  }'

2.4 调用示例:多个动画 + FBX 输出

curl -X POST https://newapi.huizhitv.com/v1/3d/generations \
  -H "Authorization: Bearer sk-your_token_string_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tripo-3d-animation",
    "input": "e75f13f2-8681-4d93-8bb4-e19629cb304a",
    "animations": ["preset:walk", "preset:run"],
    "out_format": "fbx",
    "animate_in_place": true
  }'

2.5 提交响应

任务是异步的,POST 立即返回,不会等待动画生成结束:

{
  "id": "1503685330012345678",
  "object": "3d.generation",
  "status": "pending",
  "created": 1791895818
}
字段说明
id任务 ID,轮询与取消时用这个值(有效期 24 小时)
object固定为 3d.generation
status提交成功固定为 pending
created任务创建时间戳(Unix 秒)

3. 查询动画结果

  • 路径: /v1/3d/generations/{task_id}
  • 请求方式: GET
  • {task_id} 为第 2 步响应里的 id
curl https://newapi.huizhitv.com/v1/3d/generations/1503685330012345678 \
  -H "Authorization: Bearer sk-your_token_string_here"

3.1 处理中

{
  "id": "1503685330012345678",
  "object": "3d.generation",
  "status": "in_progress",
  "created": 1791895818
}

3.2 完成

{
  "id": "1503685330012345678",
  "object": "3d.generation",
  "status": "completed",
  "created": 1791895818,
  "data": [
    {
      "url": "https://vcg-prod-1258344699.cos.ap-guangzhou.tencentcos.cn/3dtripo/anim/output/1501334065/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.glb?q-sign-algorithm=sha1&q-ak=...&q-sign-time=...&q-key-time=...&q-header-list=host&q-url-param-list=&q-signature=..."
    }
  ]
}
字段说明
statusqueued / in_progress / completed / failed
data[].url带动画的模型文件地址,格式由入参 out_format 决定(默认 GLB)

[!IMPORTANT] data[].url 是带临时签名(q-sign-time)的对象存储直链,有效期约 24 小时, 请在有效期内下载或转存到自己的存储空间。签名过期后再访问会返回 403。 若 out_format 传了 fbx,这里返回的就是 .fbx 文件链接。

3.3 失败

{
  "id": "1503685330012345678",
  "object": "3d.generation",
  "status": "failed",
  "created": 1791895818
}

4. 完整示例(curl)

下面是一段可直接运行的 Shell 脚本,串起完整四步:提交动画 → 轮询到终态 → 取回文件链接 → 下载保存。 依赖 curl 与 jq(用于解析 JSON,macOS 可 brew install jq,Debian/Ubuntu 可 apt install jq)。

#!/usr/bin/env bash
set -u

BASE="https://newapi.huizhitv.com"
KEY="sk-your_token_string_here"
RIGGED_MODEL="e75f13f2-8681-4d93-8bb4-e19629cb304a"   # 绑骨响应里的 output.task_id

# 1. 提交动画重定向(单动画用 animation,多动画改用 animations 数组)
SUBMIT=$(curl -s -X POST "$BASE/v1/3d/generations" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"model\": \"tripo-3d-animation\",
    \"input\": \"$RIGGED_MODEL\",
    \"animation\": \"preset:walk\",
    \"out_format\": \"glb\",
    \"bake_animation\": true,
    \"animate_in_place\": false
  }")

TASK_ID=$(echo "$SUBMIT" | jq -r '.id')
STATUS=$(echo "$SUBMIT" | jq -r '.status')
echo "已提交: task_id=$TASK_ID status=$STATUS"

# 2. 轮询直到终态(completed / failed)
RES=""
while true; do
  RES=$(curl -s "$BASE/v1/3d/generations/$TASK_ID" \
    -H "Authorization: Bearer $KEY")
  STATUS=$(echo "$RES" | jq -r '.status')
  [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ] && break
  echo "处理中: $STATUS"
  sleep 3
done

# 3. 取回带动画的模型并下载(链接有效期约 24 小时)
if [ "$STATUS" = "completed" ]; then
  URL=$(echo "$RES" | jq -r '.data[0].url')
  echo "动画生成完成: $URL"
  curl -sL "$URL" -o model_walk.glb
  ls -lh model_walk.glb
else
  echo "动画生成失败:"
  echo "$RES" | jq '.'
fi

[!NOTE]

  • 要一次合成多套动作,把第 1 步的 "animation" 换成 "animations": ["preset:walk","preset:run"](两者不能同时出现)。
  • out_format 传 fbx 时,第 3 步下载的文件后缀请相应改成 .fbx, 且 bake_animation 对 fbx 不生效。
  • 不想装 jq 也可以:把 echo "$RES" | jq -r '.status' 换成 grep -o '"status":"[^"]*"' 自行取字段,或直接肉眼看 curl -s ... | python -m json.tool 的输出。

5. 调用限制

  • 并发限制:默认提供 1 个并发,即同一时刻仅处理 1 个任务。上一个任务尚未完成时 提交下一个会被拒绝,请在前一个任务返回终态(completed / failed)后再提交。
  • 任务有效期:任务 ID 有效期 24 小时,过期后无法再查询,请在该窗口内取走结果。
  • 计费口径:仅在任务成功(返回 completed)时计费;处理中或失败不计费。 上游终态响应会回传本次消耗的积分 credits_consumed(实测一次动画重定向为 10 Credit), 站点按每 Credit 费率换算成金额扣费;实际数值以「任务日志」里该条记录为准。

6. 常见错误

现象原因处理
model does not exist / 找不到模型model 字段值不匹配确认填的是 tripo-3d-animation(大小写不敏感)
input 不能为空 / 参数缺失请求体里没带 input必填 input,值为绑骨响应里的 output.task_id
FailedOperation.JobNotExist 任务不存在把产物文件 URL 当成 input 传了改传 output.task_id,不要传 .glb 链接
The task is not foundinput 填了文件名 UUID 或站点任务 ID同上,只能填绑骨响应的 output.task_id
提示模型未绑骨 / 动画应用失败送进来的模型没有骨骼先用 tripo-3d-rigging 绑骨;不确定可先用 tripo-3d-rigging-check 检查
动画参数报错 / 互斥错误animation 与 animations 同时传了或都没传二选一:单个传 animation,多个传 animations 数组
动作标识符无效拼错或用了不在枚举内的值只能用本文档第 2.2 节列出的 preset: 标识符
姿态扭曲、动作对不上动画骨骼类型与模型骨骼类型不匹配四足模型用 preset:quadruped:*,别用 biped 动作
bake_animation 改了没效果输出格式是 fbx该参数仅对 glb 有效
提交返回并发受限上一个任务还没跑完轮询等待上一个任务到 completed / failed 后再提交
data[].url 下载 403临时签名过期(约 24 小时)及时转存;已过期需重新生成
查询一直 in_progress上游排队中继续轮询;若长时间不动可在「任务日志」里对该记录手动同步确认最终状态
401 / 403令牌无效或没有该模型权限检查 API 密钥与该令牌允许调用的模型列表

7. 与生成 / 绑骨的对照

项目模型生成绑骨前检查自动绑骨动画重定向(本文档)
模型 IDtripo-3d-3.1 / tripo-3d-p1tripo-3d-rigging-checktripo-3d-riggingtripo-3d-animation
作用文/图生 3D判断能否绑骨加骨骼绑定把预设动画套上去
主要入参prompt / imageinput(模型直链)input + rig_type 等input + animation / animations
输入形态文字或图片模型文件模型文件已绑骨模型标识(绑骨的 output.task_id)
是否有产物文件有无,只有 output 结论有有
结果字段data[].urloutput.riggable / output.rig_typedata[].url + output.task_iddata[].url

推荐的完整链路:生成模型(tripo-3d-3.1 / tripo-3d-p1)→ 检查(tripo-3d-rigging-check) → 绑骨(tripo-3d-rigging,把检查拿到的 rig_type 传进去)→ 加动画(tripo-3d-animation, input 填绑骨响应里的 output.task_id)。

Raw Markdown (.md) · llms.txt