Install and start
Text input needs Python 3.12 for themisaki pronunciation packages. On Python 3.13 or later, send precomputed phonemes. For English, install the spaCy tagger before starting.
kokoro
Text → audio. The default kokoro.yaml uses 1 GPU. The weights use Apache-2.0.
Send a request
Run either client example in a second terminal after/health returns 200.
Synthesize a sentence
Save the synthesized speech asreply.wav.
Python SDK
client.voices() to list names, or mix two with voice="af_bella+af_sky". For voice applications, the LiveKit Agents example and Pipecat example stream PCM from the server through their OpenAI TTS plugins.
curl
Deployment configs
To use an alternative, pass
--config configs/<file> after the launcher name. From a wheel installation, copy the shipped YAML and pass its local path.
Settings and defaults
Request fields (on/v1/audio/speech the non-OpenAI ones go in extra_body):
Install
misaki[ja]>=0.9.4 for Japanese or misaki[zh]>=0.9.4 for Mandarin. Install misaki[en]>=0.9.4 for the English espeak-ng fallback. Without that fallback, Kokoro can skip English words outside its pronunciation dictionary.
Deployment model_kwargs (see the comments in configs/kokoro.yaml):
Limits
- Text input only. An empty
voiceorlang_code, or aspeedoutside 0.25 to 4.0, is a 400. - Text synthesis with a missing G2P package returns HTTP 400.
- Text is cut at sentence boundaries into chunks of at most 510 phonemes, the PL-BERT window.
temperatureandtop_pare ignored: Kokoro does not sample.- With the default
compile_decoder: true, the first start on a GPU compiles the vocoder; see Cold start.