跳轉到主要內容
使用 World Labs Marble 生成可探索的 3D 世界。這是一個非同步 API:建立回應會返回任務識別,以及用於查詢狀態的 poll_url 支援的模型為 marble-1.0marble-1.1marble-1.1-plus。World Labs 文件中也列出 marble-1.0-draft,但 TokenLab 目前尚未在此端點開放 draft 生成。

請求主體

model
string
預設值:"marble-1.0"
要使用的 Marble 模型:marble-1.0marble-1.1marble-1.1-plus
prompt
string
用於純文字生成的文字提示詞,也可作為圖片或影片輸入時的引導。
world_prompt
object
提供給進階呼叫方的原生 World Labs world_prompt 物件。支援的提示類型包括 textimagemulti-imagevideo
image
string
Base64 或 data URL 圖片提示。
image_url
string
圖片 URL 提示。
images
array
用於快捷多圖生成的多個圖片提示。最多提供 4 張圖片。若使用原生 World Labs 重建模式,請傳入 world_prompt.type="multi-image"reconstruct_images: true,並最多提供 8 張圖片。
video_url
string
影片 URL 提示。
is_pano
boolean | string
對於圖片輸入,設為 true 表示既有全景圖,false 表示普通單圖,或使用 auto
seed
integer
可選隨機種子,範圍為 0 到 4294967295。
display_name
string
可選的上游世界顯示名稱,最多 64 個字元。
tags
array
可選的上游標籤。最多提供 10 個標籤,每個標籤最多 32 個字元。
permission
object
可選的 World Labs 權限物件。

回應

id
string
用於輪詢的公開任務 ID。
task_id
string
非同步任務識別別名。
operation_id
string
上游 World Labs operation ID。
poll_url
string
此任務的建議輪詢 URL。
status
string
任務狀態:pendingprocessingcompletedfailed
world_marble_url
string
生成完成後返回的 Marble 世界 URL。
glb_url
string
可用時返回的碰撞網格 GLB URL。
pano_url
string
可用時返回的全景圖 URL。

計費

World Labs 按 credits 計費。TokenLab 會先按請求類型的最大值預扣,並在完成的 operation 返回 cost.total_credits 時按實際 credits 結算。標準 Marble 請求最多 1,600 credits。marble-1.1-plus 請求最多 3,100 credits。

範圍

這些管理端點涵蓋 TokenLab 歸屬的媒體資產和已完成生成的 worlds。TokenLab 仍不開放 marble-1.0-draft 生成或獨立 pano/depth 工具。
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": "夕陽下安靜的海邊小鎮,有狹窄小巷與溫暖燈光"
  }'