NeuralBridge
Entrar Baixar IDE
ElevenLabs

ElevenLabs Music v2

música e canções

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.

Características

Janela de contexto
—
Máx. de tokens na resposta
—
Fornecedor
ElevenLabs
Lançamento
—
Entrar
texto
Saída
áudio

Descrição

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.

Parâmetros

prompt
Texto da solicitação: o que deve ser gerado. Para vídeo — cena, movimento da câmera, iluminação; para música — gênero, humor, instrumentos, tempo. Limite de comprimento — definido pelo modelo.
duration
Duração em segundos: do clipe em vídeo, da faixa em música. Também afeta o preço.
instrumentalpadrão: false
true — a faixa é garantidamente sem voz. Sem isso, o modelo decide por conta própria, com base na descrição, se canta e gera as letras.
seed
Fixa a aleatoriedade: uma solicitação repetida com o mesmo seed e os mesmos parâmetros produz o mesmo resultado.
output_formatpadrão: 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, taxa de amostragem e bitrate: por exemplo mp3_44100_128 — MP3, 44,1 kHz, 128 kbps; opus_48000_96 — Opus em contêiner Ogg. auto — formato padrão do modelo.
sign_with_c2papadrão: false
true — a assinatura C2PA é adicionada ao arquivo MP3: marca indicando que a faixa foi criada por IA.
composition_plan
Música em partes: {"chunks": [{"text", "duration_ms", "positive_styles", "negative_styles", "context_adherence"}]}. Em text — nome da parte entre colchetes ([Verse 1], [Chorus]), linhas da música e indicações entre chaves ({guitar solo}). Em vez de prompt; limite — número de partes.
section_duration_ms
Limites de duration_ms de uma parte do plano, em milissegundos.
section_lines
Número máximo de linhas no texto de uma parte do plano.
section_line_chars
Comprimento máximo de uma linha de texto da parte.
section_name_chars
Limites de comprimento do nome da parte entre colchetes, por exemplo [Verse 1].
section_styles
Limites do número de estilos em positive_styles (a partir de um) e negative_styles de uma parte. É melhor escrever os estilos em inglês.
context_adherencepadrão: high · low · medium · high
low — a parte pode se afastar das vizinhas, high — mantém a sonoridade delas (padrão).

Endpoints

POSThttps://api.neuralbridge.ru/v1/audio/musicprincipal
Áudio — música — Música e canções: descrição ou plano em partes na entrada, arquivo de áudio na saída.

Exemplos de código

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

Outros modelos ElevenLabs

Modelos semelhantes: música e canções

Para o OpenAI SDK, especifique /v1 em base_url. Para Anthropic SDK — sem /v1.
Preços
Segundo da faixa / segundo0,3938 ₽
Custo da solicitação em rublos — no campo da resposta usage.cost
Identificador
elevenlabs/music-v2-08130
Obter chave API
Para agentes de IA