API de Synthèse Vocale (POST /v1/audio/speech)
Génère de l'audio à partir de texte conformément à la spécification OpenAI /v1/audio/speech.
📥 Corps de la Requête (Request Body)
| Champ | Type | Requis | Par défaut | Description |
|---|---|---|---|---|
model | string | Optionnel | edgetts | Identifiant du modèle ou du fournisseur (tts-1, edgetts, kokoro) |
input | string | Oui | - | Texte à synthétiser (jusqu'à 8 192 caractères) |
voice | string | Optionnel | alloy | ID ou alias de la voix (alloy, zh-CN-XiaoxiaoNeural) |
response_format | string | Optionnel | mp3 | Format : mp3, opus, aac, flac, wav, pcm |
speed | float | Optionnel | 1.0 | Multiplicateur de vitesse (de 0.25 à 4.0) |
stream | boolean | Optionnel | false | Activer le streaming audio HTTP Chunked |
💡 Exemple
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 offre une synthèse vocale ultra-rapide.",
"voice": "alloy",
"response_format": "mp3"
}' \
--output speech.mp3