bakeboolean
Bake advanced materials into the textures.
默认值:true
tripo3d/tripo/convertTripo Convert exports a 3D model to GLTF, FBX, USDZ, OBJ, STL or 3MF, with optional quad remesh, scaling and texture settings.
试用该模型
您的输出将显示在这里
完成输入,然后点击运行。
Tripo Convert exports a 3D model to GLTF, FBX, USDZ, OBJ, STL or 3MF, with optional quad remesh, scaling and texture settings.
| Field | Type | Default | Notes |
|---|---|---|---|
model_url | string, required | — | URL of the input 3D model (GLB, GLTF, FBX, OBJ or STL, up to 150 MB). |
format | GLTF / FBX / USDZ / OBJ / STL / 3MF, required | FBX | Output format. |
quad | boolean | false | Quad remesh (10,000 faces when face_limit is unset). Forces FBX. |
force_symmetry | boolean | false | Symmetric quad mesh. Only with quad. |
face_limit | integer | — | Target face count. Original when unset. |
texture_size | integer | 4096 | Texture size in pixels. |
texture_format | JPEG / PNG / WEBP / BMP / DPX / HDR / OPEN_EXR / TARGA / TIFF | JPEG | Texture image format. |
bake | boolean | true | Bake advanced materials into the textures. |
pack_uv | boolean | false | Pack all UV islands into one texture. |
export_vertex_colors | boolean | false | Vertex colors (OBJ and GLTF only). |
flatten_bottom | boolean | false | Flatten the bottom of the model. |
flatten_bottom_threshold | number | 0.01 | Depth flattened when flatten_bottom is on. |
pivot_to_center_bottom | boolean | false | Move the pivot to the bottom center. |
scale_factor | number | 1 | Uniform scale. |
with_animation | boolean | true | Keep animations. |
animate_in_place | boolean | false | Remove root motion from animations. |
part_names | array | — | Only process these parts (node names from a segmentation, e.g. tripo_part_0). All parts when unset. |
export_orientation | +x / -x / +y / -y | — | Forward axis of the exported model. |
fbx_preset | blender / 3dsmax / mixamo / bake_scale | blender | FBX target application. |
texture_packaging | embedded / zip | embedded | FBX only: embedded textures, or a zip with the FBX and a .fbm folder. |
url: Converted model file (a .zip when texture_packaging is zip).$0.05 per conversion; $0.10 when any of quad, face_limit, flatten_bottom, flatten_bottom_threshold, texture_size, texture_format, pivot_to_center_bottom or scale_factor is not the default. 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/convert",
"bake": true,
"quad": false,
"format": "FBX",
"pack_uv": false,
"model_url": "https://static.sandbase.ai/examples/tripo3d/tripo/shared/object.glb",
"fbx_preset": "blender",
"scale_factor": 1,
"texture_size": 4096,
"flatten_bottom": false,
"force_symmetry": false,
"texture_format": "JPEG",
"with_animation": true,
"animate_in_place": false,
"texture_packaging": "embedded",
"export_vertex_colors": false,
"pivot_to_center_bottom": false,
"flatten_bottom_threshold": 0.01
}
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;这并不表示支持视频上传。
bakebooleanBake advanced materials into the textures.
默认值:true
quadbooleanQuad remesh (10,000 faces when face_limit is unset). Forces FBX.
默认值:false
formatstring必填Output format.
默认值:"FBX"
可选值:"GLTF", "FBX", "USDZ", "OBJ", "STL", "3MF"
pack_uvbooleanPack all UV islands into one texture.
默认值:false
model_urlstring必填URL of the input 3D model (GLB, GLTF, FBX, OBJ or STL, up to 150 MB).
face_limitintegerTarget face count. Original when unset.
最小值:1
fbx_presetstringFBX target application.
默认值:"blender"
可选值:"blender", "3dsmax", "mixamo", "bake_scale"
part_namesarrayOnly process these parts (node names from a segmentation, e.g. tripo_part_0). All parts when unset.
scale_factornumberUniform scale.
默认值:1
texture_sizeintegerTexture size in pixels.
默认值:4096
flatten_bottombooleanFlatten the bottom of the model.
默认值:false
force_symmetrybooleanSymmetric quad mesh. Only with quad.
默认值:false
texture_formatstringTexture image format.
默认值:"JPEG"
可选值:"JPEG", "PNG", "WEBP", "BMP", "DPX", "HDR", "OPEN_EXR", "TARGA", "TIFF"
with_animationbooleanKeep animations.
默认值:true
animate_in_placebooleanRemove root motion from animations.
默认值:false
texture_packagingstringFBX only: embedded textures, or a zip with the FBX and a .fbm folder.
默认值:"embedded"
可选值:"embedded", "zip"
export_orientationstringForward axis of the exported model.
可选值:"+x", "-x", "+y", "-y"
export_vertex_colorsbooleanVertex colors (OBJ and GLTF only).
默认值:false
pivot_to_center_bottombooleanMove the pivot to the bottom center.
默认值:false
flatten_bottom_thresholdnumberDepth flattened when flatten_bottom is on.
默认值:0.01
{
"model": "tripo3d/tripo/convert",
"bake": true,
"quad": false,
"format": "FBX",
"pack_uv": false,
"model_url": "https://static.sandbase.ai/examples/tripo3d/tripo/shared/object.glb",
"fbx_preset": "blender",
"scale_factor": 1,
"texture_size": 4096,
"flatten_bottom": false,
"force_symmetry": false,
"texture_format": "JPEG",
"with_animation": true,
"animate_in_place": false,
"texture_packaging": "embedded",
"export_vertex_colors": false,
"pivot_to_center_bottom": false,
"flatten_bottom_threshold": 0.01
}已完成的运行会在输出中展示结果。以下内容是该模型保存的示例,而不是新的生成结果。
尚未发布示例输出。请在运行完成后使用 Playground → Result → JSON 查看响应。
此模型也通过 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/models/convert。model 是可选项,用于选择 Tripo 算法版本;省略时会使用 Tripo 的默认版本。上方 Tripo v3 API 下的请求示例展示了完整调用。
Tripo 对这些输入的命名与下面的 Schema 不同。其他所有字段都保持原名。
| Schema 字段 | Tripo 字段 |
|---|---|
model_url | input |
输入为公开 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。