Skip to content

Speech Synthesis API (POST /v1/audio/speech) ​

Generates audio from text matching the OpenAI /v1/audio/speech specification.


📥 Request Body ​

FieldTypeRequiredDefaultDescription
modelstringOptionaledgettsModel or Provider ID (tts-1, edgetts, kokoro)
inputstringYes-Text to synthesize (up to 8,192 characters)
voicestringOptionalalloyVoice ID or alias (alloy, zh-CN-XiaoxiaoNeural)
response_formatstringOptionalmp3Format: mp3, opus, aac, flac, wav, pcm
speedfloatOptional1.0Speed rate multiplier (0.25 to 4.0)
streambooleanOptionalfalseEnable HTTP Chunked audio streaming

💡 Example ​

bash
curl http://localhost:8030/v1/audio/speech \
  -H "Authorization: Bearer sk-onetts-v1-k9L3mX8QZ2sT4vA7wE1rY6u" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "OneTTS delivers ultra-fast speech synthesis.",
    "voice": "alloy",
    "response_format": "mp3"
  }' \
  --output speech.mp3

Released under the Apache-2.0 License.