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

# Stems

> Trigger stem separation tasks on an existing project

Stems are the vocal and instrumental tracks extracted from the source audio. Youka separates stems automatically when you create a project, but you can re-run separation with a different model whenever you need to.

## `client.projects.separateStems(projectId, body, options?)`

Start a new stem separation operation for a project.

```ts theme={null}
const operation = await client.projects.separateStems("prj_abc123", {
  splitModel: "audioshakeai",
});

const { project } = await client.projects.wait(operation);
console.log(project.stems);
```

### Parameters

<ParamField path="projectId" type="string" required>
  The project to re-process.
</ParamField>

<ParamField path="splitModel" type="SplitModel">
  Stem separation model. See [Split model reference](/en/desktop/split-model)
  for guidance.
</ParamField>

### Available models

| Value                                         | Description                            |
| --------------------------------------------- | -------------------------------------- |
| `mdx23c`                                      | Default. Balanced quality and speed.   |
| `audioshakeai`                                | High-quality AudioShake separation.    |
| `audioshake_vocals_lead`                      | Vocals and lead vocals only.           |
| `musicai_instrumental_only`                   | Instrumental-only output.              |
| `musicai_lead_backing_other`                  | Lead, backing vocals, and other stems. |
| `musicai_with_backing_vocals`                 | Vocals including backing tracks.       |
| `musicai_without_backing_vocals`              | Lead vocals only.                      |
| `uvr_mdxnet_kara_2`                           | Karaoke-tuned UVR model.               |
| `bs_roformer`                                 | BS-Roformer model.                     |
| `mel_band_roformer_instrumental_becruily`     | Mel-band Roformer instrumental.        |
| `mel_band_roformer_instrumental_instv7_gabox` | Alternative mel-band instrumental.     |
| `demucs`                                      | Facebook Demucs.                       |

## End-to-end example

```ts theme={null}
import { YoukaClient, YoukaTaskError } from "@youka/sdk";

const client = new YoukaClient({ apiKey: process.env.YOUKA_API_KEY! });

async function reRunStems(projectId: string) {
  const operation = await client.projects.separateStems(projectId, {
    splitModel: "audioshakeai",
  });

  try {
    const { project } = await client.projects.wait(operation);
    console.log("New stems:", project.stems);
  } catch (error) {
    if (error instanceof YoukaTaskError) {
      console.error("Stem separation failed:", error.code, error.message);
      throw error;
    }
    throw error;
  }
}
```

<Tip>
  Use `client.tasks.get(taskId)` or `client.tasks.wait(taskId)` only when you
  explicitly need low-level task access. Most callers should stay on
  `client.projects.wait(operation)`.
</Tip>

## `client.projects.downloadStem(projectId, selector, options?)`

Download one stem without converting it to another format. Select exactly one
stem by ID or type:

```ts theme={null}
await client.projects.downloadStem(
  "prj_abc123",
  { type: "instrumental" },
  { output: "./stems" },
);

await client.projects.downloadStem(
  "prj_abc123",
  { stemId: "stm_abc123" },
  { output: "./stems/original.wav" },
);
```

Supported types are `original`, `instrumental`, `vocals`, and
`backing_vocals`.

## `client.projects.downloadStems(projectId, selector?, options?)`

Download multiple stems. Pass `types`, pass `stemIds`, or omit the selector to
download every available stem:

```ts theme={null}
await client.projects.downloadStems(
  "prj_abc123",
  { types: ["original", "instrumental", "vocals"] },
  { output: "./stems" },
);

await client.projects.downloadStems("prj_abc123", undefined, {
  output: "./stems",
});
```

For multi-stem downloads, use an output directory. The SDK writes the original
stored stem files and does not transcode them.

## What's next

* [Lyrics sync](/en/sdk/lyrics-sync) — re-sync lyrics after swapping stems
* [Tasks](/en/sdk/tasks) — operation handles and advanced task polling
* [Split model reference](/en/desktop/split-model) — pick the right model
