All projects
FastAPI · Whisper · Kokoro · Docker

Speech In, Speech Out, on a Server You Control

Whisper for transcription and Kokoro for natural voices, behind one API with a key, a queue limit and a cache. Built for work that can take a few seconds, like call recordings, voicemails and voice messages, not live phone conversations.

  • CPU only · no per-minute bill
  • FastAPI
  • faster-whisper
  • Kokoro (ONNX)
  • Docker
How it connects
  1. Recording or text from n8n, the CRM or a phone system
  2. Voice API FastAPI · API key
  3. Speech to text Whisper + noise filter
  4. Text to speech Kokoro voices + cache
  5. Back to the CRM transcript or audio file
Your tools The backend I build Where the data lands
9 Language and accent options for speech output
429 / 503 Clear answers when busy, instead of a pile-up
The case

What Happened

  1. 01

    The test

    A made-up 24-second voicemail and a silent call, sent through an n8n form to the voice API, plus one request with no API key.

  2. 02

    The result

    The voicemail was a note in the Google Sheet 7 seconds later, with its length and audio quality. The silent call saved nothing and pinged the team on Discord instead. The request without a key was turned away.

  3. 03

    The other direction

    A typed reminder came back as a 6.6-second voice message. The same reminder again came straight from the cache.

Reliability

Built to Keep Running, Not Just to Demo

The same rules I check in every health check, and how this system handles them.

Errors

Every error has a clear code and a request ID: bad audio (400), too large (413), busy (429), model unavailable or waited too long (503).

Retries

Callers retry 429 and 503 after a short wait, so a busy moment never loses a request.

Keys

An API key in the header on every request.

Logs

JSON logs for every request, plus timing headers on every response (synthesis time, cache hit).

When Traffic Grows

  • The web server never runs the models itself. Each engine has its own worker threads and a limit on how many calls run at once.
  • Each engine has a short waiting line. When it is full, the API answers 429 straight away instead of running out of memory.
  • Repeated phrases come from a cache without waiting in line. Idle models are unloaded to give memory back.

Keys and Client Data

  • Runs on a private network, so call recordings stay on a server you control instead of a third-party transcription service.
  • Audio is decoded in memory for transcription.
  • Noise and silence are filtered out, so background sound doesn't turn into made-up text.