Kooma API
English Clés API S'inscrire

POST Synthèse vocale

Transforme un texte en voix naturelle. Choisis parmi les voix bambara publiées, ou une voix internationale. Réponse : un fichier audio WAV.

POST/v1/audio/speech

Corps JSON. Autorisation requise : tts.

Paramètres

NomTypeDescription
inputrequisstringLe texte à lire (5 000 caractères max).
voiceoptionstringIdentifiant de voix (voir Voix). Défaut modibo.
tgtoptionstringLangue du texte/de la voix (voir Langues). Défaut bam_Latn.
srcoptionstringTraduire le texte avant lecture : langue source, ou auto. Défaut same (pas de traduction).
speedoptionnumberDébit de parole, de 0.5 à 2.0. Absent = 1.0 (même rendu que le Studio).
response_formatoptionstringFormat audio de sortie. wav (défaut, sans perte — recommandé, identique au Studio) ou mp3 (128 kbps mono).

Réponse

Le corps est le fichier audio brut (Content-Type: audio/wav), pas du JSON. Écris-le directement sur disque.

Facturé au caractère. Les voix personnalisées (clonées) sont facturées à un tarif supérieur.

curl https://api.kooma.ai/v1/audio/speech \
  -H "Authorization: Bearer sk-intermo-VOTRE_CLE" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "I ni ce, i ka kɛnɛ wa?",
    "voice": "aminata",
    "tgt": "bam_Latn",
    "speed": 1.0
  }' \
  --output sortie.wav
200 OK audio/wav (binaire)
RIFF....WAVEfmt ............   # fichier audio
402 Crédit insuffisant
{
  "error": {
    "message": "Insufficient prepaid credits for 'tts'.",
    "type": "insufficient_credits",
    "code": "insufficient_credits"
  }
}
↑↓ naviguer↵ ouvriresc fermer