Text to Speech

Generate speech from text.

Voice clones — your own cloned voices. Pass a voice clone ID as voiceId.

Library voices — ready-made voices from the shared library. Pass a library voice ID as referenceId.

Character limits
FreePro, Premium
200 characters per generation500 characters per generation

sonus.tts.generate({ text, voiceId | referenceId, ... })

Generate speech from text. Returns a sound object with a direct download link.

NameTypeRequiredDescription
textstringyesText to convert to speech
voiceIdstringnoID of a voice clone you own
referenceIdstringnoID of a voice from the shared library
namestringnoName for the generated sound
With a voice clone
const { sound, error } = await sonus.tts.generate({
  text: 'Hello in my cloned voice!',
  voiceId: 'your_clone_id',
})
With a library voice
const { sound, error } = await sonus.tts.generate({
  text: 'Welcome to SonusLab!',
  referenceId: 'library_voice_id',
})

sound is { id, name, audioKey, audioUrl }.

sonus.tts.listVoices({ search, language, pageSize })

Browse voices in the shared library.

NameTypeRequiredDescription
searchstringnoFilter library voices by title
languagestringnoFilter by language code
pageSizenumbernoResults per page, 1–50 (default: 20)
const { voices, error } = await sonus.tts.listVoices({ search: 'narration' })

Voice is { id, name, description, previewUrl, languages, tags }.

Copyright © 2026