bakeboolean
Bake advanced materials into the textures.
Mặc định: 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.
Thử model
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
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.
Bắt đầu xây dựng
Chọn một API được hỗ trợ với xác thực và theo dõi mức sử dụng thống nhất.
# 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"Tạo một SandBase API key và đặt nó trong môi trường máy chủ của bạn. Tất cả request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key trên máy chủ. Không hiển thị trong mã trình duyệt hoặc commit vào repository.
POST tới /v1/run với model ID này và các đầu vào của nó. Ví dụ request ở trên bao gồm cả bước gửi và polling.
Dùng run ID được trả về để poll cho đến khi trạng thái là completed, failed hoặc timeout. Chỉ đọc đầu ra sau khi completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Cung cấp một URL tệp có thể truy cập công khai trong trường image, video hoặc audio của model. Các định dạng và giới hạn được hỗ trợ hiển thị bên cạnh từng input trong Playground.
Dùng điều khiển upload hoặc replace trên các trường image được hỗ trợ trong Playground. Trường URL video chấp nhận một video driving được host; điều này không đồng nghĩa hỗ trợ tải lên video.
bakebooleanBake advanced materials into the textures.
Mặc định: true
quadbooleanQuad remesh (10,000 faces when face_limit is unset). Forces FBX.
Mặc định: false
formatstringbắt buộcOutput format.
Mặc định: "FBX"
Giá trị có thể dùng: "GLTF", "FBX", "USDZ", "OBJ", "STL", "3MF"
pack_uvbooleanPack all UV islands into one texture.
Mặc định: false
model_urlstringbắt buộcURL of the input 3D model (GLB, GLTF, FBX, OBJ or STL, up to 150 MB).
face_limitintegerTarget face count. Original when unset.
Tối thiểu: 1
fbx_presetstringFBX target application.
Mặc định: "blender"
Giá trị có thể dùng: "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.
Mặc định: 1
texture_sizeintegerTexture size in pixels.
Mặc định: 4096
flatten_bottombooleanFlatten the bottom of the model.
Mặc định: false
force_symmetrybooleanSymmetric quad mesh. Only with quad.
Mặc định: false
texture_formatstringTexture image format.
Mặc định: "JPEG"
Giá trị có thể dùng: "JPEG", "PNG", "WEBP", "BMP", "DPX", "HDR", "OPEN_EXR", "TARGA", "TIFF"
with_animationbooleanKeep animations.
Mặc định: true
animate_in_placebooleanRemove root motion from animations.
Mặc định: false
texture_packagingstringFBX only: embedded textures, or a zip with the FBX and a .fbm folder.
Mặc định: "embedded"
Giá trị có thể dùng: "embedded", "zip"
export_orientationstringForward axis of the exported model.
Giá trị có thể dùng: "+x", "-x", "+y", "-y"
export_vertex_colorsbooleanVertex colors (OBJ and GLTF only).
Mặc định: false
pivot_to_center_bottombooleanMove the pivot to the bottom center.
Mặc định: false
flatten_bottom_thresholdnumberDepth flattened when flatten_bottom is on.
Mặc định: 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
}Một run đã hoàn tất sẽ hiển thị kết quả trong output. Phần sau là ví dụ đã lưu của model, không phải một lần tạo mới.
Chưa có đầu ra ví dụ nào được công bố. Dùng Playground → Result → JSON sau khi run hoàn tất để xem phản hồi của bạn.
Model này cũng được cung cấp trên Tripo v3 API. Phần thân yêu cầu, đối tượng tác vụ và mã lỗi tuân theo Tripo, nên mã Tripo hiện có sẽ chạy sau khi bạn đổi base URL thành https://api.sandbase.ai/tripo/v3 và gửi SandBase API key dưới dạng Authorization: Bearer. Các yêu cầu chạy trên kênh chính thức của Tripo với cùng mức giá như /v1/run.
POST https://api.sandbase.ai/tripo/v3/models/convert. model là tùy chọn và chọn phiên bản thuật toán Tripo; nếu bỏ qua, mặc định của Tripo sẽ được áp dụng. Ví dụ yêu cầu ở trên trong mục Tripo v3 API cho thấy một lệnh gọi hoàn chỉnh.
Tripo đặt tên các đầu vào này khác với Schema bên dưới. Mọi trường khác giữ nguyên tên.
| Trường Schema | Trường Tripo |
|---|---|
model_url | input |
Đầu vào là các URL công khai, dưới dạng chuỗi hoặc đối tượng có trường url. Hiện chưa chấp nhận mã tác vụ Tripo và giá trị file_token, chưa hỗ trợ tải tệp lên, và webhook_url bị bỏ qua.
Gửi yêu cầu sẽ trả về data.task_id. Thăm dò cho đến khi data.status là success, failed hoặc cancelled. Khi thành công, data.output dùng tên trường của Tripo như model_url, và credits_consumed là phí SandBase với 1 credit = $0.01.
curl "https://api.sandbase.ai/tripo/v3/tasks/$TASK_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"POST /tripo/v3/tasks/list với {"task_ids": [...]} trả về tối đa 100 tác vụ. GET /tripo/v3/account/balance trả về số dư SandBase của bạn tính bằng credits.
Lỗi dùng cấu trúc của Tripo: {"code": 1004, "status": "error", "message": "..."}.
| code | Ý nghĩa |
|---|---|
2 / 1002 | Thiếu, không hợp lệ hoặc API key SandBase không được ủy quyền |
1003 | Phần thân không phải là một đối tượng JSON |
1004 | Thiếu hoặc sai tham số. Thông báo nêu tên trường Tripo |
1007 / 2000 | Đã đạt giới hạn tốc độ hoặc giới hạn đồng thời |
2001 | Không tìm thấy tác vụ, hoặc được tạo bằng API key khác |
2002 | Endpoint hoặc tính năng không được hỗ trợ trên SandBase |
2010 | Số dư SandBase không đủ hoặc đã đạt giới hạn chi tiêu của API key |
4001 | Endpoint không xác định |
Khi Tripo từ chối hoặc tác vụ thất bại, nó kết thúc ở failed với error_code và error_message của Tripo. Các mã liên quan đến yêu cầu hoặc nội dung của bạn được giữ nguyên; các mã liên quan đến tài khoản Tripo phía upstream được báo là 1000.