Sprachsynthese-API (POST /v1/audio/speech)
Generiert Audio aus Text gemäß der OpenAI /v1/audio/speech-Spezifikation.
📥 Request-Body
| Feld | Typ | Erforderlich | Standard | Beschreibung |
|---|---|---|---|---|
model | string | Optional | edgetts | Modell- oder Provider-ID (tts-1, edgetts, kokoro) |
input | string | Ja | - | Zu synthetisierender Text (bis zu 8.192 Zeichen) |
voice | string | Optional | alloy | Stimmen-ID oder Alias (alloy, zh-CN-XiaoxiaoNeural) |
response_format | string | Optional | mp3 | Audioformat: mp3, opus, aac, flac, wav, pcm |
speed | float | Optional | 1.0 | Geschwindigkeitsmultiplikator (0.25 bis 4.0) |
stream | boolean | Optional | false | HTTP-Chunked-Audiostreaming aktivieren |
💡 Beispiel
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 liefert ultraschnelle Sprachsynthese.",
"voice": "alloy",
"response_format": "mp3"
}' --output speech.mp3