Quickstart
The simplest way to use AudioLasso: create a key, submit a job, wait for it to finish, and download the result.
AudioLasso lets you pull one sound out of an audio or video file using a plain-English prompt.
The API follows a queue model: submit work, store the returned request_id, poll status, then fetch the result. Streaming and webhooks are optional alternatives for clients that need them.
If you only learn one thing, learn this workflow:
- Create an API key.
- Submit a separation job.
- Wait for the job to finish.
- Download the result files.
1. Create an API key
Open API keys, create a key, and copy it once.
Store it in your shell:
export AUDIOLASSO_API_KEY="al_..."Every API request sends it as a bearer token:
Authorization: Bearer $AUDIOLASSO_API_KEY2. Submit a job
If your file is already hosted at a public HTTPS URL, you can submit it directly with input.audio_url.
curl -X POST https://audiolasso.dev/v1/queue/audio/separate \
-H "Authorization: Bearer $AUDIOLASSO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"audio_url": "https://example.com/audio.wav",
"prompt": "isolate the lead vocal"
}
}'AudioLasso replies immediately with a queued job. Store the request_id if another process needs to check the same job later.
{
"request_id": "req_01jabc",
"status": "IN_QUEUE",
"model": "audio/separate",
"status_url": "https://audiolasso.dev/v1/queue/requests/req_01jabc/status",
"stream_url": "https://audiolasso.dev/v1/queue/requests/req_01jabc/status/stream",
"result_url": "https://audiolasso.dev/v1/queue/requests/req_01jabc/result"
}3. Wait for it to finish
Polling is the canonical wait path:
curl https://audiolasso.dev/v1/queue/requests/req_01jabc/status \
-H "Authorization: Bearer $AUDIOLASSO_API_KEY"You only need to care about four states:
| Status | Meaning |
|---|---|
IN_QUEUE | The request is waiting to start |
IN_PROGRESS | The model job is running |
COMPLETED | Outputs are ready |
FAILED | Processing failed |
4. Download the result
When the job reaches COMPLETED, fetch the signed output URLs:
curl https://audiolasso.dev/v1/queue/requests/req_01jabc/result \
-H "Authorization: Bearer $AUDIOLASSO_API_KEY"{
"request_id": "req_01jabc",
"model": "audio/separate",
"status": "COMPLETED",
"data": {
"target": {
"url": "https://...",
"content_type": "audio/wav",
"file_name": "target.wav"
},
"residual": {
"url": "https://...",
"content_type": "audio/wav",
"file_name": "residual.wav"
},
"sample_rate": 48000
},
"usage": {
"feature": "audio_seconds",
"quantity": 42,
"billing_status": "deducted"
}
}JavaScript example
const apiKey = process.env.AUDIOLASSO_API_KEY;
const submit = await fetch("https://audiolasso.dev/v1/queue/audio/separate", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
input: {
audio_url: "https://example.com/audio.wav",
prompt: "isolate the lead vocal",
},
}),
});
if (!submit.ok) throw new Error(await submit.text());
const job = await submit.json();
while (true) {
const statusRes = await fetch(job.status_url, {
headers: { Authorization: `Bearer ${apiKey}` },
});
const status = await statusRes.json();
if (status.status === "FAILED") throw new Error("Audio separation failed");
if (status.status === "COMPLETED") break;
await new Promise((resolve) => setTimeout(resolve, 3000));
}
const resultRes = await fetch(job.result_url, {
headers: { Authorization: `Bearer ${apiKey}` },
});
const result = await resultRes.json();
console.log(result.data.target.url);
console.log(result.data.residual.url);Python example
import os
import time
import requests
api_key = os.environ["AUDIOLASSO_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}"}
submit = requests.post(
"https://audiolasso.dev/v1/queue/audio/separate",
headers={**headers, "Content-Type": "application/json"},
json={
"input": {
"audio_url": "https://example.com/audio.wav",
"prompt": "isolate the lead vocal",
}
},
)
submit.raise_for_status()
job = submit.json()
while True:
status = requests.get(job["status_url"], headers=headers)
status.raise_for_status()
payload = status.json()
if payload["status"] == "FAILED":
raise RuntimeError("Audio separation failed")
if payload["status"] == "COMPLETED":
break
time.sleep(3)
result = requests.get(job["result_url"], headers=headers)
result.raise_for_status()
data = result.json()
print(data["data"]["target"]["url"])
print(data["data"]["residual"]["url"])Local files
If your file is local or private, upload it first with POST /v1/files, then submit the returned input.file_id.
See Upload a file.