Worlds

获取 World 状态

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

GET
/v1/worlds/generations/{id}

GET /v1/worlds/generations/{id} 是兼容端点,继续保留,供现有集成使用。新集成请用同一个任务 id 调用 GET /v1/tasks/{id},详见获取任务状态。

此端点返回 World Labs Marble 生成任务的状态。使用创建响应中的任务 id。

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

路径参数

idstringpath必填

World 生成任务 ID。

响应

成功的状态响应仅要求返回 id 和 status。任务别名、operation ID、世界资源和描述仅在可用时返回。任务完成不代表每个资源 URL 都存在。任务失败时仍返回 HTTP 200:请读取 status、error 和 error_details。

world_marble_url 打开 World Labs 的交互式查看页面。glb_url、pano_url、thumbnail_url 等结果文件是 TokenLab 链接,任务完成前为空或不返回。

idstring

公开任务 ID。

task_idstring

异步任务标识别名。

operation_idstring

World Labs operation ID。

statusstring

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

world_idstring

完成后的 World Labs world ID。

world_marble_urlstring

完成后生成的 Marble world URL。

model_urlstring

主要生成的 world/模型 URL 的别名。

glb_urlstring

可用时返回的碰撞网格 GLB URL。这是 TokenLab 媒体结果链接,保留 30 天。

pano_urlstring

可用时返回的全景图 URL。这是 TokenLab 媒体结果链接,保留 30 天。

thumbnail_urlstring

可用时返回的缩略图 URL。这是 TokenLab 媒体结果链接,保留 30 天。

captionstring

生成的 world 的 caption。

errorstring | object

任务失败时的错误信息。

error_detailsobject

任务失败时的失败详情:status、message、type、code、retryable,以及请求字段出错时的 param。

media_retentionobject

已完成响应中 TokenLab 媒体结果链接的保存状态:days 和 items[](含 url、kind、status、expires_at)。该字段可能缺失,链接仍可使用。详见数据保留。

请求

curl --fail-with-body "https://api.tokenlab.sh/v1/tasks/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",  "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"    }  },  "media_retention": {    "days": 0,    "items": [      {        "url": "http://example.com",        "kind": "image",        "content_type": "string",        "status": "saving",        "expires_at": "2019-08-24T14:15:22Z"      }    ]  }}

授权

BearerAuth
AuthorizationBearer <token>

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

位置: header

路径参数

id*string

世界生成任务 ID。

响应

application/json

application/json

application/json