跳转到内容

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 积分 · ≈ ₽129.10 运行前会测量你的文件 在此页面运行

获取 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
上下文遵循度用于平衡创作自由与相邻片段之间的一致性:选择高值以保持一致,或选择低值以允许更多创意偏离。
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/developers/models/elevenlabs/music/v2.5.md. 所有模型和指南: https://doitong.com/developers/llms.txt