> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aisonar.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取 World 状态

> 获取 World Labs Marble 世界生成任务的状态和结果

轮询此端点以检查 World Labs Marble 生成任务的状态。如果创建响应中包含 `poll_url`，请优先调用该完整 URL。

## 路径参数

<ParamField path="id" type="string" required>
  世界生成任务 ID。
</ParamField>

## 响应

<ResponseField name="id" type="string">
  公开任务 ID。
</ResponseField>

<ResponseField name="task_id" type="string">
  异步任务标识别名。
</ResponseField>

<ResponseField name="operation_id" type="string">
  世界生成操作 ID。
</ResponseField>

<ResponseField name="status" type="string">
  任务状态：`pending`、`processing`、`completed`、`failed` 或 `timeout`。
</ResponseField>

<ResponseField name="world_id" type="string">
  生成完成后的世界 ID。
</ResponseField>

<ResponseField name="world_marble_url" type="string">
  生成完成后返回的 Marble 世界 URL。
</ResponseField>

<ResponseField name="model_url" type="string">
  主要生成世界或模型 URL 的别名。
</ResponseField>

<ResponseField name="glb_url" type="string">
  可用时返回的碰撞网格 GLB URL。
</ResponseField>

<ResponseField name="pano_url" type="string">
  可用时返回的全景图 URL。
</ResponseField>

<ResponseField name="thumbnail_url" type="string">
  可用时返回的缩略图 URL。
</ResponseField>

<ResponseField name="caption" type="string">
  生成世界返回的 caption。
</ResponseField>

<ResponseField name="cost" type="object">
  可用时返回的生成费用详情，包括 `total_credits`。
</ResponseField>

<ResponseField name="error" type="string">
  任务失败时的错误消息。
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.aisonar.dev/v1/worlds/generations/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
    -H "Authorization: Bearer sk-your-api-key"
  ```

  ```python Python theme={null}
  import requests
  import time

  task_id = "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

  while True:
      response = requests.get(
          f"https://api.aisonar.dev/v1/worlds/generations/{task_id}",
          headers={"Authorization": "Bearer sk-your-api-key"},
      )
      result = response.json()
      if result["status"] in ["completed", "failed", "timeout"]:
          print(result)
          break
      time.sleep(10)
  ```

  ```javascript JavaScript theme={null}
  const taskId = 'ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
  const response = await fetch(`https://api.aisonar.dev/v1/worlds/generations/${taskId}`, {
    headers: { Authorization: 'Bearer sk-your-api-key' }
  });

  const result = await response.json();
  console.log(result.status, result.world_marble_url);
  ```
</RequestExample>
