POST
POST /v1/music/upload — ElevenLabs API
ElevenLabs APIUpload Music
- Base URL
- https://api.elevenlabs.io
- Auth
- xi-api-key: <ELEVENLABS_API_KEY>
- Last verified
- 2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 208 tokens · Vary: Accept
→ 208 tokens · Vary: Accept
Critical gotchas
Authentication uses the non-standard xi-api-key header, not Authorization: Bearer. Sending a Bearer token returns HTTP 401.
Text-to-speech responses are raw binary audio, not JSON. Write the body to a file (--output speech.mp3) rather than parsing it.
cURL
curl -X POST 'https://api.elevenlabs.io/v1/music/upload' \ -H "xi-api-key: $ELEVENLABS_API_KEY" \ -F '[email protected]' \ -F 'extract_composition_plan=false' \ -F 'with_timestamps=false' \ -F 'with_waveform_visual=false'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| file | body | string | Yes | The audio file to upload. |
| extract_composition_plan | body | boolean | No | Whether to generate and return the composition plan for the uploaded song. Pass a model id (`music_v1`, `music_v2` or `music_v2_5`) to control which composition plan format is returned. Passing `true`/`false` is deprecated; `true` defaults to the `music_v1` plan format. Enabling this will increase the latency. |
| with_timestamps | body | boolean | No | Whether to transcribe the uploaded song and return word-level timestamps. If True, the response will include words_timestamps but will increase the latency. |
| with_waveform_visual | body | boolean | No | Whether to return the visual waveform of the uploaded song. |
Response 200 OK
{
"song_id": "jR4Xz8kL2mNpQ9wVtY1b"
} Get a free ElevenLabs API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.