Disband
Quick start

Quick start

Split a song into vocals and instrumental and download both stems, in cURL, JavaScript or Python.

Get a key

API keys work with bought credits only. The free daily credits apply to the web app. Buy a pack on Credits, then create a key on API keys. The key is shown once. Store it in an environment variable:

Shell
export DISBAND_KEY="disband_…"

Split a song

The program uploads song.mp3, waits until the separation is ready and saves each stem as an MP3 file. It requires curl and jq, Node.js 22 or later, or Python with requests.

id=$(curl -sf "https://api.disband.io/v1/separations" \
  --url-query stems=vocals --url-query stems=instrumental \
  -H "Authorization: Bearer $DISBAND_KEY" \
  --data-binary @song.mp3 | jq -r .id)

while :; do
  separation=$(curl -sf "https://api.disband.io/v1/separations/$id" \
    -H "Authorization: Bearer $DISBAND_KEY" \
    -H "Prefer: wait=60")
  status=$(jq -r .status <<< "$separation")
  [ "$status" = queued ] || [ "$status" = separating ] || break
done

for stem in $(jq -r '.stems | to_entries[] | select(.value.mp3) | .key' <<< "$separation"); do
  curl -sf "https://api.disband.io/v1/separations/$id/stems/$stem/mp3" \
    -H "Authorization: Bearer $DISBAND_KEY" -o "$stem.mp3"
done

What happens

  1. POST /separations returns 202 Accepted with the separation's id, status: "queued" and its charge in credits.
  2. Each GET /separations/{id} with Prefer: wait=60 returns when the status changes, from queued to separating to ready, or after 60 seconds.
  3. The ready separation lists the files of each stem with their URLs and sizes. Downloads require the same key. Files are deleted one hour after the separation is ready.

A stem with no audio in the song, for example vocals in an instrumental track, is returned as {"silent": true} without files. The program skips these.

Next steps

  • Separations: all parameters, statuses and downloads.
  • Credits: how the price is calculated.
  • Errors: error responses and which ones to retry.