curl -X POST "https://api.tokenlab.sh/v1/worlds/list" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"page_size": 20, "status": "SUCCEEDED", "model": "marble-1.1"}'
import requests
response = requests.post(
"https://api.tokenlab.sh/v1/worlds/list",
headers={"Authorization": "Bearer sk-your-api-key"},
json={"page_size": 20, "status": "SUCCEEDED", "model": "marble-1.1"},
)
print(response.json()["worlds"])
const response = await fetch('https://api.tokenlab.sh/v1/worlds/list', {
method: 'POST',
headers: {
Authorization: 'Bearer sk-your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({ page_size: 20, status: 'SUCCEEDED', model: 'marble-1.1' })
});
console.log((await response.json()).worlds);
{
"worlds": [
{
"world_id": "<string>",
"display_name": "<string>",
"world_marble_url": "<string>",
"assets": {},
"created_at": "2023-11-07T05:31:56Z",
"model": "<string>",
"permission": {},
"tags": [
"<string>"
],
"updated_at": "2023-11-07T05:31:56Z",
"world_prompt": {}
}
],
"next_page_token": "<string>"
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}Worlds
List Worlds
Lists completed World Labs Marble worlds created through TokenLab
POST
/
v1
/
worlds
/
list
curl -X POST "https://api.tokenlab.sh/v1/worlds/list" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"page_size": 20, "status": "SUCCEEDED", "model": "marble-1.1"}'
import requests
response = requests.post(
"https://api.tokenlab.sh/v1/worlds/list",
headers={"Authorization": "Bearer sk-your-api-key"},
json={"page_size": 20, "status": "SUCCEEDED", "model": "marble-1.1"},
)
print(response.json()["worlds"])
const response = await fetch('https://api.tokenlab.sh/v1/worlds/list', {
method: 'POST',
headers: {
Authorization: 'Bearer sk-your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({ page_size: 20, status: 'SUCCEEDED', model: 'marble-1.1' })
});
console.log((await response.json()).worlds);
{
"worlds": [
{
"world_id": "<string>",
"display_name": "<string>",
"world_marble_url": "<string>",
"assets": {},
"created_at": "2023-11-07T05:31:56Z",
"model": "<string>",
"permission": {},
"tags": [
"<string>"
],
"updated_at": "2023-11-07T05:31:56Z",
"world_prompt": {}
}
],
"next_page_token": "<string>"
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}List completed Marble Worlds in the current Workspace.
Use
/v1/worlds/generations/{id} for pending or failed generation tasks. This list returns completed worlds that TokenLab has indexed after generation.
Request Body
integer
default:"20"
Number of worlds to return, from 1 to 100.
string
Pagination token from the previous response.
string
Optional filter:
SUCCEEDED, PENDING, RUNNING, or FAILED. This endpoint lists completed worlds; the other three values return an empty list. Query generation tasks for their progress.string
Optional Marble model filter.
array
Optional tag filter.
boolean
Optional visibility filter.
string
Only return worlds created after this timestamp.
string
Only return worlds created before this timestamp.
string
default:"created_at"
Sort by
created_at or updated_at.string
default:"desc"
Sort direction:
asc or desc.Response
array
Array of world records.
string | null
Token for the next page, or
null.curl -X POST "https://api.tokenlab.sh/v1/worlds/list" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"page_size": 20, "status": "SUCCEEDED", "model": "marble-1.1"}'
import requests
response = requests.post(
"https://api.tokenlab.sh/v1/worlds/list",
headers={"Authorization": "Bearer sk-your-api-key"},
json={"page_size": 20, "status": "SUCCEEDED", "model": "marble-1.1"},
)
print(response.json()["worlds"])
const response = await fetch('https://api.tokenlab.sh/v1/worlds/list', {
method: 'POST',
headers: {
Authorization: 'Bearer sk-your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({ page_size: 20, status: 'SUCCEEDED', model: 'marble-1.1' })
});
console.log((await response.json()).worlds);
Authorizations
API Key authentication. Create or manage API keys in Dashboard > API > API Keys.
Body
application/json
Required range:
1 <= x <= 100Available options:
SUCCEEDED, PENDING, FAILED, RUNNING Available options:
marble-1.0, marble-1.1, marble-1.1-plus, marble-1.0-draft Available options:
created_at, updated_at TokenLab extension for ascending or descending order.
Available options:
asc, desc