Kokoro
Self-hosted Kokoro voices over an OpenAI-compatible API, with speed, volume, voice mixing and text normalization.
Kokoro is an open-weight text-to-speech model that you run on your own server. jambonz talks to it through Kokoro-FastAPI’s OpenAI-compatible speech endpoint (POST /v1/audio/speech). Kokoro tuning is passed in synthesizer.options.
You can also set these in the portal under Extra Options on the speech credential, in which case they apply to every request that uses that credential. Settings supplied on the verb take precedence.
Credential
Add a Kokoro speech credential in the portal or API, using the vendor id kokoro. Kokoro is used for text-to-speech only.
There is no default host: the server must be reachable from jambonz. When you save the credential, jambonz checks it by synthesizing a short phrase with the af_heart voice, so that voice must exist on your server.
Voices and languages
Voices live on your server. The portal lists the voices bundled with Kokoro, grouped by language:
Any other voice your server has works too: put its id in voice. Kokoro-FastAPI also accepts a mix of voices, such as af_bella+af_sky.
jambonz does not send synthesizer.language to Kokoro. Kokoro picks the pronunciation language from the first letter of the voice id, which is right for every bundled voice. To force a different one, set lang_code.
jambonz requests Kokoro audio as 16-bit PCM at 24 kHz and resamples it to the call’s rate.
Options
Every option is optional. An option you don’t set is not sent, so the server’s own default applies.
The model sent in each request. Overrides the credential’s model. Kokoro-FastAPI accepts kokoro, tts-1, tts-1-hd and gpt-4o-mini-tts; other hosts may use another name.
Pronunciation language: a (American English), b (British English), e (Spanish), f (French), h (Hindi), i (Italian), j (Japanese), p (Brazilian Portuguese) or z (Mandarin). Leave it out to let the voice decide.
Speaking rate, from 0.25 to 4. 1 is normal speed.
Output volume multiplier, from 0 to 10. 1 leaves the volume unchanged.
Text normalization settings, passed to the server as given. Kokoro-FastAPI accepts the booleans normalize, unit_normalization, url_normalization, email_normalization, optional_pluralization_normalization, phone_normalization, caps_normalization, replace_remaining_symbols and remove_emoji.
Map of alias names to voice ids or mixes, passed to the server as given. A value may be a voice or mix string, or {"voice": "af_bella", "rate": 0.8}.
Allow voice tags in the text to switch voices mid-utterance. The server can disable it with ENABLE_VOICE_TAGS=false.
Treat the text as SSML. Requires allow_voice_tags: true; the server can disable SSML (403) with ENABLE_SSML=false.
Server base URL. Overrides the credential’s API base URL.
API key. Overrides the credential’s API key.
Streaming
Kokoro has no token-streaming websocket, so it does not support TTS streaming: use it for one-shot say, not for say with stream: true or the agent verb.