快速开始

快速开始

API

创建 3D 生成任务 POST查询任务状态 GET列出可用模型 GET
API 参考

创建 3D 生成任务

从一张或多张输入图片生成 3D 模型(GLB)。

异步模式(推荐):立即返回 202 和任务 ID。 轮询 GET /tasks/{taskId} 获取结果。

同步模式:阻塞最多 55 秒。如果任务在此期间完成, 直接返回结果。如果仍在运行,返回任务 ID 供轮询。

积分会立即扣除。失败时积分自动退还。

POST
/3d/generations

Authorization

BearerAuth

AuthorizationBearer <token>

API key with tr_ prefix, sent as Bearer token

In: header

Request Body

application/json

image_url?string

Single image URL (for image-to-3d models)

Formaturi
image_urls?array<string>

Multiple image URLs for multi-view models

Items1 <= items <= 4
prompt?string

Text prompt (required for text-to-3d models like tripo-text)

Lengthlength <= 2000
model*string

Public model alias

Value in"trellis2" | "tripo" | "tripo-multiview" | "hunyuan3d" | "tripo-text"
mode?string

sync waits up to 55s; async returns immediately

Default"async"
Value in"sync" | "async"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://trellis2.app/api/v1/3d/generations" \  -H "Content-Type: application/json" \  -d '{    "image_url": "https://example.com/chair.jpg",    "model": "trellis2",    "mode": "async"  }'

{
  "id": "task_abc123",
  "object": "3d.generation",
  "status": "completed",
  "created": 1723000000,
  "completed_at": 1723000060,
  "data": {
    "model_url": "https://r2.example.com/model.glb",
    "format": "glb",
    "model": "trellis2"
  },
  "usage": {
    "credits_consumed": 10,
    "credits_remaining": 990
  }
}

{
  "id": "task_abc123",
  "object": "task",
  "status": "pending",
  "created": 1723000000,
  "data": null
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string",
    "param": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string",
    "param": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string",
    "param": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string",
    "param": "string"
  }
}

错误处理

如何处理 API 错误和边界情况

查询任务状态 GET

下一页

curl -X POST "https://trellis2.app/api/v1/3d/generations" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/chair.jpg",
    "model": "trellis2",
    "mode": "async"
  }'