---
title: "Deploy Chatterbox | (Just Updated) Text-to-Speech API, OpenAI-Compatible, Voice Cloning, API Key Pre-Set"
description: "Chatterbox text-to-speech API: OpenAI-compatible TTS, voice cloning, CPU"
category: "AI/ML"
url: https://railway.com/deploy/chatterbox-or-just-updated-text-to-speec
---

# Deploy Chatterbox | (Just Updated) Text-to-Speech API, OpenAI-Compatible, Voice Cloning, API Key Pre-Set

Chatterbox text-to-speech API: OpenAI-compatible TTS, voice cloning, CPU

**[Deploy Chatterbox | (Just Updated) Text-to-Speech API, OpenAI-Compatible, Voice Cloning, API Key Pre-Set on Railway](https://railway.com/template/chatterbox-or-just-updated-text-to-speec)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/chatterbox-or-just-updated-text-to-speec/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** AI/ML

## Template content

### chatterbox

- **Image:** ghcr.io/bon5co/chatterbox-railway:1.0.0@sha256:3d01c815d5d579970e87441297d9760e83b2117189348731b52828a948ee57d4
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Chatterbox (Text-to-Speech API) on Railway

A text-to-speech API turns written text into spoken audio, and a voice-cloning one can do it in the voice of a short reference clip. This template serves the Chatterbox models from Resemble AI (the `resemble-ai/chatterbox` project) on CPU behind one authenticated, OpenAI-compatible HTTP API. The weights are inside the image, an API key is generated at deploy, and no GPU is needed.

## About Hosting Chatterbox

The service runs three Chatterbox checkpoints with PyTorch behind a small FastAPI server. `chatterbox-turbo` (350M parameters, English, the default) and `chatterbox-nano` (110M, English, the quickest) understand the tags `[laugh]`, `[chuckle]` and `[cough]` written inline in the text. `chatterbox-multilingual` speaks 23 languages (Arabic, Danish, German, Greek, English, Spanish, Finnish, French, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Dutch, Norwegian, Polish, Portuguese, Russian, Swedish, Swahili, Turkish and Chinese). Output is 24 kHz mono.

`POST /v1/audio/speech` takes JSON with `input`, `model`, `response_format` (`wav`, `mp3`, `flac` or `pcm`), `language`, `temperature` and `seed`, in the shape of the OpenAI speech endpoint, so an OpenAI client pointed at your URL works; `tts-1` and `tts-1-hd` map to the default model and `voice` is ignored. `POST /v1/audio/clone` takes multipart form data with a `reference` audio file (up to 10 MiB) and speaks in that voice; nothing is stored. `GET /v1/models` lists models, languages and limits. Reply headers `X-Realtime-Factor`, `X-Processing-Seconds`, `X-Audio-Seconds` and `X-Model` report what was done.

The weights of all three models are in the image, so nothing downloads at boot. The default model loads before `/health` answers 200 (503 until then), about 21 seconds on Railway. One model stays in memory: the first request for another model loads it (3 to 7 seconds) and drops the previous one. One synthesis runs at a time and up to 3 requests may wait; a fourth answers `429` with `Retry-After: 30`. A request that cannot finish within 240 seconds answers `504` before Railway's edge cuts the connection at about five minutes. Input over 2,000 characters answers `413`. Text and audio are never logged or written to disk.

**Measured on Railway, 8 vCPU**, from the `X-Realtime-Factor` header over the public URL with the model loaded (synthesis seconds divided by audio seconds, so under 1 is faster than playback):

| Model | Input | Audio | Seconds | Factor |
|---|---|---|---|---|
| `chatterbox-turbo` | one sentence | 2.7 s | 5.4 | 2.0 |
| `chatterbox-turbo` | five sentences | 14.9 s | 26.3 | 1.76 |
| `chatterbox-nano` | five sentences | 12.0 to 12.5 s | 9.0 to 9.2 | 0.74 |
| `chatterbox-multilingual` (French) | one sentence | 2.9 s | 9.3 | 3.2 |

The default model takes about twice as long as the speech it makes; pick Nano when the answer must arrive faster than it plays. Memory was 3.6 GB after boot (6.2 GB peak at start); after all three models had been used in turn the peak was 8.8 GB, so give the service 10 GB of RAM if you switch models, about 8 GB if you stay on one.

**Limits.** No GPU, no streaming, no batch endpoint. Output differs run to run unless you pass a `seed`. Check names, numbers and mixed-language text before relying on it.

**Licence.** The Chatterbox repository is MIT, "Copyright (c) 2025 Resemble AI", granting permission "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software". The three Hugging Face repositories this template downloads (`ResembleAI/chatterbox-turbo`, `ResembleAI/chatterbox-nano`, `ResembleAI/chatterbox`) declare `license: mit` and are not gated (read 2026-11-24). Upstream says the project is retired (August 2026), so expect no upstream fixes; the image is built from commit `ab55923`, which carries Nano and is newer than both the PyPI and GitHub releases. Licence texts ship in the image at `/licenses/`.

**Watermark and consent.** Every output carries Resemble's Perth implicit watermark; this template does not remove it. The clone endpoint copies whatever voice you upload: only clone a voice you have permission to use.

### Agent contract

- Public URL: `https://RAILWAY_PUBLIC_DOMAIN` (the generated domain of the `chatterbox` service)
- Private URL: `http://chatterbox.railway.internal:8080`
- Credentials: the `API_KEY` variable of the `chatterbox` service
- Auth: `Authorization: Bearer $API_KEY` on every route except `GET /health`; no key or a wrong key answers `401`
- Health: `GET /health` returns 200 once the default model is loaded (503 while loading, 20 to 40 seconds)

```bash
# needs: RAILWAY_PUBLIC_DOMAIN, API_KEY (variables of the chatterbox service), curl
# signup: none - the API has no user accounts, only the API_KEY bearer
R="https://$RAILWAY_PUBLIC_DOMAIN"
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/health")" = 200 ]; do n=$((n+1)); [ "$n" -le 60 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/health"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -X POST "$R/v1/audio/speech" -H "Content-Type: application/json" -d '{"input":"Hello from Railway."}'
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -X POST "$R/v1/audio/speech" -H "Authorization: Bearer not-the-key" -H "Content-Type: application/json" -d '{"input":"Hello from Railway."}'
curl -s -D - -o /tmp/hello.wav -X POST "$R/v1/audio/speech" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{"input":"Hello from Railway."}' | grep -iE "^(HTTP|x-model|x-sample-rate)"
head -c 4 /tmp/hello.wav; echo
```

A fresh deploy prints `health: 200`, `write without key: 401`, `write wrong key: 401`, `200` with `x-model: chatterbox-turbo` and `x-sample-rate: 24000`, and `RIFF`, the start of a WAV file. Other model or format: `{"input":"Bonjour.","model":"chatterbox-multilingual","language":"fr","response_format":"mp3"}`. Clone: `curl -X POST "$R/v1/audio/clone" -H "Authorization: Bearer $API_KEY" -F input="Text." -F reference=@clip.wav -o out.wav`. Bad model, format, language or empty input answers `422`. The API never fetches a URL.

## Why Deploy Chatterbox on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Chatterbox on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

- **Scripts and voice clips stay in your container**, not in a hosted voice service.
- **No GPU bill and no per-character fee**; you pay for the container.
- **Drops into OpenAI client code**: change the base URL and key.
- **Three models behind one parameter**: default English, fast Nano, or 23 languages.
- **Nothing to configure**: weights in the image, API key generated at deploy.
- **Busy means `429`, slow means `504`**, never a hung request.

## Common Use Cases

- **Voice for AI agents**: a spoken reply over plain HTTP, with Nano for quick answers.
- **Narration**: articles, release notes or course text as audio in 23 languages.
- **Cloned brand or character voice** for videos, games or phone prompts, with the speaker's permission.

## Dependencies for Chatterbox Hosting

- A service with at least 8 GB of RAM (10 GB if you use more than one model) and 8 vCPU for the speeds above.
- No volume: the service keeps no state.

### Deployment Dependencies

- [resemble-ai/chatterbox](https://github.com/resemble-ai/chatterbox): models and inference code, MIT, commit `ab55923`
- [ResembleAI/chatterbox-turbo](https://huggingface.co/ResembleAI/chatterbox-turbo), [chatterbox-nano](https://huggingface.co/ResembleAI/chatterbox-nano), [chatterbox](https://huggingface.co/ResembleAI/chatterbox): weights, MIT
- [resemble-ai/Perth](https://github.com/resemble-ai/Perth): the watermarker applied to every output
- [bon5co/chatterbox-railway](https://github.com/bon5co/chatterbox-railway): the wrapper image this template deploys, Apache-2.0


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/chatterbox-or-just-updated-text-to-speec
