Skip to main content
POST
/
eleven
/
music
音乐生成
curl --request POST \
  --url https://api.mountsea.ai/eleven/music \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "musicLengthMs": 180000,
  "model": "music_v1",
  "detailed": false,
  "prompt": "A melancholic indie folk song with acoustic guitar and soft vocals",
  "compositionPlan": {
    "positive_global_styles": [
      "epic orchestral",
      "cinematic"
    ],
    "negative_global_styles": [
      "lo-fi",
      "acoustic"
    ],
    "sections": [
      {
        "section_name": "Verse",
        "positive_local_styles": [
          "soft piano",
          "building tension"
        ],
        "negative_local_styles": [
          "heavy drums"
        ],
        "duration_ms": 15000,
        "lines": [
          "First line of lyrics",
          "Second line"
        ]
      }
    ]
  },
  "seed": 877369,
  "forceInstrumental": false,
  "respectSectionsDurations": true,
  "outputFormat": "mp3_44100_128",
  "storeForInpainting": false,
  "signWithC2pa": false
}
'
{
  "taskId": "<string>"
}
Generate music using ElevenLabs’ music_v1 model. Supports two mutually exclusive input modes:
  • Prompt mode: Provide a simple text prompt — quick and easy
  • Composition Plan mode: Provide a structured compositionPlan with section-level control over styles, duration, and lyrics
This is an async task. The response contains a taskId — use Get Task Status to poll for the generated audio.

Modes

Simple Prompt

Set prompt to describe the desired music. Optionally set forceInstrumental: true to generate without vocals.

Composition Plan

Set compositionPlan with positive_global_styles, negative_global_styles, and a sections array. Each section can have its own section_name, positive_local_styles, negative_local_styles, duration_ms, and lines (lyrics).
Use Create Plan to generate a composition plan from a text prompt (free, no credits), then pass it here after reviewing.

Detailed Mode

Set detailed: true to get lyrics timestamps and other metadata in the result. Corresponds to ElevenLabs’ /v1/music/detailed endpoint.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
musicLengthMs
number
required

歌曲长度(毫秒),范围 3000-600000ms

Required range: 3000 <= x <= 600000
Example:

180000

model
enum<string>
required

模型 ID

Available options:
music_v1
Example:

"music_v1"

detailed
boolean
default:false

是否返回详细信息(歌词时间戳等元数据),默认 false

prompt
string

简单文字提示(与 compositionPlan 互斥)

Example:

"A melancholic indie folk song with acoustic guitar and soft vocals"

compositionPlan
object

详细作曲计划(与 prompt 互斥,通过 /eleven/plan 生成)

seed
number

随机种子

Example:

877369

forceInstrumental
boolean
default:false

强制纯器乐,仅 prompt 模式

respectSectionsDurations
boolean
default:true

是否严格遵守段落时长,仅 compositionPlan 模式

outputFormat
enum<string>
default:mp3_44100_128

输出格式,格式为 codec_sampleRate_bitrate。MP3 192kbps 需要 Creator 及以上,PCM 44.1kHz 需要 Pro 及以上

Available options:
mp3_22050_32,
mp3_24000_48,
mp3_44100_32,
mp3_44100_64,
mp3_44100_96,
mp3_44100_128,
mp3_44100_192,
pcm_8000,
pcm_16000,
pcm_22050,
pcm_24000,
pcm_32000,
pcm_44100,
pcm_48000,
ulaw_8000,
alaw_8000,
opus_48000_32,
opus_48000_64,
opus_48000_96,
opus_48000_128,
opus_48000_192
storeForInpainting
boolean
default:false

是否保存生成结果用于后续 Inpainting 编辑。仅限具备 Inpainting 权限的企业客户使用

signWithC2pa
boolean
default:false

是否使用 C2PA 签名标记 AI 生成内容。仅适用于 MP3 输出格式,会在文件中嵌入加密的 AI 生成来源证明

Response

200 - application/json

任务创建成功

taskId
string
required

任务 ID,用于后续查询结果