bun add sonuslab
npm install sonuslab
pnpm add sonuslab
Quick example
import { SonusLab } from 'sonuslab'
const sonus = new SonusLab('sl_live_...')
const { clip, error } = await sonus.clips.create({
url: 'https://example.com/episode.mp3',
start: 0,
end: 10,
name: 'intro',
})
if (error) throw error
console.log(clip.audioUrl)
clip is a Clip: id, name, audioKey, audioUrl, duration, sourceUrl, createdAt.
Authentication
All requests require an API key. Generate one from your dashboard.
import { SonusLab } from 'sonuslab'
const sonus = new SonusLab('sl_live_...')
const client = new SonusLab({
apiKey: 'sl_live_...',
baseUrl: 'https://api.sonuslab.dev',
})
Keys start with
sl_live_ and are shown only once at creation. Store them securely — you can't retrieve a key after it's been created.