curl --fail-with-body "https://api.tokenlab.sh/v1/worlds/generations/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-H "Authorization: Bearer sk-your-api-key"
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"},
)
response.raise_for_status()
result = response.json()
if result["status"] in ["completed", "failed", "timeout"]:
print(result)
break
time.sleep(10)
const taskId = 'ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
const response = await fetch(`https://api.tokenlab.sh/v1/worlds/generations/${taskId}`, {
headers: { Authorization: 'Bearer sk-your-api-key' }
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
console.log(result);
{
"id": "<string>",
"status": "pending",
"task_id": "<string>",
"operation_id": "<string>",
"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": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}Worlds
Get World Status
Retrieves the status and result of a World Labs Marble world generation task
GET
/
v1
/
worlds
/
generations
/
{id}
curl --fail-with-body "https://api.tokenlab.sh/v1/worlds/generations/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-H "Authorization: Bearer sk-your-api-key"
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"},
)
response.raise_for_status()
result = response.json()
if result["status"] in ["completed", "failed", "timeout"]:
print(result)
break
time.sleep(10)
const taskId = 'ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
const response = await fetch(`https://api.tokenlab.sh/v1/worlds/generations/${taskId}`, {
headers: { Authorization: 'Bearer sk-your-api-key' }
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
console.log(result);
{
"id": "<string>",
"status": "pending",
"task_id": "<string>",
"operation_id": "<string>",
"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": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}Poll this endpoint to check the status of a World Labs Marble generation task. If the create response included
poll_url, prefer calling that exact URL.
An expired or unavailable public task can return
404 async_task_not_found. If task ownership cannot be established for the current API key, the response is 403 task_not_owned.Path Parameters
string
required
World generation task ID.
Response
Onlyid and status are required in a successful status response. Task aliases, operation IDs, world assets, captions, cost, and the string error are returned when available. A completed task does not guarantee that every asset URL is present.
string
Public task ID.
string
Async task identifier alias.
string
World Labs operation ID.
string
Task status:
pending, processing, completed, failed, or timeout.string
World Labs world ID when completed.
string
URL for the generated Marble world when completed.
string
Alias for the primary generated world/model URL.
string
Collider mesh GLB URL when available.
string
Panorama image URL when available.
string
Thumbnail image URL when available.
string
Upstream caption for the generated world.
object
Generation cost details when available, including
total_credits. Check your usage records for the billed amount.string
Error message when the task failed.
curl --fail-with-body "https://api.tokenlab.sh/v1/worlds/generations/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-H "Authorization: Bearer sk-your-api-key"
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"},
)
response.raise_for_status()
result = response.json()
if result["status"] in ["completed", "failed", "timeout"]:
print(result)
break
time.sleep(10)
const taskId = 'ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
const response = await fetch(`https://api.tokenlab.sh/v1/worlds/generations/${taskId}`, {
headers: { Authorization: 'Bearer sk-your-api-key' }
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
console.log(result);
Authorizations
API Key authentication. Create or manage API keys in Dashboard > API > API Keys.
Path Parameters
World generation task ID.
Response
Task status