ElevenLabs Music
Compose music, stream audio and metadata, create composition plans, and score uploaded video through ModelSell.
Choose music_v2_5 for new integrations. The same routes accept music_v2 and music_v1 when your ModelSell group grants access. The endpoint defaults to music_v1 when model_id is omitted. ElevenLabs plans to retire v1 on January 31, 2027. ElevenLabs models · Compose music
Set MODELSELL_BASE_URL and MODELSELL_API_KEY using the ElevenLabs integration overview. Send your ModelSell key in the xi-api-key header.
Choose an endpoint
| ModelSell route | Request | Response on success |
|---|---|---|
POST /elevenlabs/v1/music | JSON | Complete audio file. Compose music |
POST /elevenlabs/v1/music/stream | JSON | Audio bytes as they become available. Stream music |
POST /elevenlabs/v1/music/detailed | JSON | multipart/mixed with JSON metadata and binary audio. Compose with details |
POST /elevenlabs/v1/music/detailed/stream | JSON | Server-Sent Events for the plan, metadata, audio and completion. Stream with details |
POST /elevenlabs/v1/music/plan | JSON | A composition plan for the selected model. Create a plan |
POST /elevenlabs/v1/music/video-to-music | Multipart | Audio soundtrack, or ZIP for separate music and sound-effects tracks. Video to Music |
Compose from a prompt
cat > music-request.json <<'JSON'
{
"model_id": "music_v2_5",
"prompt": "A calm instrumental with soft piano, brushed drums, and a gentle ending",
"music_length_ms": 10000,
"force_instrumental": true
}
JSON
curl --fail-with-body \
"$MODELSELL_BASE_URL/elevenlabs/v1/music?output_format=mp3_44100_128" \
-H "xi-api-key: $MODELSELL_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @music-request.json \
--output music.mp3| Field | Where | Meaning |
|---|---|---|
prompt | JSON | A description of up to 4,100 characters. Choose either prompt or composition_plan. |
composition_plan | JSON | Structured instructions for beats, sections or lyrics. Use a plan produced for the same model version. |
music_length_ms | JSON | Optional duration in milliseconds for prompt-based requests. The API schema accepts 3,000 to 600,000. |
force_instrumental | JSON | Set to true with a prompt to generate instrumental music. |
seed | JSON | Optional integer from 0 to 2,147,483,647 for plan-based generation. Repeatability is approximate. |
output_format | Query | Set the desired audio encoding or use auto on the compose and stream routes. |
enable_logging | Query | Set to false to request zero retention on eligible ElevenLabs plans. |
The gateway forwards Song-Id when ElevenLabs includes it. Select supported options for your endpoint and model. Compose fields · Eleven Music guide
Stream audio or composition details
Use the same JSON with /music/stream for audio bytes. To read metadata as the track generates, use the detailed stream below. Add with_timestamps: true or with_waveform_visual: true to the JSON when you need the optional timestamp or waveform data.
curl --fail-with-body --no-buffer \
"$MODELSELL_BASE_URL/elevenlabs/v1/music/detailed/stream?output_format=mp3_44100_128" \
-H "xi-api-key: $MODELSELL_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @music-request.jsonParse the detailed stream as SSE and handle completion before treating the track as ready. For /music/detailed, use the boundary in the response's Content-Type to split the metadata and audio parts. Detailed streaming reference · Detailed response reference
Create a reusable plan
curl --fail-with-body "$MODELSELL_BASE_URL/elevenlabs/v1/music/plan" \
-H "xi-api-key: $MODELSELL_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"model_id":"music_v2_5","prompt":"A short acoustic intro with two sections","music_length_ms":10000}' \
--output composition-plan.jsonPass the returned JSON as composition_plan in a subsequent compose request with the same model_id. The model version determines the plan schema. Use the provider workspace to manage stored tracks, fine-tunes, and plans that reference account assets. Composition plan schema
Generate music for a video
Upload local video files as multipart form data. Repeat the videos[] field for multiple clips. ElevenLabs combines them in upload order. Start with a small file within your gateway's upload limit. ElevenLabs allows up to 10 videos, 200 MB combined, and 600 seconds total. Video to Music inputs
curl --fail-with-body \
"$MODELSELL_BASE_URL/elevenlabs/v1/music/video-to-music?output_format=mp3_44100_128" \
-H "xi-api-key: $MODELSELL_API_KEY" \
-F 'model_id=music_v2_5' \
-F 'videos[][email protected];type=video/mp4' \
-F 'description=Quiet instrumental accompaniment for a walk in the forest' \
-F 'add_sfx=false' \
-F 'separate_tracks=false' \
--output soundtrack.mp3Set use_audio_as_reference=true to let ElevenLabs use characteristics of the input soundtrack. Set add_sfx=true to add sound effects and separate_tracks=true to receive a ZIP containing separate tracks. In that case, save the output with a .zip extension. Video to Music response formats
Billing
These routes use the configured ModelSell per-request price. That includes the composition-plan route, even though it consumes zero credits under the provider's own pricing. Check the price in your ModelSell group before running multiple requests. ModelSell prices · Provider composition-plan pricing