bakeboolean
Bake textures onto the new mesh (not v1.0).
ค่าเริ่มต้น: true
tripo3d/tripo/remeshTripo Remesh rebuilds an existing 3D model with clean triangle or quad topology at a target face count. Accepts GLB, OBJ, FBX or STL input.
ลองใช้โมเดล
ต้องการทำอะไรต่อ
เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground
{
"model_url": "https://static.sandbase.ai/examples/d844350a-5fac-4a9d-a0c3-79ef0ea8e7e7/input/1a91c960-1c7f-4348-90e9-55eadc4a9b77.glb"
}Tripo Remesh rebuilds an existing 3D model with clean triangle or quad topology at a target face count. 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 | v3.0 / v2.0 / v1.0 | v3.0 | v3.0 is the newest; v2.0 smart; v1.0 basic (no bake or part_names). |
quad | boolean | false | Quad topology instead of triangles. |
face_limit | integer 500–20000 | — | Target face count. v3.0: 500-20,000 (500-10,000 with quad). Adaptive when unset. |
smart_uv | boolean | false | Also unwrap UVs (v3.0 only). |
bake | boolean | true | Bake textures onto the new mesh (not v1.0). |
part_names | array | — | Only process these parts (node names from a segmentation, e.g. tripo_part_0). All parts when unset. |
url: Remeshed model (FBX with quad).thumbnail: Preview render.| model | Price |
|---|---|
| v3.0 triangle | $0.35 |
| v3.0 quad | $0.40 |
| v2.0 | $0.30 |
| v1.0 | $0.10 |
| 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/remesh",
"bake": true,
"quad": false,
"smart_uv": false,
"model_url": "https://static.sandbase.ai/examples/tripo3d/tripo/shared/object.glb",
"model_version": "v3.0"
}
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 key และตั้งค่าไว้ในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอทั้งหมดใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์หรือคอมมิตลง repository
POST ไปที่ /v1/run ด้วย model ID นี้และอินพุตของมัน ตัวอย่างคำขอด้านบนมีทั้งการส่งและการ polling
ใช้ run ID ที่ส่งกลับมาเพื่อ polling จนกว่าสถานะจะเป็น completed, failed หรือ timeout ให้อ่าน output หลังจาก completed เท่านั้น
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"ส่ง URL ไฟล์ที่เข้าถึงได้สาธารณะในช่อง image, video หรือ audio ของโมเดล รูปแบบและข้อจำกัดที่รองรับแสดงอยู่ข้างแต่ละอินพุตใน Playground
ใช้ตัวควบคุม upload หรือ replace ในช่องรูปภาพที่รองรับใน Playground ช่อง URL ของวิดีโอรองรับวิดีโอ driving ที่โฮสต์ไว้; ไม่ได้หมายความว่าสามารถอัปโหลดวิดีโอได้
bakebooleanBake textures onto the new mesh (not v1.0).
ค่าเริ่มต้น: true
quadbooleanQuad topology instead of triangles.
ค่าเริ่มต้น: false
smart_uvbooleanAlso unwrap UVs (v3.0 only).
ค่าเริ่มต้น: false
model_urlstringจำเป็นURL of the input 3D model (GLB, GLTF, FBX, OBJ or STL, up to 150 MB).
face_limitintegerTarget face count. v3.0: 500-20,000 (500-10,000 with quad). Adaptive when unset.
ขั้นต่ำ: 500
สูงสุด: 20000
part_namesarrayOnly process these parts (node names from a segmentation, e.g. tripo_part_0). All parts when unset.
model_versionstringv3.0 is the newest; v2.0 smart; v1.0 basic (no bake or part_names).
ค่าเริ่มต้น: "v3.0"
ค่าที่เป็นไปได้: "v3.0", "v2.0", "v1.0"
{
"model": "tripo3d/tripo/remesh",
"bake": true,
"quad": false,
"smart_uv": false,
"model_url": "https://static.sandbase.ai/examples/tripo3d/tripo/shared/object.glb",
"model_version": "v3.0"
}run ที่เสร็จสมบูรณ์จะแสดงผลลัพธ์ใน output ต่อไปนี้เป็นตัวอย่างที่บันทึกไว้ของโมเดล ไม่ใช่การสร้างใหม่
[
{
"poster": "https://static.sandbase.ai/examples/d844350a-5fac-4a9d-a0c3-79ef0ea8e7e7/output/47b4985a-89cd-4d59-8f71-392e43741f53.png",
"thumbnail": "https://static.sandbase.ai/examples/d844350a-5fac-4a9d-a0c3-79ef0ea8e7e7/output/47b4985a-89cd-4d59-8f71-392e43741f53.png",
"url": "https://static.sandbase.ai/examples/d844350a-5fac-4a9d-a0c3-79ef0ea8e7e7/output/997c155c-2abb-44ab-9591-8d0424624304.glb"
}
]โมเดลนี้ยังให้บริการบน Tripo's v3 API ด้วย เนื้อหาของคำขอ ออบเจ็กต์งาน และรหัสข้อผิดพลาดเป็นไปตาม Tripo ดังนั้นโค้ด Tripo เดิมจะใช้งานได้หลังจากคุณเปลี่ยน base URL เป็น https://api.sandbase.ai/tripo/v3 และส่ง SandBase API key เป็น Authorization: Bearer คำขอจะรันผ่านช่องทางทางการของ Tripo ในราคาเดียวกับ /v1/run
POST https://api.sandbase.ai/tripo/v3/mesh/decimate model เป็นตัวเลือกและใช้เลือกเวอร์ชันอัลกอริทึมของ Tripo; หากไม่ระบุจะใช้ค่าเริ่มต้นของ Tripo ตัวอย่างคำขอด้านบนในหัวข้อ Tripo v3 API แสดงการเรียกใช้งานครบถ้วน
Tripo ตั้งชื่ออินพุตเหล่านี้ต่างจากสคีมาด้านล่าง ฟิลด์อื่นทั้งหมดคงชื่อเดิม
| ฟิลด์ของสคีมา | ฟิลด์ของ Tripo |
|---|---|
model_url | input |
model_version | model |
อินพุตต้องเป็น URL สาธารณะ ในรูปแบบสตริงหรือออบเจ็กต์ที่มีฟิลด์ url ยังไม่รองรับ task id ของ Tripo และค่าของ 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"POST /tripo/v3/tasks/list พร้อม {"task_ids": [...]} จะส่งกลับ task ได้สูงสุด 100 รายการ GET /tripo/v3/account/balance จะส่งคืนยอดคงเหลือของ SandBase ในหน่วย credit
ข้อผิดพลาดใช้ envelope ของ Tripo: {"code": 1004, "status": "error", "message": "..."}
| code | ความหมาย |
|---|---|
2 / 1002 | ไม่มี API key ของ SandBase, API key ไม่ถูกต้อง หรือไม่ได้รับอนุญาต |
1003 | เนื้อหาไม่ใช่ออบเจ็กต์ JSON |
1004 | พารามิเตอร์หายไปหรือไม่ถูกต้อง ข้อความจะระบุฟิลด์ของ Tripo |
1007 / 2000 | ถึงขีดจำกัดอัตราเรียกใช้หรือขีดจำกัดการทำงานพร้อมกันแล้ว |
2001 | ไม่พบ task หรือสร้างด้วย API key อื่น |
2002 | endpoint หรือฟีเจอร์นี้ยังไม่รองรับบน SandBase |
2010 | ยอดคงเหลือ SandBase ไม่เพียงพอ หรือถึงขีดจำกัดการใช้จ่ายของ API key แล้ว |
4001 | ไม่รู้จัก endpoint |
เมื่อ Tripo ปฏิเสธหรือทำ task ไม่สำเร็จ ระบบจะจบที่ failed พร้อม error_code และ error_message ของ Tripo รหัสที่เกี่ยวกับคำขอหรือเนื้อหาของคุณจะส่งผ่านโดยไม่เปลี่ยนแปลง ส่วนรหัสที่เกี่ยวกับบัญชี Tripo ต้นทางจะแสดงเป็น 1000