Kooma API
Français API keys Sign up

POST Text to speech

Turns text into natural speech. Choose from the published Bambara voices, or an international voice. Response: an audio file WAV.

POST/v1/audio/speech

Body JSON. Required permission: tts.

Parameters

NameTypeDescription
inputrequiredstringThe text to speak (5,000 characters max).
voiceoptionstringVoice identifier (see Voices). Default modibo.
tgtoptionstringLanguage of the text / voice (see Languages). Default bam_Latn.
srcoptionstringTranslate the text before speaking it: source language, or auto. Default same (no translation).
speedoptionnumberSpeaking rate, from 0.5 to 2.0. Absent = 1.0 (same output as the Studio).
response_formatoptionstringOutput audio format. wav (default, lossless — recommended, same as the Studio) or mp3 (128 kbps mono).

Response

The body is the audio file raw (Content-Type: audio/wav), not JSON. Write it straight to disk.

Billed per character. Custom (cloned) voices are billed at a higher rate.

curl https://api.kooma.ai/v1/audio/speech \
  -H "Authorization: Bearer sk-intermo-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "I ni ce, i ka kɛnɛ wa?",
    "voice": "aminata",
    "tgt": "bam_Latn",
    "speed": 1.0
  }' \
  --output sortie.wav
200 OK audio/wav (binary)
RIFF....WAVEfmt ............   # audio file
402 Insufficient credit
{
  "error": {
    "message": "Insufficient prepaid credits for 'tts'.",
    "type": "insufficient_credits",
    "code": "insufficient_credits"
  }
}
↑↓ navigate↵ openesc close