API 參考
3D 模型
POST
/v1/model3d/tasksGET
/v1/model3d/tasks/{task_id}非同步 3D 生成與後處理。由 operation 欄位決定任務做什麼:用文字、一張圖片或多視角圖片生成模型,再進行貼圖、分割、重拓撲或綁定骨架。提交後回傳 task_id;輪詢任務,直到任務內容中出現模型網址。
#請求參數
modelstring必填目錄裡的 3D 模型 ID,例如 tripo-3d。
operationstring必填text_to_model · image_to_model · multiview_to_model · texture · smart_segment · retopology · rig · animate。
promptstring選填要生成什麼。text_to_model 使用。
inputstring選填image_to_model 時填公開圖片網址;texture、smart_segment、retopology、rig、animate 時填一個已完成 3D 模型的 task_id。
inputsobject[]選填multiview_to_model:[{"front": url}, {"left": url}, …],正面加至少一個其他視角。
textureboolean選填同時生成貼圖。
pbrboolean選填生成 PBR 材質。
texture_promptobject選填texture:{"text": "weathered bronze"} 描述新的表面。
face_limitinteger選填retopology:結果最多可有多少個面。
quadboolean選填retopology:用四邊形網格取代三角形。
animationstring選填animate:要套用到已綁定骨架模型的動畫。
#相關錯誤碼
- 404 not_foundtask_id 不存在,或後續步驟引用的輸入任務不存在、尚未完成。
- 401Bearer 權杖無效或缺失。這條路徑不帶 error.code,請依狀態碼判斷。
- 402 insufficient_user_quota錢包餘額不足以覆蓋預扣估算。
- 429金鑰級限流。回應主體為空,按 Retry-After 等待。若 429 帶有 insufficient_user_quota,那是每日消費上限,不是限流。
- 503 model_not_found模型名稱不存在,或目前沒有健康的通道可以提供服務。
#請求範例
# 1. make a model from text
curl https://www.aisplice.store/v1/model3d/tasks \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "tripo-3d", "operation": "text_to_model", "prompt": "A small ceramic fox", "texture": true}'
# 2. poll until status is completed; the file is in url
curl https://www.aisplice.store/v1/model3d/tasks/$TASK_ID -H "Authorization: Bearer sk-YOUR_KEY"
# 3. texture it: pass the finished task_id as input
curl https://www.aisplice.store/v1/model3d/tasks \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "tripo-3d", "operation": "texture", "input": "'$TASK_ID'", "texture_prompt": {"text": "weathered bronze"}}'#回應
response.json
// POST /v1/model3d/tasks
{"task_id": "task_xxx", "status": "queued"}
// GET /v1/model3d/tasks/{task_id} — after completion
{"task_id": "task_xxx", "status": "completed", "url": "https://…/model.glb", "output": {"model_url": "https://…/model.glb"}}還是沒解決?
把請求 ID 或錯誤訊息傳給我們,我們來查。