ElevenLabs Music v2
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.
Özellikler
Açıklama
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.
Parametreler
Uç noktalar
Kod örnekleri
Diğer ElevenLabs modelleri
Benzer modeller: müzik ve şarkılar
/v1 base_url içinde. Anthropic SDK için — olmadan /v1.