Skip to content

Usage

Our TTS models expose the OpenAI-compatible Speech API:

  • /v1/audio/speech: synthesize speech audio from input text

This means you can use our TTS models with any of the OpenAI SDKs or with any framework that supports custom OpenAI-compatible audio endpoints.

💡 Speech is billed on input characters only. v1 returns WAV audio; pass raw model voice IDs (e.g. af_heart) in the voice field.

Examples

Generate speech

sh
curl -X POST https://api.libertai.io/v1/audio/speech \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "kokoro-82m",
    "input": "Hello from LibertAI.",
    "voice": "af_heart",
    "response_format": "wav"
  }' --output speech.wav

Parameters

FieldRequiredNotes
modele.g. kokoro-82m
inputText to synthesize (max 8192 characters)
voiceRaw model voice ID; defaults to the model's default voice (af_heart for Kokoro)
response_formatwav only (default) in the current release
speed0.25–4.0, default 1.0

See also