跳至內容

Elevenlabs Music v2.5

整合

模型 id elevenlabs/music/v2.5
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/elevenlabs/music/v2.5?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.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

像範例一樣的檔案: $1.20 1,200 API 點數 · ≈ ₽128.78 您的檔案會在執行前計量 在此頁面執行

取得 API 金鑰
ElevenLabs 文字轉音樂 #music#text-to-music

較新的 v2.5 音樂作曲版本,由文字提示或分段式作曲計畫驅動

ElevenLabs · 音訊

您的第一個結果會顯示在這裡

在下方建立請求,並使用您的 API 金鑰執行。輸出會複製到我們的儲存空間,可永久保留或免費保留 7 天。

建立請求

控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。

88 / 4100

所需音樂的文字描述。

選用的歌曲時長(以毫秒計),範圍為 3000 ms 至 600000 ms,僅在使用提示詞時適用。省略時,模型會根據提示詞決定時長。

進階 output_format · seed · force_instrumental · composition_plan
預設 mp3_48000_192

使用 codec_sample_rate_bitrate 模式選擇生成音訊的格式。Twilio 音訊輸入通常使用 μ-law,也寫作 mu-law 或近似寫作 u-law;MP3 範例為 mp3_22050_32,指定取樣率 22.05 kHz 與位元率 32 kbs。

音樂生成初始化種子,僅可搭配 `composition_plan` 使用,以改善使用相同參數與種子執行時的一致性。不保證結果完全重現。

分成多個區塊的音樂組成計畫。

POST /run/elevenlabs/music/v2.5?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.ru/v1/run/elevenlabs/music/v2.5?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.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

執行此請求

您的金鑰會保留在此瀏覽器中:只會傳送至 Doitong API,且只有在勾選「記住」時才會儲存至 localStorage。 取得 API 金鑰

關於 Elevenlabs Music v2.5

從最多 4100 個字元的 `prompt` 或 `composition_plan` 生成音樂。使用提示詞時,`music_length_ms` 可介於 3000 至 600000 ms,`force_instrumental` 可保證不含人聲。`seed` 僅在搭配 composition plan 時套用。`output_format` 提供多種 MP3 與 PCM 變體,預設為 mp3_48000_192。

參數

名稱類型 預設值允許值 說明
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
情境遵循度會在創意自由與鄰近區塊的一致性之間取得平衡:選擇 high 以保持一致,或選擇 low 以允許更多創意偏離。
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_192
使用 codec_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.5",
  "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.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
您的檔案,由您選擇每個 outputs[].url 都是儲存空間中的副本:可永久保留(按 GB-月計費),或免費保留 7 天;可透過帳戶設定或 ?storage= 設定。
所有模型使用相同結構圖片、影片和音訊皆包含 type、url、content_type、width、height 和 duration。output 是模型自己的結果物件。
輸出欄位
audio
object {url, content_type, file_name, file_size}編碼為 MP3 音訊的生成音樂檔案。

更多模型:文字轉音樂

給 AI 代理程式:此頁面的 Markdown 位於 https://doitong.com/zh-TW/developers/models/elevenlabs/music/v2.5.md. 所有模型與指南: https://doitong.com/developers/llms.txt