Skip to content

Speech

POST /v1/audio/speech turns Luganda text into speech and returns WAV audio.

Terminal window
curl https://api.openkob.com/v1/audio/speech \
-H "Authorization: Bearer $OPENKOB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":"Oli otya?","voice":"F2"}' --output speech.wav
Field Type Description
input string Required. 1 to 2,000 characters. Numbers, money, times and common abbreviations are read out in Luganda words.
voice "F2" or "M2" Optional. F2 is a female voice, M2 a male voice. Defaults to F2.
response_format "wav" Optional. Only wav is supported, and it’s the default.

200 with Content-Type: audio/wav: 16-bit PCM mono audio at 24 kHz. The x-audio-duration-ms header gives its length in milliseconds.

Usage is counted in input characters. Audio endpoints share a limit of 10 requests per minute per key.

Speech runs on a server that sleeps when idle. The first request after a quiet period can return 503 inference_unavailable with a Retry-After header while it wakes up. Under heavy load you may get 503 server_busy. Wait for the Retry-After seconds and try again.

Speech uses tiny-voca-lg by Henry Hale, fine-tuned from tiny-voca by Muhammed Nazeem (Apache-2.0), on Luganda recordings from WaxalNLP (Makerere University, Loud and Clear; CC BY-SA 4.0). The weights are licensed CC BY-SA 4.0.