跳至內容

Elevenlabs Music

整合

模型 id elevenlabs/music
# 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?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.80 1,800 API 點數 · ≈ ₽193.64 您的檔案會在執行前計量 在此頁面執行

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

由提示或結構化作曲計畫驅動的文字轉音樂生成器,支援純樂器模式

ElevenLabs · 音訊

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

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

建立請求

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

88 / 4100

所需音樂的文字描述。

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

進階 output_format · force_instrumental · respect_sections_durations · composition_plan
預設 mp3_44100_128

音訊輸出格式,受方案層級限制:192 kbps MP3 需要 Creator 層級以上,44.1 kHz PCM 需要 Pro 層級以上。值遵循 `codec_sample_rate_bitrate`;例如 `mp3_22050_32` 指定取樣率 22.05 kHz、位元率 32 kbs 的 MP3。Twilio 音訊輸入通常使用 μ-law;此格式也寫作 mu-law,或近似寫作 u-law。

定義音樂組成的計畫。

POST /run/elevenlabs/music?wait=20 報價 → $1.80
# 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?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

從最多 4100 個字元的文字 `prompt`,或詳細的 `composition_plan` 創作音樂。使用提示詞時,`music_length_ms` 可介於 3000 至 600000 毫秒,`force_instrumental` 可保證不含人聲。`respect_sections_durations` 控制計畫區段計時的嚴格程度。透過 `output_format` 提供多種編碼器與取樣率選項。

參數

名稱類型 預設值允許值 說明
prompt選填
類型string | null
≤ 4,100 個字元
所需音樂的文字描述。
composition_plan選填
類型object
定義音樂組成的計畫。
composition_plan.positive_global_styles必填
類型string[]
整首歌曲要包含的風格。
composition_plan.negative_global_styles必填
類型string[]
整首歌曲要排除的風格。
composition_plan.sections必填
類型object[]
組成歌曲的區段。
composition_plan.sections[].section_name必填
類型string
1 – 100 characters
區段名稱,長度為 1 至 100 個字元。
composition_plan.sections[].positive_local_styles必填
類型string[]
此區段要包含的風格。
composition_plan.sections[].negative_local_styles必填
類型string[]
此區段要排除的風格。
composition_plan.sections[].duration_ms必填
類型integer
3,000 – 120,000
區段長度(以毫秒計),範圍為 3000 ms 至 120000 ms。
composition_plan.sections[].lines必填
類型string[]
此區段的歌詞,每行最多 200 個字元。
music_length_ms選填
類型integer | null
3,000 – 600,000
選用的歌曲時長(以毫秒計),範圍為 3000 ms 至 600000 ms,僅在使用提示詞時適用。省略時,模型會根據提示詞決定時長。
force_instrumental選填
類型boolean
預設值false
僅器樂控制項,僅在使用提示詞時可用。設為 true 可保證輸出器樂;false 則依提示詞允許器樂或非器樂音樂。
respect_sections_durations選填
類型boolean
預設值true
`composition_plan` 的區段時長強制設定,對該計畫以外的內容無效。False 允許模型調整個別區段長度,通常可改善品質與延遲,且不改變歌曲總時長;true 則強制每個區段嚴格使用其 `duration_ms`。
output_format選填
類型enum
預設值mp3_44100_128
mp3_22050_32mp3_44100_32mp3_44100_64mp3_44100_96mp3_44100_128mp3_44100_192pcm_8000pcm_16000pcm_22050pcm_24000pcm_44100pcm_48000ulaw_8000alaw_8000opus_48000_32opus_48000_64
另有 3 個opus_48000_96opus_48000_128opus_48000_192
音訊輸出格式,受方案層級限制:192 kbps MP3 需要 Creator 層級以上,44.1 kHz PCM 需要 Pro 層級以上。值遵循 `codec_sample_rate_bitrate`;例如 `mp3_22050_32` 指定取樣率 22.05 kHz、位元率 32 kbs 的 MP3。Twilio 音訊輸入通常使用 μ-law;此格式也寫作 mu-law,或近似寫作 u-law。
必填

輸出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "elevenlabs/music",
  "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": 1800,
    "usd": "1.80",
    "charged": 1800,
    "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.md. 所有模型與指南: https://doitong.com/developers/llms.txt