> ## Documentation Index
> Fetch the complete documentation index at: https://developer.audioshake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Instrument Separation

> Isolate vocals, drums, bass, and other instruments from a mixed track

Split a song into its individual components — vocals, drums, bass, guitar, keys, and more. Use the separated stems for remixing, rebalancing, sampling, or feeding into downstream production workflows.

See the full list of available stem models on the [Models](https://developer.audioshake.ai/models.md) page.

## Create a Task

Include one target per stem you want to extract:

```python separate_stems.py theme={null}
import requests

API_KEY = "your_api_key"
HEADERS = {"Content-Type": "application/json", "x-api-key": API_KEY}

response = requests.post(
    "https://api.audioshake.ai/tasks",
    headers=HEADERS,
    json={
        "assetId": "your_asset_id",
        "targets": [
            {"model": "vocals", "formats": ["wav"]},
            {"model": "drums", "formats": ["wav"]},
            {"model": "bass", "formats": ["wav"]},
            {"model": "other", "formats": ["wav"]}
        ]
    }
)

task_id = response.json()["id"]
print(f"Task created: {task_id}")
```

```javascript separateStems.js theme={null}
const API_KEY = "your_api_key";
const headers = { "Content-Type": "application/json", "x-api-key": API_KEY };

const createRes = await fetch("https://api.audioshake.ai/tasks", {
  method: "POST",
  headers,
  body: JSON.stringify({
    assetId: "your_asset_id",
    targets: [
      { model: "vocals", formats: ["wav"] },
      { model: "drums", formats: ["wav"] },
      { model: "bass", formats: ["wav"] },
      { model: "other", formats: ["wav"] }
    ]
  })
});

const { id: taskId } = await createRes.json();
console.log(`Task created: ${taskId}`);
```

```bash curl theme={null}
curl -X POST "https://api.audioshake.ai/tasks" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $AUDIOSHAKE_API_KEY" \
  -d '{
    "assetId": "your_asset_id",
    "targets": [
      { "model": "vocals", "formats": ["wav"] },
      { "model": "drums", "formats": ["wav"] },
      { "model": "bass", "formats": ["wav"] },
      { "model": "other", "formats": ["wav"] }
    ]
  }'
```

[Check Task status](https://developer.audioshake.ai/check-task-status.md) to monitor progress and download results, or use [webhooks](https://developer.audioshake.ai/api-reference/tasks/webhooks.md) to be notified when each target completes.

## Get everything else

Add a `residual` target to receive one stem containing everything the task's other targets don't cover:

```json theme={null}
"targets": [
  { "model": "guitar", "formats": ["wav"] },
  { "model": "bass", "formats": ["wav"] },
  { "model": "drums", "formats": ["wav"] },
  { "model": "residual", "formats": ["wav"] }
]
```

All targets must use the same `formats`, and at least one non-residual target is required.

> [!NOTE]
>
> This is different from the per-target `residual: true` option, which returns everything outside that one stem. A task can use one or the other, not both.

## Drum kit separation

The `drum_kit` model breaks the drums into six stems from a single target: `kick`, `snare`, `toms`, `hihat`, `cymbals`, and `percussions`.

```json theme={null}
{ "model": "drum_kit", "formats": ["wav"] }
```

## Use cases

* Build instrumentals by removing the vocal stem
* Rebalance drum and bass levels for a custom mix
* Export individual stems into a DAW for editing
* Create sample packs from existing recordings

> [card] [Build Karaoke Tracks](https://developer.audioshake.ai/create-karaoke-tracks.md)
>
> Combine instrumental + lyrics for karaoke publishing.

> [card] [Dialogue Separation](https://developer.audioshake.ai/remove-dialogue-for-dubbing.md)
>
> Separate speech from music and effects for post-production.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.