AudioLasso

TypeScript SDK

Use the AudioLasso TypeScript SDK for the core workflow with fewer raw HTTP calls.

The TypeScript SDK wraps the same HTTP API shown in the rest of the docs.

Use it if you want a simpler developer workflow in Node.js, scripts, backends, or agent tools.

Install

Install from npm:

npm install audiolasso

Create a client

import { createAudioLasso } from "audiolasso";

const client = createAudioLasso({
  apiKey: process.env.AUDIOLASSO_API_KEY,
});

Simplest workflow

const job = await client.separate({
  audioUrl: "https://example.com/audio.wav",
  prompt: "isolate the lead vocal",
});

const result = await client.waitForResult(job.request_id, {
  logs: true,
});

console.log(result.data.target.url);
console.log(result.data.residual.url);

Upload a local file

const upload = await client.uploadFile("./song.wav");

const job = await client.separate({
  fileId: upload.file_id,
  prompt: "separate the piano",
});

const result = await client.waitForResult(job.request_id);

Flat methods

The flat methods are the easiest ones to learn first:

  • client.separate(...)
  • client.getStatus(...)
  • client.getResult(...)
  • client.waitForResult(...)
  • client.createUpload(...)
  • client.uploadFile(...)
  • client.getFile(...)
  • client.listModels()

Namespaced methods

If you prefer grouping by area, the same client also exposes:

  • client.audio.separate(...)
  • client.queue.status(...)
  • client.queue.result(...)
  • client.queue.waitForResult(...)
  • client.queue.streamStatus(...)
  • client.files.createUpload(...)
  • client.files.upload(...)
  • client.files.get(...)
  • client.models.list()

When to use the SDK vs raw HTTP

Use the SDK when:

  • you are writing TypeScript or Node.js
  • you want fewer raw endpoint strings in application code
  • you want upload helpers for local files

Use raw HTTP when:

  • you are working in another language
  • you need exact wire-level control
  • you are debugging requests against the API reference

On this page