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 thevoicefield.
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.wavParameters
| Field | Required | Notes |
|---|---|---|
model | ✅ | e.g. kokoro-82m |
input | ✅ | Text to synthesize (max 8192 characters) |
voice | — | Raw model voice ID; defaults to the model's default voice (af_heart for Kokoro) |
response_format | — | wav only (default) in the current release |
speed | — | 0.25–4.0, default 1.0 |
See also
- x402 payments — pay per request without an API key
- Architecture

