NeuralBridge
Sign in Download IDE
ElevenLabs

ElevenLabs Music v2

music and songs

ElevenLabs music model: instrumental tracks and songs with vocals from a description or from a plan of parts with your own lyrics, 3 seconds to 10 minutes.

Specifications

Context window
—
Max tokens in response
—
Vendor
ElevenLabs
Release
—
Login
text
Output
audio

Description

What it does

  • Music from a description: genre, mood, instruments, tempo (BPM), key, production era. With instrumental: true the track is guaranteed to have no vocals.
  • A song from a description: without instrumental the model decides whether to sing and writes the lyrics to fit the length.
  • A song from a plan: composition_plan lists the parts of the song (verse, chorus, bridge), each with its own lyrics, styles and length. Lyrics can be in any language; styles work best in English.
  • Length from a description is duration, 3 to 600 seconds, required. A plan lasts as long as its parts together: each part 3 to 120 seconds, 600 seconds and 30 parts at most.
  • File format is output_format: MP3 (22–48 kHz, 32–320 kbit/s) or Opus; auto is MP3 48 kHz, 192 kbit/s.
  • seed makes results repeatable, with a plan only. sign_with_c2pa adds a C2PA mark to the MP3 saying the track was made by AI.
  • You may use the music and songs in your own videos and projects, including commercially.

How to call

POST /v1/audio/music with a JSON body. Describe the track in one of two ways: with a prompt (up to 4100 characters) or with a composition_plan. They cannot be sent together. With a description:

{"model": "elevenlabs/music-v2-08130", "prompt": "French house, 122 BPM, filtered disco sample chops, sidechained bass, rooftop-at-sunset mood", "duration": 30, "instrumental": true}

With a plan:

{"model": "elevenlabs/music-v2-08130", "composition_plan": {"chunks": [
  {"text": "[Verse]\nWalking down an empty street\nWondering who I'll meet", "duration_ms": 15000, "positive_styles": ["pop", "upbeat", "female vocals", "acoustic guitar"], "negative_styles": ["dark", "slow"]},
  {"text": "[Chorus]\nThis is my moment\nI won't let it go", "duration_ms": 15000, "positive_styles": ["powerful vocals", "full band"], "context_adherence": "high"}
]}}

The text of a part holds its name in square brackets ([Verse 1], [Chorus], [Outro]), the lyric lines separated by line breaks (up to 30 lines of 200 characters) and short cues in curly braces: {guitar solo}, {instrumental break}. A part without words has only its name: [Intro]. The styles of the first part set the sound of the whole track, so list 6–7 styles there.

Response

The response is the track file itself (audio/mpeg or audio/ogg), as with /v1/audio/speech. The X-NB-Audio-Seconds header holds the billed seconds. A one-minute track takes about half a minute, so set a client timeout of at least 10 minutes.

Errors

  • 400: invalid input, such as a description without duration, a prompt together with a plan, seed with a description, duration or instrumental with a plan, a part shorter than 3 or longer than 120 seconds, more than 30 lines in a part, empty styles, a description over 4100 characters. The error text names the field and the allowed values.
  • 402: not enough funds on the balance.
  • 502 or 504: the track was not received; nothing is charged.

Price

You pay per second of the finished track: for a description, the length you set; for a plan, the sum of its parts. The price is shown on this page.

Parameters

prompt
The request text: what you want to get. For video: the scene, camera movement and light; for music: genre, mood, instruments, tempo. The length limit depends on the model.
duration
Length in seconds: of the clip for video, of the track for music. Also affects the price.
instrumentaldefault: false
true guarantees a track without vocals. Without it the model decides from the description whether to sing, and writes the lyrics itself.
seed
Pins randomness: repeating a request with the same seed and parameters returns the same result.
output_formatdefault: auto · auto · mp3_48000_128 · mp3_48000_192 · mp3_48000_240 · mp3_48000_320 · mp3_22050_32 · mp3_24000_48 · mp3_44100_32 · mp3_44100_64 · mp3_44100_96 · mp3_44100_128 · mp3_44100_192 · opus_48000_32 · opus_48000_64 · opus_48000_96 · opus_48000_128 · opus_48000_192
Codec, sample rate and bitrate: for example mp3_44100_128 is MP3, 44.1 kHz, 128 kbit/s; opus_48000_96 is Opus in an Ogg container. auto is the model default.
sign_with_c2padefault: false
true adds a C2PA signature to the MP3 file, a mark that the track was made by AI.
composition_plan
A song in parts: {"chunks": [{"text", "duration_ms", "positive_styles", "negative_styles", "context_adherence"}]}. text holds the part name in square brackets ([Verse 1], [Chorus]), the lyric lines and cues in curly braces ({guitar solo}). Used instead of prompt; the limit is the number of parts.
section_duration_ms
Limits of duration_ms of one plan part, in milliseconds.
section_lines
The largest number of lines in text of one plan part.
section_line_chars
The longest allowed line in a part text.
section_name_chars
Length limits of the part name in square brackets, for example [Verse 1].
section_styles
Limits of the number of styles in positive_styles (at least one) and negative_styles of one part. Styles work best in English.
context_adherencedefault: high · low · medium · high
low lets a part drift away from its neighbours, high keeps their sound (default).

Endpoints

POSThttps://api.neuralbridge.ru/v1/audio/musicprimary
Audio — music — Music and songs: a description or a plan of parts in, audio file out.

Code examples

bash
curl https://api.neuralbridge.ru/v1/audio/music \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "elevenlabs/music-v2-08130", "prompt": "Warm cinematic ambient, soft piano, subtle strings, hopeful mood", "duration": 30, "instrumental": true}' \
  --output music.mp3

Other ElevenLabs models

Related models: music and songs

For OpenAI SDK, specify /v1 in base_url. For Anthropic SDK — without /v1.
Prices
Track second / second0,3938 ₽
The request cost in rubles — in the response, field usage.cost
Identifier
elevenlabs/music-v2-08130
Get API key