Reference
API
Local OpenAI-compatible server at http://localhost:11435. No API key required. Binary audio responses; progressive download when stream: true.
Speech
Generate speech from text. Response is binary audio (audio/mpeg, audio/pcm, …).
Body
modelstringRequired. e.g.
chatterbox-turboinputstringRequired. Text to synthesize (max 4096)
voicestringOptional. Saved voice, named speaker (Qwen
Ryan, Kokoroaf_heart, …), path, ordefaultlanguagestringOptional. Chatterbox Multilingual ISO (
fr,zh, …), Qwen language name, or Kokoro ISO / voice prefixresponse_formatstringOptional. Default
mp3. Alsowav,opus,flac,aac,pcm,pcm_16000,pcm_22050,pcm_24000,pcm_44100speedfloatOptional 0.25–4.0 (currently ignored)
streamboolOptional. Default
false. Progressive download; onlymp3andpcm/pcm_*
Streaming — stream: true returns chunked bytes. Allowed: mp3, pcm, pcm_*. Rejected with 400: wav, opus, aac, flac. For pcm, Content-Type is audio/pcm at the model's native sample rate.
Errors: 400 bad params / unsupported stream format · 404 model not found · 500 generation failed.
Example
curl http://localhost:11435/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"model": "chatterbox-turbo",
"input": "Hello from Wavhost!",
"voice": "my-voice",
"response_format": "mp3"
}' \
--output speech.mp3Streaming
curl http://127.0.0.1:11435/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"model": "chatterbox-nano",
"input": "Hello",
"voice": "default",
"stream": true,
"response_format": "pcm"
}' \
--output out.pcmVoices
Models & health
Python client
Example
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:11435/v1",
api_key="not-needed",
)
speech = client.audio.speech.create(
model="chatterbox-turbo",
voice="my-voice",
input="Hello from Wavhost!",
)
speech.write_to_file("hello.mp3")