Skip to main content
POST
/
marble
/
v1
/
worlds
/
{world_id}
:export
Export World
curl --request POST \
  --url https://api.worldlabs.ai/marble/v1/worlds/{world_id}:export \
  --header 'Content-Type: application/json' \
  --header 'WLT-Api-Key: <api-key>' \
  --data '
{
  "mesh_variant": "textured",
  "resolution": "full_res"
}
'
import requests

url = "https://api.worldlabs.ai/marble/v1/worlds/{world_id}:export"

payload = {
"mesh_variant": "textured",
"resolution": "full_res"
}
headers = {
"WLT-Api-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'WLT-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({mesh_variant: 'textured', resolution: 'full_res'})
};

fetch('https://api.worldlabs.ai/marble/v1/worlds/{world_id}:export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.worldlabs.ai/marble/v1/worlds/{world_id}:export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mesh_variant' => 'textured',
'resolution' => 'full_res'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"WLT-Api-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.worldlabs.ai/marble/v1/worlds/{world_id}:export"

payload := strings.NewReader("{\n \"mesh_variant\": \"textured\",\n \"resolution\": \"full_res\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("WLT-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.worldlabs.ai/marble/v1/worlds/{world_id}:export")
.header("WLT-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mesh_variant\": \"textured\",\n \"resolution\": \"full_res\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.worldlabs.ai/marble/v1/worlds/{world_id}:export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["WLT-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mesh_variant\": \"textured\",\n \"resolution\": \"full_res\"\n}"

response = http.request(request)
puts response.read_body
{
  "done": true,
  "operation_id": "<string>",
  "cost": {
    "total_credits": 123,
    "line_items": [
      {
        "credits": 123,
        "name": "<string>"
      }
    ]
  },
  "created_at": "2023-11-07T05:31:56Z",
  "error": {
    "code": 123,
    "message": "<string>"
  },
  "expires_at": "2023-11-07T05:31:56Z",
  "metadata": {},
  "response": {
    "url": "<string>",
    "resolution": "<string>"
  },
  "updated_at": "2023-11-07T05:31:56Z"
}
{
"detail": "Insufficient API credits to start this request. Add credits or enable auto-refill at https://platform.worldlabs.ai/billing."
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

WLT-Api-Key
string
header
required

API key for authentication. Get your key from the developer portal.

Path Parameters

world_id
string
required

Body

application/json

Request to export a generated world asset.

asset_type
enum<string>
required

Asset family to export: 'splats' or 'mesh'.

Available options:
splats,
mesh
format
enum<string>
required

Requested export format.

Available options:
ply,
glb
mesh_variant
enum<string>
default:textured

Mesh variant to return when an HQ mesh already exists.

Available options:
textured,
vertex_colored
resolution
enum<string>
default:full_res

Splat resolution to convert when exporting splats as PLY.

Available options:
full_res,
500k,
150k,
100k

Response

Successful Response

Response from world export endpoint.

done
boolean
required

True if the operation is completed

operation_id
string
required

Operation identifier

cost
OperationCost · object | null

Settled credit cost for the operation. Populated only on successful completion.

created_at
string<date-time> | null

Creation timestamp

error
OperationError · object | null

Error information if the operation failed

expires_at
string<date-time> | null

Expiration timestamp

metadata
Metadata · object | null

Service-specific metadata, such as progress percentage

response
ExportWorldResult · object | null

Result payload when done=true and no error. Structure depends on operation type.

updated_at
string<date-time> | null

Last update timestamp