model_urlstring必填
URL of the input 3D model (GLB, GLTF, FBX, OBJ or STL, up to 150 MB).
tripo3d/tripo/segmentTripo Segment splits an existing 3D model into named parts. Accepts GLB, OBJ, FBX or STL input.
试用该模型
PNG、JPEG、WebP 或 GIF · 最大 20 MiB
选择一个示例,将其输入和结果加载到 playground 中。
{
"model_url": "https://static.sandbase.ai/examples/5d486446-c09b-4862-9387-00f6850d4373/input/992f8521-7777-4c3c-8d73-e11004b95d99.glb"
}Tripo Segment splits an existing 3D model into named parts. Accepts GLB, OBJ, FBX or STL input.
| Field | Type | Default | Notes |
|---|---|---|---|
model_url | string, required | — | URL of the input 3D model (GLB, GLTF, FBX, OBJ or STL, up to 150 MB). |
model_version | v1.0-20250506 / v2.0-20260430 | v1.0-20250506 | v1.0-20250506 splits by geometry; v2.0-20260430 (beta) splits by meaning. |
segmentation_granularity | simple / balanced / detailed | balanced | v2.0 only. |
split_by_connectivity | boolean | true | v2.0 only. Also split disconnected pieces. |
ref_image | string | — | v2.0 only. Reference image guiding the parts; granularity and split_by_connectivity are then ignored. |
url: Segmented GLB; parts are nodes named tripo_part_0, tripo_part_1, ...thumbnail: Preview render.$0.40 per model. Failed runs are not charged.
开始构建
选择任一受支持的 API,使用统一身份验证和使用情况跟踪。
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "tripo3d/tripo/segment",
"model_url": "https://static.sandbase.ai/examples/tripo3d/tripo/shared/object.glb",
"ref_image": "https://static.sandbase.ai/examples/tripo3d/tripo-h3.1/image-to-3d/input_image_0.png",
"model_version": "v1.0-20250506",
"split_by_connectivity": true,
"segmentation_granularity": "balanced"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"创建一个 SandBase API 密钥,并将其设置到服务器环境中。所有请求都使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它,也不要提交到仓库。
使用此模型 ID 及其输入向 /v1/run 发送 POST 请求。上方的请求示例包含提交和轮询。
使用返回的运行 ID 轮询,直到状态为 completed、failed 或 timeout。仅在 completed 后读取输出。
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"在模型的 image、video 或 audio 字段中传入一个可公开访问的文件 URL。支持的格式和限制显示在每个 Playground 输入项旁边。
在 Playground 中支持的图片字段上使用上传或替换控件。视频 URL 字段接受托管的 driving video;这并不表示支持视频上传。
model_urlstring必填URL of the input 3D model (GLB, GLTF, FBX, OBJ or STL, up to 150 MB).
ref_imagestringv2.0 only. Reference image guiding the parts; granularity and split_by_connectivity are then ignored.
model_versionstringv1.0-20250506 splits by geometry; v2.0-20260430 (beta) splits by meaning.
默认值:"v1.0-20250506"
可选值:"v1.0-20250506", "v2.0-20260430"
split_by_connectivitybooleanv2.0 only. Also split disconnected pieces.
默认值:true
segmentation_granularitystringv2.0 only.
默认值:"balanced"
可选值:"simple", "balanced", "detailed"
{
"model": "tripo3d/tripo/segment",
"model_url": "https://static.sandbase.ai/examples/tripo3d/tripo/shared/object.glb",
"ref_image": "https://static.sandbase.ai/examples/tripo3d/tripo-h3.1/image-to-3d/input_image_0.png",
"model_version": "v1.0-20250506",
"split_by_connectivity": true,
"segmentation_granularity": "balanced"
}已完成的运行会在输出中展示结果。以下内容是该模型保存的示例,而不是新的生成结果。
[
{
"poster": "https://static.sandbase.ai/examples/5d486446-c09b-4862-9387-00f6850d4373/output/4a02b9d4-3a65-4894-b75f-c762157f660d.png",
"thumbnail": "https://static.sandbase.ai/examples/5d486446-c09b-4862-9387-00f6850d4373/output/4a02b9d4-3a65-4894-b75f-c762157f660d.png",
"url": "https://static.sandbase.ai/examples/5d486446-c09b-4862-9387-00f6850d4373/output/28c71329-b3b3-44d0-adcd-b5e6851a8186.glb"
}
]此模型也通过 Tripo 的 v3 API 提供。请求体、任务对象和错误码都遵循 Tripo,因此只要将 base URL 改为 https://api.sandbase.ai/tripo/v3 并以 Authorization: Bearer 发送 SandBase API key,现有 Tripo 代码即可继续工作。请求会通过 Tripo 官方通道运行,价格与 /v1/run 相同。
POST https://api.sandbase.ai/tripo/v3/mesh/segment。model 是可选项,用于选择 Tripo 算法版本;省略时会使用 Tripo 的默认版本。上方 Tripo v3 API 下的请求示例展示了完整调用。
Tripo 对这些输入的命名与下面的 Schema 不同。其他所有字段都保持原名。
| Schema 字段 | Tripo 字段 |
|---|---|
model_url | input |
model_version | model |
输入为公开 URL,可以是字符串,也可以是带有 url 字段的对象。目前不接受 Tripo 任务 id 和 file_token 值,不支持文件上传,webhook_url 会被忽略。
提交后返回 data.task_id。持续轮询,直到 data.status 为 success、failed 或 cancelled。成功时,data.output 使用 Tripo 字段名,例如 model_url,credits_consumed 是 SandBase 的扣费,1 credit = $0.01。
curl "https://api.sandbase.ai/tripo/v3/tasks/$TASK_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"带有 {"task_ids": [...]} 的 POST /tripo/v3/tasks/list 最多返回 100 个任务。GET /tripo/v3/account/balance 返回你在 SandBase 的 credits 余额。
错误使用 Tripo 的响应封装:{"code": 1004, "status": "error", "message": "..."}。
| code | 含义 |
|---|---|
2 / 1002 | 缺少、无效或未授权的 SandBase API key |
1003 | 请求体不是 JSON 对象 |
1004 | 缺少或无效的参数。消息会注明 Tripo 字段名 |
1007 / 2000 | 达到速率限制或并发限制 |
2001 | 未找到任务,或该任务是用另一个 API key 创建的 |
2002 | SandBase 不支持该端点或功能 |
2010 | SandBase 余额不足或已达到 API key 消费限额 |
4001 | 未知端点 |
当 Tripo 拒绝或失败一个任务时,它会以 failed 结束,并带有 Tripo 的 error_code 和 error_message。与你的请求或内容相关的代码会原样透传;与上游 Tripo 账户相关的代码会报告为 1000。