SpeakCrate

Private, local text-to-speech

SpeakCrate

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.

View on GitHub

Open source · MIT licensed

Try in Google Colab No local installation. Runs in Google's environment.

Get the book on Amazon

The Self-Hosted AI Builder's Guide Practical guidance for deployment, security, backups, and everyday operation.

Your words → spoken audio

Ready to listen.
Ready to build with.

TEXT INPUT

Hello! This is SpeakCrate. Turn your words into speech on your own server.

VOICE · af_heart

American English → speech.mp3

  • MP3
  • WAV
  • FLAC
  • Opus
  • AAC
  • PCM
Illustrative request. Generate and listen to speech in the Colab demo.

A focused API for your voice applications

From text to speech, on your server.

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.

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

Run locally.
Make your first request.

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.

  • Docker on a supported Linux host
  • At least 1.5 GB of available RAM
  • Internet access for the first model and voice downloads, unless pre-cached

Need NVIDIA acceleration, another voice, streaming, or remote access?

Full setup guide on GitHub

Use HTTPS and authentication when exposing the API to other computers.

  1. Start SpeakCrate

    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”.

  2. Retrieve your API key

    speak_api_key="$(docker exec kokoro kokoro_manage --getkey)"

    Fresh installs automatically generate and save an API key.

  3. Generate your first audio file

    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

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 Stack

Need speech-to-text?

A companion for transcription

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 ScribeCrate

Before you deploy

Is SpeakCrate free to use?

The 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.

Can I generate speech on this website?

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.

What does OpenAI-compatible mean here?

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.

Do I need an NVIDIA GPU?

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.

How does audio streaming work?

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.

Can it run entirely offline?

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