Elevenlabs Music v2
統合
モデルID
elevenlabs/music/v2
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/elevenlabs/music/v2?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/elevenlabs/music/v2?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/elevenlabs/music/v2", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/ja/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.com/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "elevenlabs/music/v2",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
}
Doitong APIを通じてElevenlabs Music v2モデル(elevenlabs/music/v2)を呼び出します。エージェント向けドキュメント: https://doitong.com/ja/developers/models/elevenlabs/music/v2.md
POST https://api.doitong.com/v1/run/elevenlabs/music/v2?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
レスポンスのステータスが"queued"または"running"の場合、"succeeded"になるまでGET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20をポーリングしてください。ファイルはoutputs[].urlにあります。同じボディでPOST https://api.doitong.com/v1/quote/elevenlabs/music/v2を実行すると、実行前の正確な価格が返されます。
例と同様のファイル: $1.20 1,200 APIクレジット 実行前にファイルを計測します このページで実行
新しいAPIキーです。 これは今だけ表示され、コードと下記のAPIキー欄にすでに入力されています。秘密にしてください。ブラウザで実行されるコードに決して含めないでください。
ElevenLabs · 音声
最初の結果がここに表示されます
以下でリクエストを作成し、APIキーで実行してください。出力はストレージにコピーされ、永久保存または無料で7日保存されます。
リクエストを作成
コントロールはモデルスキーマから生成されます。値を変更するとコードと価格が更新されます。
POST
/run/elevenlabs/music/v2?wait=20
見積もり → $1.20
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/elevenlabs/music/v2?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/elevenlabs/music/v2?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/elevenlabs/music/v2", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "elevenlabs/music/v2",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"wait_seconds": 20
}
}
}
Elevenlabs Music v2について
最大4100文字のテキスト`prompt`または構造化された`composition_plan`から音楽を作成します。プロンプト使用時、`music_length_ms`で長さを3000~600000 msに設定でき、`force_instrumental`でボーカルを除外します。`output_format`でコーデック、サンプルレート、ビットレートを選択でき、MP3とPCMにも対応します。`seed`はcomposition plan使用時のみ機能します。
パラメータ
名前型
デフォルト許可される値
説明
prompt任意
型string | null
≤ 4,100文字
希望する音楽のテキスト説明。
composition_plan任意
型object
チャンクに整理された音楽構成プラン。
composition_plan.chunks必須
型object[]
1 – 30 items
生成に使用する順序付きチャンク。最大30チャンクで、合計時間は3000 ms~600000 msです。
composition_plan.chunks[].text必須
型string
チャンク生成用テキスト。最大30行、各行200文字までです。歌詞には{scratching}のような波括弧内のインライン指示を含めることができ、[Verse 1]のような角括弧内の任意の冒頭セクション名に続けることもできます。セクション名は1~100文字である必要があります。
composition_plan.chunks[].duration_ms必須
型integer
3,000 – 120,000
チャンクの長さ(ミリ秒)。範囲は3000 ms~120000 msです。
composition_plan.chunks[].positive_styles必須
型string[]
このチャンクに求めるスタイルと音楽的指示。最初のチャンクの選択が最も強く影響し、曲全体のジャンルとトーンを決定します。後続のチャンクでは音楽を発展させたり、ニュアンスを加えたり、方向性を変えたりできます。英語の説明が最も効果的です。
composition_plan.chunks[].negative_styles任意
型string[]
このチャンクで避ける音楽スタイルと指示。明示的に除外する項目だけを指定し、それ以外はリストを空にするのが適切なデフォルトです。
composition_plan.chunks[].context_adherence任意
型enum
lowmediumhigh
コンテキストへの追従度。創造性の自由度と隣接チャンクとの一貫性のバランスを取ります。一貫性を重視する場合は高くし、より創造的な逸脱を許容する場合は低くします。
composition_plan.chunks[].audio_reference任意
型object
このチャンクのスタイル条件付け用音声クリップ。曲全体に適用するには最初のチャンクに指定します。その配置が最も強く影響し、参照内容が後続のすべてのチャンクに影響します。
music_length_ms任意
型integer | null
3,000 – 600,000
任意の曲の長さ(ミリ秒)。範囲は3000 ms~600000 msで、プロンプト使用時のみ適用されます。省略すると、モデルがプロンプトから長さを決定します。
force_instrumental任意
型boolean
デフォルトfalse
インストゥルメンタルのみの制御。プロンプト使用時のみ利用できます。trueにするとインストゥルメンタル出力が保証され、falseの場合はプロンプトに応じてインストゥルメンタルまたは非インストゥルメンタルの音楽が生成されます。
seed任意
型integer | null
音楽生成の初期化シード。`composition_plan`と併用する場合のみ使用でき、同一のパラメータとシードで実行した際の一貫性を高めます。結果が完全に再現される保証はありません。
output_format任意
型enum
デフォルトmp3_48000_192
mp3_22050_32mp3_24000_48mp3_44100_32mp3_44100_64mp3_44100_96mp3_44100_128mp3_44100_192mp3_48000_128mp3_48000_192mp3_48000_240mp3_48000_320pcm_8000pcm_16000pcm_22050pcm_24000pcm_32000
さらに9件
pcm_44100pcm_48000ulaw_8000alaw_8000opus_48000_32opus_48000_64opus_48000_96opus_48000_128opus_48000_192codec_sample_rate_bitrateの形式で生成音声の形式を選択します。Twilioの音声入力ではμ-lawが一般的に使用され、mu-lawとも表記され、u-lawと近似されることもあります。MP3の例はmp3_22050_32で、サンプルレート22.05 kHz、ビットレート32 kbsを指定します。
必須
出力
GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "elevenlabs/music/v2",
"status": "succeeded",
"created_at": "2026-10-20T12:00:00Z",
"started_at": "2026-10-20T12:00:02Z",
"completed_at": "2026-10-20T12:00:09Z",
"queue_position": null,
"cost": {
"credits": 1200,
"usd": "1.20",
"charged": 1200,
"refunded": 0
},
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"output": {
"audio": {
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
"content_type": "audio/mpeg",
"file_name": "0-output.mp3",
"file_size": 1843200
}
},
"outputs": [
{
"type": "audio",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
"content_type": "audio/mpeg",
"file_size": 1843200,
"duration": 12,
"stored": true
}
],
"error": null,
"metrics": {
"inference_seconds": 6.8
},
"urls": {
"self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
ファイルの保存期間を選択すべてのoutputs[].urlはストレージ上のコピーです。アカウント設定または?storage=により、永久保存(GB・月単位で有料)または無料で7日保存できます。
すべてのモデルで同じ形式画像、動画、音声のいずれでも、type、url、content_type、width、height、durationが含まれます。outputはモデル独自の結果オブジェクトです。
出力フィールド
- audio
- object {url, content_type, file_name, file_size}MP3音声としてエンコードされた生成音楽ファイル。
その他のElevenlabs Musicバリアント
その他のモデル: テキストから音楽
AIエージェント向け:このページのMarkdown版はこちらです: https://doitong.com/ja/developers/models/elevenlabs/music/v2.md. すべてのモデルとガイド: https://doitong.com/developers/llms.txt