> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/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">
  上流 World Labs のオペレーション ID です。
</ResponseField>

<ResponseField name="status" type="string">
  タスク状態：`pending`、`processing`、`completed`、`failed`、`timeout`。
</ResponseField>

<ResponseField name="world_id" type="string">
  完了時の上流 World Labs ワールド 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` を含む上流 operation のコスト詳細です。
</ResponseField>

<ResponseField name="error" type="string">
  タスク失敗時のエラーメッセージです。
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.tokenlab.sh/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.tokenlab.sh/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.tokenlab.sh/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>
