Skip to main content

Overview

The standard synthesis endpoint converts text into audio and returns it immediately in the response body as a base64-encoded string. This is the simplest way to integrate Lokutor into web and mobile applications where you need a quick, complete audio snippet.

Best Use Cases

  • UI Notifications: Short audio cues for applications.
  • Simple Web Readers: Converting a paragraph of text to speech on-the-fly.
  • Mobile Apps: Low-overhead synthesis where handling binary streams is complex.

Interactive Playground

Enter your text and API key below to hear the results in real-time.

Endpoint Details


Direct Integration

If you prefer to use curl or a standard HTTP client:
curl -X POST "https://api.lokutor.com/api/tts/synthesize" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "The quick brown fox jumps over the lazy dog.",
    "voice": "F1",
    "quality": "high"
  }'
The response will contain the audio_base64 string which you can decode and play:
{
  "audio_base64": "/+MYxAAAAANIAAAAAAA...",
  "format": "mp3",
  "duration": 2.45
}
For texts longer than 4,000 characters, we recommend using Async Synthesis to avoid timeout issues.