curl -X POST "https://api.tokenlab.sh/v1/worlds/generations" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "marble-1.1",
"prompt": "A quiet coastal town at sunset with narrow alleys and warm lights"
}'
import requests
response = requests.post(
"https://api.tokenlab.sh/v1/worlds/generations",
headers={"Authorization": "Bearer sk-your-api-key"},
json={
"model": "marble-1.1",
"prompt": "A quiet coastal town at sunset with narrow alleys and warm lights",
},
)
task = response.json()
print(task["id"], task["poll_url"])
const response = await fetch('https://api.tokenlab.sh/v1/worlds/generations', {
method: 'POST',
headers: {
Authorization: 'Bearer sk-your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'marble-1.1',
prompt: 'A quiet coastal town at sunset with narrow alleys and warm lights'
})
});
const task = await response.json();
console.log(task.id, task.poll_url);
Create World
Creates a World Labs Marble world generation task
curl -X POST "https://api.tokenlab.sh/v1/worlds/generations" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "marble-1.1",
"prompt": "A quiet coastal town at sunset with narrow alleys and warm lights"
}'
import requests
response = requests.post(
"https://api.tokenlab.sh/v1/worlds/generations",
headers={"Authorization": "Bearer sk-your-api-key"},
json={
"model": "marble-1.1",
"prompt": "A quiet coastal town at sunset with narrow alleys and warm lights",
},
)
task = response.json()
print(task["id"], task["poll_url"])
const response = await fetch('https://api.tokenlab.sh/v1/worlds/generations', {
method: 'POST',
headers: {
Authorization: 'Bearer sk-your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'marble-1.1',
prompt: 'A quiet coastal town at sunset with narrow alleys and warm lights'
})
});
const task = await response.json();
console.log(task.id, task.poll_url);
poll_url for status checks.
Choose a currently available Marble model using the Models API.
Request Body
world_prompt object for advanced callers. Supported prompt types are text, image, multi-image, and video.world_prompt.type="multi-image" with reconstruct_images: true and up to 8 images.true for an existing panorama, false for a normal single image, or auto.public, allow_id_access, allowed_readers, and allowed_writers. public: true requests a publicly visible world.Response
pending, processing, completed, or failed.Pricing
See the Pricing API for current rates. The final billed amount is shown in your usage records; a returnedcost.total_credits value is generation usage, not a currency amount.
curl -X POST "https://api.tokenlab.sh/v1/worlds/generations" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "marble-1.1",
"prompt": "A quiet coastal town at sunset with narrow alleys and warm lights"
}'
import requests
response = requests.post(
"https://api.tokenlab.sh/v1/worlds/generations",
headers={"Authorization": "Bearer sk-your-api-key"},
json={
"model": "marble-1.1",
"prompt": "A quiet coastal town at sunset with narrow alleys and warm lights",
},
)
task = response.json()
print(task["id"], task["poll_url"])
const response = await fetch('https://api.tokenlab.sh/v1/worlds/generations', {
method: 'POST',
headers: {
Authorization: 'Bearer sk-your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'marble-1.1',
prompt: 'A quiet coastal town at sunset with narrow alleys and warm lights'
})
});
const task = await response.json();
console.log(task.id, task.poll_url);
Authorizations
API Key authentication. Create or manage API keys in Dashboard > API > API Keys.
Headers
Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, upstream acceptance, or persistent resource creation.
auto, verified, official Body
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Native World Labs world_prompt object for advanced callers. Supported prompt types are text, image, multi-image, and video. Content references may use source=media_asset with a media_asset_id prepared by /v1/worlds/media-assets/prepare-upload.
Marble model to use. Defaults to marble-1.0 to match the current World Labs compatibility default when model is omitted.
marble-1.0, marble-1.1, marble-1.1-plus Text prompt used for text or guided image/video world generation.
Optional display name for the generated world, up to 64 characters.
64Base64 or data URL image prompt.
Image URL prompt.
Shortcut multi-image prompts. Provide up to 4 images. Use native world_prompt.reconstruct_images=true for up to 8 images.
4Video URL prompt.
Whether an image prompt is an existing panorama. Use true for pano input, false for single-image input, or auto.
Optional seed from 0 through 4294967295.
0 <= x <= 4294967295Optional World Labs tags. Provide up to 10 tags, each up to 32 characters.
1032Optional World Labs permission object.
End-user identifier.