🛠
AI工具

chatterbox-tts-api — AI 语音合成工具中文文档

基于 Python · 开源免费,本地部署,数据完全自主可控
英文名:chatterbox-tts-api
⭐ 599 Stars 🍴 141 Forks 💻 Python 📄 AGPL-3.0 🏷 AI 8.2分
8.2AI 综合评分
aichatgptchatterboxcudadockerelevenlabstts
✦ AI Skill Hub 推荐

经 AI Skill Hub 精选评估,chatterbox-tts-api — AI 语音合成工具中文文档 获评「强烈推荐」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。

📚 深度解析
chatterbox-tts-api — AI 语音合成工具中文文档 是一款基于 Python 的开源工具,在 GitHub 上收获 1k+ Star,是ai、chatgpt、chatterbox、cuda领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
chatterbox-tts-api — AI 语音合成工具中文文档 依赖 Python 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 Python 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 chatterbox-tts-api — AI 语音合成工具中文文档 的版本更新,及时通知重要功能变化。
📋 工具概览

chatterbox-tts-api — AI 语音合成工具中文文档 是一款基于 Python 开发的开源工具,专注于 ai、chatgpt、chatterbox 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 599
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
正常维护,社区驱动
开源协议
AGPL-3.0
AI 综合评分
8.2 分
工具类型
AI工具
Forks
141
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

chatterbox-tts-api — AI 语音合成工具中文文档 是一款基于 Python 开发的开源工具,专注于 ai、chatgpt、chatterbox 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一: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('安装成功')"
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
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"
📑 README 深度解析 真实文档 完整度 92/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

<p align="center"> <img src="https://lm17s1uz51.ufs.sh/f/EsgO8cDHBTOU5bjcd6giJaPhnlpTZysr24u6k9WGqwIjNgQo" alt="Chatterbox API TTS header"> </p>

Features

🚀 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/chatterbox is currently broken for non-CUDA setups (see chatterbox issues) Revert to non-multilingual by using the stable branch of this repo View more instructions

Key Features

  • 🎯 Language Auto-Detection - Voices store language metadata, automatically used in generation
  • 🌐 No API Changes - Maintains OpenAI compatibility, language determined from voice metadata
  • 🔄 Configurable - Enable/disable with USE_MULTILINGUAL_MODEL environment variable
  • 📚 Voice Library Integration - Language badges and filtering in web UI
  • 🧠 Smart Fallback - Defaults to English for backward compatibility

📚 Complete Multilingual Documentation →

Memory Management Features

  • Automatic Cleanup: Periodic garbage collection and tensor cleanup
  • CUDA Memory Management: Automatic GPU cache clearing
  • Memory Monitoring: Real-time memory usage tracking
  • Manual Controls: API endpoints for manual cleanup operations

Install dependencies with uv (automatically creates venv)

uv sync

Install dependencies

pip install -r requirements.txt

Voice File Requirements

Supported Formats:

  • MP3 (.mp3)
  • WAV (.wav)
  • FLAC (.flac)
  • M4A (.m4a)
  • OGG (.ogg)

Requirements:

  • Maximum file size: 10MB
  • Recommended duration: 10-30 seconds of clear speech
  • Avoid background noise for best results
  • Higher quality audio produces better voice cloning

Option 6: Try uv for better dependency resolution

uv sync uv run uvicorn app.main:app --host 0.0.0.0 --port 4123


**For local development**, install PyTorch with CUDA support:
bash

Or with test dependencies (for contributors)

uv sync --group test

Local Installation with Python 🐍

Option A: Using uv (Recommended - Faster & Better Dependencies)

```bash

Install uv if you haven't already

curl -LsSf https://astral.sh/uv/install.sh | sh

Setup environment — using Python 3.11

python -m venv .venv source .venv/bin/activate

Clone and start with Docker Compose

git clone https://github.com/travisvn/chatterbox-tts-api cd chatterbox-tts-api

Use Docker-optimized environment variables

cp .env.example.docker .env # Docker-specific paths, ready to use

Choose your deployment method:

With Docker Compose Profiles

```bash

Same pattern works with all deployment variants:

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 for Production

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.

For Docker deployment

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

Deploy

docker compose -f docker/docker-compose.yml up -d ```

Ensure NVIDIA Container Toolkit is installed

docker compose -f docker/docker-compose.gpu.yml up -d ```

</details>

<details> <summary><strong>📚 API Reference</strong></summary>

Option 1: Use default setup (now includes CUDA-enabled PyTorch)

docker compose -f docker/docker-compose.yml up -d

Option 2: Use explicit CUDA setup (traditional)

docker compose -f docker/docker-compose.gpu.yml up -d

Option 4: Use CPU-only setup (may have compatibility issues)

docker compose -f docker/docker-compose.cpu.yml up -d

Option 5: Clear model cache and retry with CUDA-enabled setup

docker volume rm chatterbox-tts-api_chatterbox-models docker compose -f docker/docker-compose.yml up -d --build

Check if uvicorn is installed

uvicorn --version

Full Stack mode with UI (using Docker)

python start.py fullstack

Install in development mode (pip)

pip install -e .

➡️ View the [Open WebUI docs for installing Chatterbox TTS API](https://docs.openwebui.com/tutorials/text-to-speech/chatterbox-tts-api-integration)

⚡️ Quick Start

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

Or: cp .env.example .env # Local development paths, needs customization

API Usage

Quick Start

```bash

Quick Start

```bash

Basic Streaming Example

```python import requests

SSE Streaming Example (OpenAI Compatible)

```python import requests import json import base64

Quick Start Scripts

```bash

Add your voice sample (or use the provided one)

cp your-voice.mp3 voice-sample.mp3

Screenshots of Frontend (Web UI)

Chatterbox TTS API - Frontend - Dark Mode Chatterbox TTS API - Frontend - Light Mode
Chatterbox TTS API - Frontend Processing - Dark Mode Chatterbox TTS API - Frontend Processing - Light Mode
🖼️ View screenshot of full frontend web UI — light mode / dark mode

Replace the default voice sample

cp your-voice.mp3 voice-sample.mp3

Copy and customize environment variables

cp .env.example .env

Copy and customize environment variables

cp .env.example .env

Port Configuration

  • API Only: Accessible at http://localhost:4123 (direct API access)
  • With Frontend: Web UI at http://localhost:4321, API requests routed via proxy

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

🎛️ Configuration

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

Create production environment

cp .env.example.docker .env nano .env # Set production values

Memory Configuration

VariableDefaultDescription
MEMORY_CLEANUP_INTERVAL5Cleanup memory every N requests
CUDA_CACHE_CLEAR_INTERVAL3Clear CUDA cache every N requests
ENABLE_MEMORY_MONITORINGtrueEnable detailed memory logging

Chatterbox TTS API

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

Start the API with FastAPI

uv run uvicorn app.main:app --host 0.0.0.0 --port 4123

Start the API with FastAPI

uvicorn app.main:app --host 0.0.0.0 --port 4123

API Only (default)

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

API + Frontend (add --profile frontend to any of the above)

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

Test the API

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:

API only (default behavior)

docker compose -f docker/docker-compose.yml up -d

API + Frontend + Web UI (with --profile frontend)

docker compose -f docker/docker-compose.yml --profile frontend up -d

Start the API first (follow earlier instructions)

🚀 **[Complete Streaming Documentation →](docs/STREAMING_API.md)**

For comprehensive streaming features including:

  • Advanced chunking strategies (sentence, paragraph, word, fixed)
  • Quality presets (fast, balanced, high)
  • Configurable parameters and performance tuning
  • Real-time progress monitoring
  • Python, JavaScript, and cURL examples
  • Integration patterns for different use cases

Key Benefits:

  • Lower latency - Start hearing audio in 1-2 seconds
  • 🎯 Better UX - No waiting for complete generation
  • 💾 Memory efficient - Process chunks individually
  • 🎛️ Configurable - Choose speed vs quality trade-offs

<details> <summary><strong>🐍 Python Examples</strong></summary>

Upload Endpoint (Default Voice)

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)

API Endpoints

EndpointMethodDescription
/audio/speechPOSTGenerate speech from text (complete)
/audio/speech/uploadPOSTGenerate speech with voice upload
/audio/speech/streamPOST**Stream** speech generation ([docs](docs/STREAMING_API.md))
/audio/speech/stream/uploadPOST**Stream** speech with voice upload ([docs](docs/STREAMING_API.md))
/voicesGETList voices in library (with language metadata)
/voicesPOSTUpload voice to library (with language support)
/languagesGET**Get supported languages** ([docs](docs/MULTILINGUAL.md))
/healthGETHealth check and status
/configGETCurrent configuration
/v1/modelsGETAvailable models (OpenAI compat)
/statusGETTTS processing status & progress
/status/progressGETReal-time progress (lightweight)
/status/statisticsGETProcessing statistics
/status/historyGETRecent request history
/infoGETComplete API information
/docsGETInteractive API documentation
/redocGETAlternative API documentation

Parameters Reference

Memory Monitoring Endpoints

```bash

Get comprehensive API information

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.

Start with auto-reload (FastAPI development)

uvicorn app.main:app --host 0.0.0.0 --port 4123 --reload

Run API tests

python tests/test_api.py # or: uv run tests/test_api.py

Test specific endpoint

curl http://localhost:4123/health

Check API documentation

curl http://localhost:4123/openapi.json ```

FastAPI Development Features

  • Auto-reload: Use --reload flag for development
  • Interactive docs: Visit /docs for live API testing
  • Type hints: Full IDE support with Pydantic models
  • Validation: Automatic request/response validation
  • Modular structure: Easy to extend and maintain

</details>

<details> <summary><strong>🤝 Contributing</strong></summary>

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Ensure FastAPI docs are updated
  6. Submit a pull request

</details>

🔗 Integrations

Alternative startup method

python main.py ```

</details>

<details> <summary><strong>💻 Development</strong></summary>

📚 实用指南(长尾问题)
适合谁
  • 做语音类 AI 产品的开发者
最佳实践
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • Python 依赖冲突:建议用 venv / uv 隔离环境
部署方案
  • Docker:chatterbox-tts-api 提供官方镜像,docker compose up 一键启动
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
chatterbox-tts-api 中文教程chatterbox-tts-api 安装报错怎么办chatterbox-tts-api Docker 部署chatterbox-tts-api 与同类工具对比chatterbox-tts-api 最佳实践chatterbox-tts-api 适合谁用
⚡ 核心功能
👥 适合人群
AI 技术爱好者研究人员和学生开发者和工程师技术创业者
🎯 使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
⚖️ 优点与不足
✅ 优点
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

该工具使用 AGPL-3.0 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

⚠️ AGPL 3.0 — 最严格的 Copyleft,网络服务端使用也需开源,SaaS 使用受限。

🔗 相关工具推荐
📚 相关教程推荐
❓ 常见问题 FAQ
chatterbox-tts-api 是一款Python开发的AI辅助工具。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.)
💡 AI Skill Hub 点评

AI Skill Hub 点评:chatterbox-tts-api — AI 语音合成工具中文文档 的核心功能完整,质量优秀。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。

📚 深入学习 chatterbox-tts-api — 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
🔗 原始来源
🐙 GitHub 仓库  https://github.com/travisvn/chatterbox-tts-api 🌐 官方网站  https://chatterboxtts.com

收录时间:2026-05-22 · 更新时间:2026-05-22 · License:AGPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。