Overview
This recipe runshexgrad/Kokoro-82M behind an OpenAI-compatible
text-to-speech API. Send text to the deployment and receive generated audio in formats including MP3, WAV, FLAC, Opus,
AAC, and PCM.
Kokoro is an 82 million parameter open-weight TTS model. Its small size makes it useful for cost-conscious speech
generation such as product narration, voice agents, accessibility features, audio previews, and batch audio workflows.
The server supports more than 50 Kokoro voices and produces 24 kHz audio.
Quick Start
- Open the SaladCloud Portal.
- Deploy the Kokoro TTS API recipe.
- Enter a Container Group Name.
- Decide whether to enable Require Container Gateway Authentication:
- Enabled: requests must include your SaladCloud API key.
- Disabled: anyone with the URL can call the TTS service.
- Deploy and wait until the replica is ready.
Startup downloads and initializes the model. It can take several minutes before the health check passes.
Defaults
The recipe comes preconfigured with these defaults:- Model ID:
hexgrad/Kokoro-82M - Container image:
hwdsl2/kokoro-server:latest - Command equivalent:
python3 -m uvicorn api_server:app --host :: --port 8880 - Container port:
8880 - Default voice:
af_heart - Default speed:
1.0 - Default sample rate: 24 kHz
- Model cache:
/var/lib/kokoro - Readiness and liveness probe:
GET /health - Authentication: enabled by default through the Salad Container Gateway
::, which allows Salad ingress to reach
the API. The container’s own bearer-token authentication is disabled with an empty KOKORO_API_KEY; use the Salad
Container Gateway authentication setting to control public access.
API Endpoints
Useful endpoints include:GET /health- readiness probe and health checkGET /v1/models- model informationGET /v1/voices- available voicesGET /docs- Swagger documentationPOST /v1/audio/speech- generate speech audio from text
Authentication
Require Container Gateway Authentication is available in the deployment form and is enabled by default.- Enabled: every request must include the
Salad-Api-Keyheader. - Disabled: anyone with the deployment URL can call the API.
Example Request
This request generates a WAV file namedkokoro.wav:
Salad-Api-Key header.
The endpoint returns binary audio rather than JSON. For this request, the response has Content-Type: audio/wav. If you
omit response_format, the server returns MP3 audio by default.
The API accepts kokoro, tts-1, or tts-1-hd in the model field. All three values use hexgrad/Kokoro-82M on this
server.
Test A Deployment
Check health:file command should identify kokoro-test.wav as WAV audio. Add the Salad-Api-Key header to each request if
gateway authentication is enabled.
Configuration Notes
- Supported response formats are
mp3,wav,flac,opus,aac, andpcm. - Language codes include
afor American English,bfor British English,efor Spanish,ffor French,hfor Hindi,ifor Italian,jfor Japanese,pfor Brazilian Portuguese, andzfor Mandarin Chinese. Leave the language code blank to infer the pipeline from the selected voice.