Skip to main content

Endpoint

POST /api/v1/music/stem
Synchronous. This operation runs in real time and may take up to 5 minutes. The response is returned once processing completes (no polling needed). Separates the vocal track from an existing music clip. You can optionally specify a time range to isolate a particular vocal section.

Request body

FieldTypeRequiredDescription
clip_idstringYesClip ID to process. Obtain from Upload Audio (data.clipId) or a completed generation task (results[].id).
vocal_start_sfloatNoStart time (seconds) of the section to process. Default 0.
vocal_end_sfloatNoEnd time (seconds) of the section to process. Default: full clip.

Response

{
  "code": 0,
  "message": "ok",
  "request_id": "req-1710000000000",
  "data": {
    "id": "stem-abc123",
    "source_clip_id": "abc123def456",
    "status": "complete",
    "vocal_audio_url": "https://cdn.example.com/tob/stem/abc123_vocal.mp3",
    "vocal_start_s": 0,
    "vocal_end_s": 87.4
  }
}
FieldTypeDescription
idstringStem separation job ID
source_clip_idstringThe original clip ID
statusstring"complete" when successful
vocal_audio_urlstringURL of the extracted vocal audio file
vocal_start_sfloatActual start time processed
vocal_end_sfloatActual end time processed

Example

curl -X POST https://api.example.com/api/v1/music/stem \
  -H "Authorization: Bearer sk-mm-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "clip_id": "abc123def456",
    "vocal_start_s": 30.0,
    "vocal_end_s": 90.0
  }'
The vocal_audio_url from this endpoint can be used as chop_sample_clip_id in the Add Vocals endpoint.