Upload a file
Upload a local or private file, then use it in a separation job.
Use this flow when your media is local, private, or not easy to host at a public URL.
1. Ask for an upload URL
curl -X POST https://audiolasso.dev/v1/files \
-H "Authorization: Bearer $AUDIOLASSO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_name": "song.wav",
"content_type": "audio/wav",
"file_size": 12345678,
"purpose": "audio.separate.input"
}'The response includes a temporary upload URL and a file_id:
{
"file_id": "file_01jabc",
"upload_url": "https://...",
"upload_method": "PUT",
"headers": {
"content-type": "audio/wav"
},
"expires_at": "2026-04-25T09:00:00.000Z"
}2. Upload the file
Use the exact upload_url, method, and content-type returned by POST /v1/files.
curl -X PUT "$UPLOAD_URL" \
-H "content-type: audio/wav" \
--data-binary @song.wav3. Submit the job
Submit the uploaded file by passing the returned ID as input.file_id.
curl -X POST https://audiolasso.dev/v1/queue/audio/separate \
-H "Authorization: Bearer $AUDIOLASSO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"file_id": "file_01jabc",
"prompt": "isolate the lead vocal"
}
}'JavaScript example
import { readFile, stat } from "node:fs/promises";
const apiKey = process.env.AUDIOLASSO_API_KEY;
const filePath = "./song.wav";
const fileName = "song.wav";
const contentType = "audio/wav";
const fileSize = (await stat(filePath)).size;
const uploadRes = await fetch("https://audiolasso.dev/v1/files", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
file_name: fileName,
content_type: contentType,
file_size: fileSize,
purpose: "audio.separate.input",
}),
});
if (!uploadRes.ok) throw new Error(await uploadRes.text());
const upload = await uploadRes.json();
const bytes = await readFile(filePath);
const putRes = await fetch(upload.upload_url, {
method: upload.upload_method,
headers: upload.headers,
body: bytes,
});
if (!putRes.ok) throw new Error(`Upload failed: ${putRes.status}`);
const submitRes = await fetch("https://audiolasso.dev/v1/queue/audio/separate", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
input: {
file_id: upload.file_id,
prompt: "isolate the lead vocal",
},
}),
});
console.log(await submitRes.json());Limits
- Maximum uploaded file size: 500 MB
- Upload URLs expire after about 1 hour
- Uploaded input files are temporary
- Use
audio/*,video/*, orapplication/octet-streamcontent types
Retention
Uploads are temporary. Use generated output URLs before their retention window ends.