API and MCP
One queue, two clients. The REST API is for scripts and pipelines; the MCP server is the same service for models and agents.
Authentication
Bearer keys, issued in the console. Format
tts1_<prefix>.<secret>; only a SHA-256 of the
secret is stored, so a lost key is replaced, never recovered. Scopes:
speak (speak, transcribe, read own jobs) and
admin.
Authorization: Bearer tts1_ab12cd34.<secret>
Rate limit: 30 requests per minute per key. Queue cap 40 jobs. Maximum text 5000 characters.
REST
| Method | Path | Auth | Does |
|---|---|---|---|
| GET | /api/v1/health | none | Worker state and queue depth. |
| GET | /api/v1/voices | none | Voices, engines, tiers, default. |
| POST | /api/v1/speak | speak | Queue a speech job, returns an id. |
| POST | /api/v1/transcribe | speak | Queue a transcription (multipart audio). |
| GET | /api/v1/jobs/<id> | speak | Status, error, audio URL, transcript. |
| GET | /clips/<id>.wav | none | The rendered clip. |
Speak
curl -s https://tts.kituwa.com/api/v1/speak \
-H "Authorization: Bearer $TTS_KEY" -H "Content-Type: application/json" \
-d '{"text":"The lake was flat as glass that morning.",
"voice":"af_heart","tier":1,"format":"mp3"}'
# 202
# {"id":"Xq3...","status":"queued","poll":"/api/v1/jobs/Xq3..."}
curl -s https://tts.kituwa.com/api/v1/jobs/Xq3... \
-H "Authorization: Bearer $TTS_KEY"
# {"id":"Xq3...","status":"done","voice":"af_heart","tier":1,
# "seconds":4.2,"url":"https://tts.kituwa.com/clips/Xq3....mp3"}
Fields: text (required), engine
(kokoro, espeak,
flite), voice (see
/api/v1/voices), tier 1–4,
format wav or
mp3.
Transcribe
curl -s https://tts.kituwa.com/api/v1/transcribe \
-H "Authorization: Bearer $TTS_KEY" \
-F audio=@recording.wav
# 202 {"id":"...","status":"queued"}
# later: {"status":"done","text":"…"}
Statuses and errors
queued → running → done | failed. 400 validation, 401 key, 403 scope, 404 unknown job, 409 job already finished, 413 too large, 429 rate limit or full queue, 502 upstream.
A job that is still queued when the worker
is offline is not lost: it waits, and the console shows the worker state.
MCP
Streamable HTTP at https://tts.kituwa.com/mcp, same
Bearer key, same queue. Published in the estate registry at
mcp.kituwa.com.
| Tool | Does |
|---|---|
| list_voices | Engines, voices, tiers and the default. |
| speak | Queue speech; returns the job id and poll path. |
| job_status | Status, audio URL or transcript. |
| transcribe_url | Queue a transcription for an audio URL the worker can fetch. |
{"mcpServers": {
"tts-kituwa": {
"type": "http",
"url": "https://tts.kituwa.com/mcp",
"headers": {"Authorization": "Bearer tts1_…"}
}
}}
Limits and behaviour
- Audio is published under
/clips/by unguessable id; do not treat a clip URL as private. - Tier 4 renders take minutes because they audition takes; Tier 1 is seconds.
- Nothing is sent to a hosted provider unless the owner names that provider for the job.
- The worker is trinity. If trinity is down the site stays up, jobs queue, and the watchdog says so.