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 或报错信息发给我们,我们来查。