Mansa Platform Docs

TTS

Generate WAV audio from text in a supported language and voice.

POST/v1/audio/speech

Request example

curl --fail-with-body "$MANSA_API_BASE_URL/v1/audio/speech" \
  -H "Authorization: Bearer $MANSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Hello from Mansa",
  "language": "English",
  "voice": "ghanaian_female"
}' \
  --output speech.wav

Output

HTTP/1.1 200 OK
Content-Type: audio/wav

(binary WAV audio; save the response body to speech.wav)

Turn text into spoken audio. Send a language name such as English, then save the WAV body to a file.

Request fields

FieldTypeDefaultDescription
textstringRequiredNonempty text to convert to audio
languagestringRequiredA supported language name such as English, or the matching lowercase slug
voicestringOmittedAn optional supported voice
streambooleanfalseSend audio progressively when true

Voices

Omit voice to use the default. Every supported TTS language accepts male and female. English also accepts:

  • nigerian_male and nigerian_female
  • ghanaian_male and ghanaian_female
  • east_african_male and east_african_female
  • north_african_male and north_african_female
  • south_african_male and south_african_female

Unsupported voice values return invalid_request.

Response

A successful response contains binary WAV audio with Content-Type: audio/wav. Save the response body directly to a .wav file; it is not JSON or base64.

When stream is true, audio bytes arrive progressively. Some audio players require the complete file before playback.

Supported languages

Send the full language name in the language field, such as English or Swahili. Matching lowercase slugs are listed below.

LanguageSlugLanguageSlug
AfrikaansafrikaansAmharicamharic
ArabicarabicBambarabambara
BembabembaBerberberber
ChichewachichewaEnglishenglish
EweeweFonfon
FulafulaHausahausa
IgboigboKanurikanuri
KikuyukikuyuKinyarwandakinyarwanda
KriokrioLingalalingala
LugandalugandaMalagasymalagasy
NdebelendebeleOromooromo
SepedisepediSesothosesotho
ShonashonaSomalisomali
SwahiliswahiliSwatiswati
TigrinyatigrinyaTsongatsonga
TswanatswanaTwitwi
UmbunduumbunduVendavenda
WolofwolofXhosaxhosa
YorubayorubaZuluzulu

Common aliases such as fulani, kiswahili, and tamazight are accepted.

Errors and billing

Before audio begins, failures use the shared JSON error format. If a streamed response is interrupted, treat the audio file as incomplete. TTS is billed according to text length; retrying creates a new billable request.