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": "夕暮れの静かな海辺の町、細い路地と温かな灯り"
}'
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": "夕暮れの静かな海辺の町、細い路地と温かな灯り",
},
)
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: '夕暮れの静かな海辺の町、細い路地と温かな灯り'
})
});
const task = await response.json();
console.log(task.id, task.poll_url);
World を作成
World Labs Marble のワールド生成タスクを作成します
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": "夕暮れの静かな海辺の町、細い路地と温かな灯り"
}'
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": "夕暮れの静かな海辺の町、細い路地と温かな灯り",
},
)
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: '夕暮れの静かな海辺の町、細い路地と温かな灯り'
})
});
const task = await response.json();
console.log(task.id, task.poll_url);
poll_url が返ります。
Models API で現在利用可能な Marble モデルを選んでください。
リクエストボディ
world_prompt オブジェクトです。対応タイプは text、image、multi-image、video です。world_prompt.type="multi-image" と reconstruct_images: true を指定し、最大 8 枚まで渡せます。true、通常の単一画像なら false、または auto を指定します。public、allow_id_access、allowed_readers、allowed_writers。public: true は公開されるワールドの作成を要求します。レスポンス
pending、processing、completed、failed。料金
現在の料金は Pricing API で確認してください。最終請求額は利用記録に表示されます。返されたcost.total_credits は生成使用量であり、通貨の金額ではありません。
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": "夕暮れの静かな海辺の町、細い路地と温かな灯り"
}'
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": "夕暮れの静かな海辺の町、細い路地と温かな灯り",
},
)
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: '夕暮れの静かな海辺の町、細い路地と温かな灯り'
})
});
const task = await response.json();
console.log(task.id, task.poll_url);
承認
APIキー認証。Dashboard > API > API KeysでAPIキーを作成または管理します。
ヘッダー
リクエストごとの配信ポリシー。APIキーおよびWorkspaceのデフォルト設定を上書きします。TokenLab Verifiedを優先的に自動試行し、出力、アップストリームの承認、または永続リソース作成の前に、一度だけOfficialのみに切り替える場合があります。
auto, verified, official ボディ
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
上級者向けのネイティブWorld Labs world_promptオブジェクト。サポートされているプロンプトタイプは、text、image、multi-image、videoです。コンテンツ参照には、/v1/worlds/media-assets/prepare-upload で準備されたmedia_asset_idを指定したsource=media_assetを使用できます。
使用するMarbleモデル。省略された場合、現在のWorld Labs互換性のデフォルトに合わせてmarble-1.0がデフォルトとなります。
marble-1.0, marble-1.1, marble-1.1-plus テキストまたはガイド付きの画像/動画ワールド生成に使用されるテキストプロンプト。
生成されたワールドのオプションの表示名(最大64文字)。
64Base64またはデータURLの画像プロンプト。
画像URLプロンプト。
ショートカットのマルチ画像プロンプト。最大4枚の画像を指定してください。最大8枚の画像にはネイティブのworld_prompt.reconstruct_images=trueを使用してください。
4動画URLプロンプト。
画像プロンプトが既存のパノラマかどうか。パノラマ入力にはtrue、単一画像入力にはfalse、またはautoを使用してください。
0から4294967295までのオプションのシード値。
0 <= x <= 4294967295オプションのWorld Labsタグ。最大10個のタグを指定でき、各タグは最大32文字です。
1032オプションのWorld Labs権限オブジェクト。
エンドユーザー識別子。