经 AI Skill Hub 精选评估,chatterbox-tts-api — AI 语音合成工具中文文档 获评「推荐使用」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
使用 Chatterbox 实现的本地 OpenAI 兼容文本到语音 API,支持用户在 OpenAI API 使用场景中生成语音克隆语音
chatterbox-tts-api — AI 语音合成工具中文文档 是一款基于 Python 开发的开源工具,专注于 ai、chatgpt、chatterbox 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
使用 Chatterbox 实现的本地 OpenAI 兼容文本到语音 API,支持用户在 OpenAI API 使用场景中生成语音克隆语音
chatterbox-tts-api — AI 语音合成工具中文文档 是一款基于 Python 开发的开源工具,专注于 ai、chatgpt、chatterbox 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install chatterbox-tts-api
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install chatterbox-tts-api
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/travisvn/chatterbox-tts-api
cd chatterbox-tts-api
pip install -e .
# 验证安装
python -c "import chatterbox_tts_api; print('安装成功')"
# 命令行使用
chatterbox-tts-api --help
# 基本用法
chatterbox-tts-api input_file -o output_file
# Python 代码中调用
import chatterbox_tts_api
# 示例
result = chatterbox_tts_api.process("input")
print(result)
# chatterbox-tts-api 配置文件示例(config.yml) app: name: "chatterbox-tts-api" debug: false log_level: "INFO" # 运行时指定配置文件 chatterbox-tts-api --config config.yml # 或通过环境变量配置 export CHATTERBOX_TTS_API_API_KEY="your-key" export CHATTERBOX_TTS_API_OUTPUT_DIR="./output"
<p align="center"> <img src="https://lm17s1uz51.ufs.sh/f/EsgO8cDHBTOU5bjcd6giJaPhnlpTZysr24u6k9WGqwIjNgQo" alt="Chatterbox API TTS header"> </p>
🚀 OpenAI-Compatible API - Drop-in replacement for OpenAI's TTS API ⚡ FastAPI Performance - High-performance async API with automatic documentation 🌍 Multilingual Support - Generate speech in 22 languages with language-aware voice cloning 🎨 React Frontend - Includes an optional, ready-to-use web interface 🎭 Voice Cloning - Use your own voice samples for personalized speech 🎤 Voice Library Management - Upload, manage, and use custom voices by name 📝 Smart Text Processing - Automatic chunking for long texts 📊 Real-time Status - Monitor TTS progress, statistics, and request history 🐳 Docker Ready - Full containerization with persistent voice storage ⚙️ Configurable - Extensive environment variable configuration 🎛️ Parameter Control - Real-time adjustment of speech characteristics 📚 Auto Documentation - Interactive API docs at /docs and /redoc 🔧 Type Safety - Full Pydantic validation for requests and responses 🧠 Memory Management - Advanced memory monitoring and automatic cleanup
[!NOTE] Support for Chatterbox Turbo coming soon
[!IMPORTANT]resemble-ai/chatterboxis currently broken for non-CUDA setups (see chatterbox issues) Revert to non-multilingual by using thestablebranch of this repo View more instructions
USE_MULTILINGUAL_MODEL environment variableuv sync
pip install -r requirements.txt
Supported Formats:
Requirements:
uv sync uv run uvicorn app.main:app --host 0.0.0.0 --port 4123
**For local development**, install PyTorch with CUDA support:
bash
uv sync --group test
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
python -m venv .venv source .venv/bin/activate
```bash
git clone https://github.com/travisvn/chatterbox-tts-api cd chatterbox-tts-api
cp .env.example.docker .env # Docker-specific paths, ready to use
```bash
docker compose -f docker/docker-compose.gpu.yml --profile frontend up -d # GPU + Frontend docker compose -f docker/docker-compose.uv.yml --profile frontend up -d # uv + Frontend docker compose -f docker/docker-compose.cpu.yml --profile frontend up -d # CPU + Frontend ```
Build the frontend for production deployment:
cd frontend && npm install && npm run build
You can then access it directly from your local file system at /dist/index.html.
cp .env.example.docker .env
Key environment variables (see the example files for full list):
| Variable | Default | Description |
| ------------------------ | -------------------- | ------------------------------ |
| `PORT` | `4123` | API server port |
| `USE_MULTILINGUAL_MODEL` | `true` | Enable 23-language support |
| `EXAGGERATION` | `0.5` | Emotion intensity (0.25-2.0) |
| `CFG_WEIGHT` | `0.5` | Pace control (0.0-1.0) |
| `TEMPERATURE` | `0.8` | Sampling randomness (0.05-5.0) |
| `VOICE_SAMPLE_PATH` | `./voice-sample.mp3` | Voice sample for cloning |
| `DEVICE` | `auto` | Device (auto/cuda/mps/cpu) |
<details>
<summary><strong>🎭 Voice Cloning</strong></summary>
Replace the default voice sample:
bash
docker compose -f docker/docker-compose.yml up -d ```
docker compose -f docker/docker-compose.gpu.yml up -d ```
</details>
<details> <summary><strong>📚 API Reference</strong></summary>
docker compose -f docker/docker-compose.yml up -d
docker compose -f docker/docker-compose.gpu.yml up -d
docker compose -f docker/docker-compose.uv.gpu.yml up -d
docker compose -f docker/docker-compose.cpu.yml up -d
docker volume rm chatterbox-tts-api_chatterbox-models docker compose -f docker/docker-compose.yml up -d --build
uvicorn --version
python start.py fullstack
pip install -e .
git clone https://github.com/travisvn/chatterbox-tts-api
cd chatterbox-tts-api
uv sync
uv run main.py
[!TIP] uv installed with curl -LsSf https://astral.sh/uv/install.sh | sh
```bash
```bash
```python import requests
```python import requests import json import base64
```bash
🖼️ View screenshot of full frontend web UI — light mode / dark mode
cp your-voice.mp3 voice-sample.mp3
cp .env.example .env
cp .env.example .env
http://localhost:4123 (direct API access)http://localhost:4321, API requests routed via proxyThe frontend uses a reverse proxy to route requests, so when running with --profile frontend, the web interface will be available at http://localhost:4321 while the API runs behind the proxy.
</details>
The project provides two environment example files:
.env.example - For local development (uses ./models, ./voice-sample.mp3).env.example.docker - For Docker deployment (uses /cache, /app/voice-sample.mp3)Choose the appropriate one for your setup:
```bash
cp .env.example.docker .env nano .env # Set production values
| Variable | Default | Description |
|---|---|---|
MEMORY_CLEANUP_INTERVAL | 5 | Cleanup memory every N requests |
CUDA_CACHE_CLEAR_INTERVAL | 3 | Clear CUDA cache every N requests |
ENABLE_MEMORY_MONITORING | true | Enable detailed memory logging |
<p align="center"> <a href="https://github.com/travisvn/chatterbox-tts-api"> <img src="https://img.shields.io/github/stars/travisvn/chatterbox-tts-api?style=social" alt="GitHub stars"></a> <a href="https://github.com/travisvn/chatterbox-tts-api"> <img alt="GitHub forks" src="https://img.shields.io/github/forks/travisvn/chatterbox-tts-api"></a> <a href="https://github.com/travisvn/chatterbox-tts-api/issues"> <img src="https://img.shields.io/github/issues/travisvn/chatterbox-tts-api" alt="GitHub issues"></a> <img src="https://img.shields.io/github/last-commit/travisvn/chatterbox-tts-api?color=red" alt="GitHub last commit"> <a href="http://chatterboxtts.com/discord"> <img src="https://img.shields.io/badge/Discord-Voice_AI_%26_TTS_Tools-blue?logo=discord&logoColor=white" alt="Discord"> </a> </p>
FastAPI-powered REST API for Chatterbox TTS, providing OpenAI-compatible text-to-speech endpoints with voice cloning capabilities and additional features on top of the chatterbox-tts base package.
uv run uvicorn app.main:app --host 0.0.0.0 --port 4123
uvicorn app.main:app --host 0.0.0.0 --port 4123
docker compose -f docker/docker-compose.yml up -d # Standard (pip-based) docker compose -f docker/docker-compose.uv.yml up -d # uv-optimized (faster builds) docker compose -f docker/docker-compose.gpu.yml up -d # Standard + GPU docker compose -f docker/docker-compose.uv.gpu.yml up -d # uv + GPU (recommended for GPU users) docker compose -f docker/docker-compose.cpu.yml up -d # CPU-only docker compose -f docker/docker-compose.blackwell.yml up -d # Blackwell (50XX) NVIDIA GPUs
docker compose -f docker/docker-compose.yml --profile frontend up -d # Standard + Frontend docker compose -f docker/docker-compose.gpu.yml --profile frontend up -d # GPU + Frontend docker compose -f docker/docker-compose.uv.gpu.yml --profile frontend up -d # uv + GPU + Frontend docker compose -f docker/docker-compose.blackwell.yml --profile frontend up -d # (Blackwell) uv + GPU + Frontend
curl -X POST http://localhost:4123/v1/audio/speech \ -H "Content-Type: application/json" \ -d '{"input": "Hello from Chatterbox TTS!"}' \ --output test.wav ```
<details> <summary><strong>🚀 Running with the Web UI (Full Stack)</strong></summary>
This project includes an optional React-based web UI. Use Docker Compose profiles to easily opt in or out of the frontend:
docker compose -f docker/docker-compose.yml up -d
docker compose -f docker/docker-compose.yml --profile frontend up -d
For comprehensive streaming features including:
Key Benefits:
<details> <summary><strong>🐍 Python Examples</strong></summary>
import requests
response = requests.post(
"http://localhost:4123/v1/audio/speech/upload",
data={
"input": "Hello world!",
"exaggeration": 0.8
}
)
with open("output.wav", "wb") as f:
f.write(response.content)
| Endpoint | Method | Description |
|---|---|---|
/audio/speech | POST | Generate speech from text (complete) |
/audio/speech/upload | POST | Generate speech with voice upload |
/audio/speech/stream | POST | **Stream** speech generation ([docs](docs/STREAMING_API.md)) |
/audio/speech/stream/upload | POST | **Stream** speech with voice upload ([docs](docs/STREAMING_API.md)) |
/voices | GET | List voices in library (with language metadata) |
/voices | POST | Upload voice to library (with language support) |
/languages | GET | **Get supported languages** ([docs](docs/MULTILINGUAL.md)) |
/health | GET | Health check and status |
/config | GET | Current configuration |
/v1/models | GET | Available models (OpenAI compat) |
/status | GET | TTS processing status & progress |
/status/progress | GET | Real-time progress (lightweight) |
/status/statistics | GET | Processing statistics |
/status/history | GET | Recent request history |
/info | GET | Complete API information |
/docs | GET | Interactive API documentation |
/redoc | GET | Alternative API documentation |
```bash
curl "http://localhost:4123/info"
**Status Response Example:**
json { "is_processing": true, "status": "generating_audio", "current_step": "Generating audio for chunk 2/4", "current_chunk": 2, "total_chunks": 4, "progress_percentage": 50.0, "duration_seconds": 2.5, "text_preview": "Your text being processed..." } ```
See Status API Documentation for complete details.
uvicorn app.main:app --host 0.0.0.0 --port 4123 --reload
python tests/test_api.py # or: uv run tests/test_api.py
curl http://localhost:4123/health
curl http://localhost:4123/openapi.json ```
--reload flag for development/docs for live API testing</details>
<details> <summary><strong>🤝 Contributing</strong></summary>
</details>
python main.py ```
</details>
<details> <summary><strong>💻 Development</strong></summary>
本项目是 Chatterbox TTS API 的中文文档,提供了项目简介和基本信息。
本项目支持多语种的语音合成,包括 22 种语言,具有语言感知的语音克隆功能,兼容 OpenAI 的 TTS API,具有高性能的异步 API,自动文档生成,支持 React 前端,包括语音克隆功能等。
本项目需要以下环境依赖:Python 3.11,uv,uvicorn,FastAPI,OpenAI 的 TTS API 等,需要安装依赖项,包括 uv,uvicorn,FastAPI 等。
本项目支持多种安装方式,包括使用 uv(推荐),使用 pip,使用 Docker 等,需要安装 uv,uvicorn,FastAPI 等依赖项,配置环境变量等。
本项目的使用方法包括启动 API,使用 API,配置环境变量等,需要了解 API 的使用方法,包括 API 的接口,参数,返回值等。
本项目的配置包括环境变量,MCP,env 等,需要了解这些配置的作用,如何配置等。
本项目的 API 接口包括语音合成,语音克隆等,需要了解 API 的接口,参数,返回值等。
本项目的工作流包括语音合成,语音克隆等,需要了解这些工作流的步骤,如何实现等。
该项目使用 Chatterbox 实现了一个本地 OpenAI 兼容的文本到语音 API,支持语音克隆功能,值得关注
该工具使用 AGPL-3.0 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
⚠️ AGPL 3.0 — 最严格的 Copyleft,网络服务端使用也需开源,SaaS 使用受限。
AI Skill Hub 点评:chatterbox-tts-api — AI 语音合成工具中文文档 的核心功能完整,质量良好。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | chatterbox-tts-api |
| 原始描述 | Local, OpenAI-compatible text-to-speech (TTS) API using Chatterbox, enabling users to generate voice cloned speech anywhere the OpenAI API is used (e.g. Open WebUI, AnythingLLM, etc.) |
| Topics | aichatgptchatterboxcudadockerelevenlabstts |
| GitHub | https://github.com/travisvn/chatterbox-tts-api |
| License | AGPL-3.0 |
| 语言 | Python |
收录时间:2026-05-22 · 更新时间:2026-05-22 · License:AGPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。