Clips
Extract audio segments from videos and audio across 16 platforms.
Duration limits
| Free | Pro, Premium |
|---|---|
| 10 seconds per clip | 15 seconds per clip |
sonus.clips.getMetadata({ url })
Get title, duration, and thumbnail for a URL before creating a clip.
| Name | Type | Required | Description |
|---|---|---|---|
url | string | yes | URL from a supported platform |
const { metadata, error } = await sonus.clips.getMetadata({
url: 'https://example.com/episode.mp3',
})
metadata is { title: string, duration: number, thumbnail: string | null }.
sonus.clips.create({ url, start, end, name })
Create an audio clip from a URL. Returns the clip with a direct download link.
| Name | Type | Required | Description |
|---|---|---|---|
url | string | yes | Source URL |
start | number | yes | Start time in seconds |
end | number | yes | End time in seconds |
name | string | yes | Name for the clip |
const { clip, error } = await sonus.clips.create({
url: 'https://example.com/episode.mp3',
start: 43,
end: 53,
name: 'chorus',
})
clip is { id, name, audioKey, audioUrl, duration, sourceUrl, createdAt }.
sonus.clips.list({ cursor?, limit? })
List your clips with cursor-based pagination.
| Name | Type | Required | Description |
|---|---|---|---|
cursor | string | no | Pagination cursor from previous response |
limit | number | no | Items per page (max 100, default 50) |
const { clips, error } = await sonus.clips.list({ limit: 10 })
if (error) throw error
if (clips.nextCursor) {
const page2 = await sonus.clips.list({
cursor: clips.nextCursor,
limit: 10,
})
}
clips is { items: Clip[], nextCursor: string | null }.
sonus.clips.get(id)
Get a single clip by ID.
const { clip, error } = await sonus.clips.get('clip_abc123')
sonus.clips.delete(id)
Delete a clip by ID.
const { ok, error } = await sonus.clips.delete('clip_abc123')
