3D
创建 3D 模型
根据文字或图片生成 3D 模型
用文字或图片创建 3D 模型。创建成功后会返回任务 ID,通过任务接口查询进度和结果。
该接口不使用 operation。只有 prompt 时为文生 3D;带有 image 或 image_url 时为图生 3D。不要发送旧字段 3d-generation。
请求体
发送可选字段前,请通过 GET /v1/models/{model} 查看该模型接受的参数。示例只发送 model 和 prompt。
tripo-h3.1要使用的模型,例如 tripo-h3.1 或 tripo-p1.0。发送图片或指定输出格式前,请通过 GET /v1/models?recommended_for=3d 查看模型详情。
要生成的 3D 模型的文本描述。
用于图像转 3D 生成的 Base64 编码图像。
用于图像转 3D 生成的图像 URL。
输出格式;是否支持及允许值取决于所选模型。
质量设置;是否支持及允许值取决于所选模型。
模型的风格预设。
整数种子,仅在所选模型支持时使用。
终端用户的唯一标识符。
响应
用于查询状态的任务 ID。
返回时与 id 对应的同一异步任务标识。
返回时优先使用的任务轮询 URL。
任务状态:pending、processing、completed 或 failed。
任务创建的 Unix 时间戳。
请求
curl -X POST "https://api.tokenlab.sh/v1/3d/generations" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "tripo-h3.1",
"prompt": "A detailed medieval castle with towers"
}'响应
{
"id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"task_id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"poll_url": "/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"status": "pending",
"created": 1706000000,
"model": "tripo-h3.1"
}授权
BearerAuth API Key 身份验证。在 Dashboard > API > API Keys 中创建或管理 API Key。
位置: header
请求头
单次请求的交付策略。覆盖 API 密钥和 Workspace 的默认设置。自动优先尝试 TokenLab Verified,并在输出、请求接受或持久资源创建之前,可能会切换一次至仅限 Official。
可选值
- "auto"
- "verified"
- "official"
请求体
application/json
响应
application/json
application/json