Skip to main content
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.
const operation = await client.projects.separateStems("prj_abc123", {
  splitModel: "audioshakeai",
});

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

Parameters

projectId
string
required
The project to re-process.
splitModel
SplitModel
Stem separation model. See Split model reference for guidance.

Available models

ValueDescription
mdx23cDefault. Balanced quality and speed.
audioshakeaiHigh-quality AudioShake separation.
audioshake_vocals_leadVocals and lead vocals only.
musicai_instrumental_onlyInstrumental-only output.
musicai_lead_backing_otherLead, backing vocals, and other stems.
musicai_with_backing_vocalsVocals including backing tracks.
musicai_without_backing_vocalsLead vocals only.
uvr_mdxnet_kara_2Karaoke-tuned UVR model.
bs_roformerBS-Roformer model.
mel_band_roformer_instrumental_becruilyMel-band Roformer instrumental.
mel_band_roformer_instrumental_instv7_gaboxAlternative mel-band instrumental.
demucsFacebook Demucs.

End-to-end example

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;
  }
}
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).

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

Download one stem without converting it to another format. Select exactly one stem by ID or type:
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:
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