Voice API
APIs for text-to-speech (TTS) and automatic speech recognition (ASR).
The Voice API provides two services: Text-to-Speech (TTS), which converts text into spoken audio, and Automatic Speech Recognition (ASR), which transcribes audio into text.
Common languages are powered by a general large language model. Local languages — including Kinyarwanda, Oshiwambo, Filipino, and Cebuano — are powered by fine-tuned models trained on data collected from native speakers, by Proto and through its partners. These are tailored for citizen engagement, consumer protection, and anti-scam support.
Setting up your account
The Voice API is available to all Proto accounts. No additional setup is required beyond having a workspace.
Billing
Voice API usage is billed in voice credits, separately from interactions.
Cost per request
One credit per successfully processed TTS or ASR request
Starting balance
50 credits for a new workspace
Price
$0.05 per credit, bought in steps of 50 (minimum 100)
Auto top-up
Optionally buys 100 credits automatically when your balance falls below a threshold you set
When credits run out
TTS and ASR requests are rejected with a 403 until the balance is topped up. No credit is deducted for a rejected request — see Errors.
Alerts are emailed to everyone who can view billing when the balance runs low, and a warning appears in the app. Buy credits, set auto top-up, and track usage from the Voice API settings page:
Voice API settingsPlan & billingAuthentication
Every request must include your teamspace takeover secret as a bearer token in the Authorization header.
To find your credentials:
Open teamspace settings
Go to Settings → Workspace → Teamspaces and select the teamspace you want to use.
Local languages
Supported by fine-tuned models trained on data collected from native speakers, optimised for citizen engagement, consumer protection, and anti-scam support.
Kinyarwanda
rw
✓
—
✓
Oshiwambo
kj
✓
—
✓
Filipino
tl
✓
✓
✓
Cebuano
ceb
✓
✓
✓
Urdu
ur
—
—
✓
All supported languages
Common languages are powered by a general large language model. Every language below supports ASR, plus both male and female TTS voices.
Text-to-Speech (TTS)
Convert text into spoken audio.
Headers
Request body
text
Yes
The text to convert to speech. Maximum 5,000 characters.
lang
No
Language code. Defaults to en. See the language tables above.
response_format
No
Output format: mp3 or wav. Defaults to mp3.
speed
No
Playback speed, 0.25–4.0. Defaults to 1.0.
gender
No
Voice gender: male or female. Availability varies by language.
Example request
Response
The API returns a Base64-encoded audio payload — not a downloadable file. Decode it client-side before playing or saving.
Speech Recognition (ASR)
Convert spoken audio into text.
Headers
Request body
file
Yes
The audio file to transcribe. mp3 or wav, max 15 MB.
lang
Yes
Language code
Example request
Response
The API returns the transcribed text extracted from the audio file.
Errors
403
The workspace has run out of voice credits. Top up your balance — see Voice API settings — before making further requests. No credit is deducted for a rejected request.
Workspaces set up for unlimited voice usage (see Billing above) never receive this error, since credit deduction is skipped for them entirely.
Related
Voice API settingsLocal languagesAPIsLast updated