Text-to-Speech

Turn text into production-ready audio with one API call.

The Luntrex TTS endpoint supports ElevenLabs and OpenAI-compatible models. Send text, optional voice settings, and get back a hosted audio URL plus usage metadata.

Endpoint

Use POST /audio/tts to synthesize speech and receive an audio URL.

Base URL https://luntrex.com/api/v1

Required fields

  • model ? provider/model pair (e.g. elevenlabs/aMSt68OGf4xUZAnLpTU8).
  • text ? the text you want to convert into speech.

Optional fields

  • voice_settings ? provider-specific voice settings (ElevenLabs).
  • output_format ? e.g. mp3_44100_128.
  • voice ? OpenAI voice name (e.g. alloy).
  • format ? response format for OpenAI TTS (e.g. mp3).
  • speed ? OpenAI speech speed (0.25 ? 4.0).

Request example

curl -X POST https://luntrex.com/api/v1/audio/tts \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "elevenlabs/aMSt68OGf4xUZAnLpTU8",
    "text": "Hello from Luntrex!",
    "voice_settings": {
      "stability": 0.5,
      "similarity_boost": 0.8
    },
    "output_format": "mp3_44100_128"
  }'

Response

{
  "status": "success",
  "audio_url": "https://cdn.luntrex.com/audio/tts/2026/01/uuid.mp3",
  "usage": {
    "input_tokens": 14,
    "output_tokens": 0,
    "total_cost_tokens": 0.7
  }
}

The audio_url can be streamed or downloaded directly.

Usage & billing

  • Tokens are estimated by ceil(chars / 4).
  • Cost uses the selected model's price_input and price_output.
  • Each request logs a usage row with input_tokens, output_tokens, and total_cost_tokens.

Errors

  • 401 api_key_missing ? missing or invalid API key.
  • 403 insufficient credits ? user balance is 0.
  • 400 ? invalid model, voice ID, or settings.
  • 5xx ? provider error; check details.

Tips

  • For Eleven v3, stability must be 0.0, 0.5, or 1.0.
  • Keep text under provider limits (Eleven v3 max 5,000 chars).
  • Store output in S3/R2 for easy streaming and caching.

n8n node

Install the community node package n8n-nodes-luntrex-tts to use Text-to-Speech directly inside n8n.

Back to top