apicheats.dev elevenlabs/llms.txt Raw .md
POST

/v1/music/upload

ElevenLabs API

Upload Music

Base URL
https://api.elevenlabs.io
Auth
xi-api-key: <ELEVENLABS_API_KEY>
Last verified
2026-09-03 · upstream hash matched
Actions
Agents: curl -H "Accept: text/markdown" this URL
→ 205 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 'file=@sample.bin' \  -F 'extract_composition_plan=false' \  -F 'with_timestamps=false' \  -F 'with_waveform_visual=false'
Get a free ElevenLabs API key → sponsored

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` or `music_v2`) 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"
}