Part of a larger toolkit
Build your Self-Hosted AI Stack
SpeakCrate is also available as part of Self-Hosted AI Stack. Deploy local models, chat, document processing, voice, and AI tools together with a single command.
Explore Self-Hosted AI StackPrivate, local text-to-speech
Open-source, self-hosted text-to-speech API.
Turn text into speech for narration, read-aloud tools, and voice-enabled applications on your own hardware. An OpenAI-compatible API, powered by Kokoro. Deploy with Docker on CPU or an NVIDIA GPU.
Open source · MIT licensed
Try in Google Colab No local installation. Runs in Google's environment.
The Self-Hosted AI Builder's Guide Practical guidance for deployment, security, backups, and everyday operation.
Your words → spoken audio
Hello! This is SpeakCrate. Turn your words into speech on your own server.
American English → speech.mp3
A focused API for your voice applications
Build narration, read-aloud features, and speech output for your applications. Choose a voice, adjust the speed, and receive audio through an API you can integrate into your existing tools.
Generate audio through POST /v1/audio/speech.
Use compatible SDKs and apps with Kokoro voice IDs or familiar
OpenAI voice-name aliases.
Text is processed and speech is generated on your server. An OpenAI account or API key is not needed.
Choose from 54 voices across nine language options, including American and British English, Japanese, Mandarin Chinese, Spanish, French, Hindi, Italian, and Brazilian Portuguese.
Choose MP3, WAV, FLAC, Opus, AAC, or PCM output. Stream audio as sentences are synthesized, using audio bytes or Server-Sent Events.
Run on amd64 or arm64 CPUs, or use the
:cuda image for NVIDIA acceleration on amd64.
A GPU is optional.
Keep downloaded models across restarts. Run offline with the required
model and voice files cached in advance and KOKORO_LOCAL_ONLY
enabled.
Images are automatically built and published through public GitHub Actions workflows. Powered by Kokoro. The project is MIT licensed; Kokoro and other dependencies retain their own licenses.
Start with a sentence
Prefer to try it first? Open the Google Colab demo and select Runtime → Run all to generate and play sample speech.
This example runs SpeakCrate on CPU and makes the API accessible only from the Docker host.
Need NVIDIA acceleration, another voice, streaming, or remote access?
Use HTTPS and authentication when exposing the API to other computers.
docker run \
--name kokoro \
--restart=always \
-v kokoro-data:/var/lib/kokoro \
-p 127.0.0.1:8880:8880 \
-d hwdsl2/kokoro-server
The Kokoro model (about 320 MB) downloads on first start.
Run docker logs kokoro and wait for
“SpeakCrate text-to-speech server is ready”.
speak_api_key="$(docker exec kokoro kokoro_manage --getkey)"
Fresh installs automatically generate and save an API key.
Run in the same shell, then open speech.mp3 in your audio player:
curl --fail --show-error http://127.0.0.1:8880/v1/audio/speech \
-H "Authorization: Bearer $speak_api_key" \
-H "Content-Type: application/json" \
-d '{"model":"tts-1","input":"Hello! This is SpeakCrate. Turn your words into speech on your own server.","voice":"af_heart"}' \
--output speech.mp3
Edit input to use your own text, or choose a different
voice.
Part of a larger toolkit
SpeakCrate is also available as part of Self-Hosted AI Stack. Deploy local models, chat, document processing, voice, and AI tools together with a single command.
Explore Self-Hosted AI StackNeed speech-to-text?
ScribeCrate transcribes recordings, generates subtitles, and translates speech into English using Whisper models. Deploy it separately to add audio input alongside SpeakCrate's speech output.
Explore ScribeCrateThe SpeakCrate project is open source under the MIT License. You provide the hardware or cloud server and pay any associated costs. Kokoro is Apache 2.0 licensed; other bundled dependencies retain their own licenses.
No. This website provides information and setup instructions. Deploy SpeakCrate on your own hardware to generate speech. An optional Colab demo runs in Google's environment and is subject to its data practices.
SpeakCrate implements a speech endpoint for compatible OpenAI SDKs and apps. It uses Kokoro locally, with no OpenAI account or key required. OpenAI voice-name aliases map to Kokoro voices, not the original OpenAI voices. It does not implement every OpenAI audio option; for example, voice instructions are accepted but ignored. See the API documentation.
No. The default image runs on CPU on amd64 and arm64
with at least 1.5 GB of available RAM. The optional :cuda image
supports NVIDIA acceleration on amd64. See the
GPU requirements.
Set stream_format to "audio" for streamed audio bytes,
or "sse" for audio chunks delivered as Server-Sent Events.
Audio is sent as each sentence is synthesized; your client handles playback.
See the API reference
for supported formats and request options.
Yes, after caching the model and voice files needed for your chosen voices
and setting KOKORO_LOCAL_ONLY=true. Prepare and test your
selected language setup before disconnecting. See the
offline configuration.
The image also has optional aggregate usage counts; disable those separately
with KOKORO_DISABLE_USAGE_COUNTS=1. See the
usage-count documentation.
Bring your words. Keep control of where they become speech.
View on GitHub