Worlds

获取 World 状态

获取 Marble World 生成任务的状态和结果

GET
/v1/worlds/generations/{id}

创建响应中包含 poll_url 时,直接使用该地址查询进度和结果。

已过期或不可用的公开任务可能返回 404 async_task_not_found。无法确认当前 API 密钥对任务的归属权限时,返回 403 task_not_owned。

路径参数

idstringpath必填

世界生成任务 ID。

响应

成功的状态响应仅要求返回 id 和 status。任务别名、operation ID、世界资源、描述、费用和字符串 error 仅在可用时返回。任务完成不代表每个资源 URL 都存在。

idstring

TokenLab 任务 ID。

task_idstring

与 id 相同的任务 ID。

operation_idstring

World Labs operation ID。

statusstring

任务状态:pending、processing、completed、failed 或 timeout。

world_idstring

生成完成后的 World Labs 世界 ID。

world_marble_urlstring

生成完成后返回的 Marble 世界 URL。

model_urlstring

主要生成世界或模型 URL 的别名。

glb_urlstring

可用时返回的碰撞网格 GLB URL。

pano_urlstring

可用时返回的全景图 URL。

thumbnail_urlstring

可用时返回的缩略图 URL。

captionstring

生成结果附带的 caption。

costobject

生成费用详情(如有),可能包含 total_credits。实际扣费请查看用量记录。

errorstring

任务失败时的错误消息。

请求

curl --fail-with-body "https://api.tokenlab.sh/v1/worlds/generations/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
  -H "Authorization: Bearer sk-your-api-key"
{  "id": "string",  "task_id": "string",  "operation_id": "string",  "status": "pending",  "world_id": "string",  "world_marble_url": "string",  "model_url": "string",  "glb_url": "string",  "pano_url": "string",  "thumbnail_url": "string",  "caption": "string",  "cost": {},  "error": "string",  "error_details": {    "projection_version": 0,    "status": 400,    "message": "string",    "type": "string",    "code": "string",    "param": "string",    "retryable": true,    "upstream": {      "source": "string",      "code": "string",      "message": "string",      "param": "string"    }  }}

授权

BearerAuth
AuthorizationBearer <token>

API Key 身份验证。在 Dashboard > API > API Keys 中创建或管理 API Key。

位置: header

路径参数

id*string

世界生成任务 ID。

响应

application/json

application/json

application/json