chatterbox-tts / README.md
owlninjam's picture
Upload 4 files
21b59b8 verified
metadata
title: Chatterbox TTS API
emoji: πŸŽ™οΈ
colorFrom: purple
colorTo: blue
sdk: docker
app_port: 7860
pinned: false
license: mit

Chatterbox TTS API

A free, CPU-powered TTS service with voice cloning and an OpenAI-compatible API.

Features

  • 🎀 Voice Cloning β€” clone any voice from a ~10s reference clip
  • πŸ”Œ OpenAI-Compatible API β€” drop-in replacement at /v1/audio/speech
  • 🌊 Streaming β€” chunked audio streaming for faster time-to-first-byte
  • πŸ†“ Free β€” runs on HF Spaces CPU tier

API Usage

# Basic TTS
curl -X POST https://YOUR-SPACE.hf.space/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"model":"chatterbox","input":"Hello world!","voice":"default"}' \
  --output speech.wav

# Voice cloning (multipart)
curl -X POST https://YOUR-SPACE.hf.space/v1/audio/speech \
  -F 'request={"model":"chatterbox","input":"Hello!","voice":"clone"};type=application/json' \
  -F "file=@reference.wav" \
  --output cloned.wav

OpenAI SDK

from openai import OpenAI
client = OpenAI(base_url="https://YOUR-SPACE.hf.space/v1", api_key="not-needed")
response = client.audio.speech.create(model="chatterbox", voice="default", input="Hello!")
response.stream_to_file("output.wav")