← Speech data prep and inference API

Multilingual Streaming TTS (7 European Languages)

Real-time bidirectional WebSocket text-to-speech across 7 European languages at $0.25 / generated audio hour. Stream incremental LLM text chunks in and receive 48 kHz PCM audio out in 124 ms p50 (133 ms HTTP streaming), with instant cancel for caller barge-in, zero-shot voice cloning from a short clip, and a companion OpenAI-compatible HTTP streaming endpoint.

Audio samples (7 languages + cross-lingual voice cloning)

Generated directly by the hosted endpoint (48 kHz native audio encoded to 128 kbps MP3 for browser playback). Voice naturalness is best judged by listening directly; all clips below are AI-generated speech, and the cloning pair synthesizes French from a synthetic British English reference clip.

English (en)

“Your package is out for delivery and should arrive before four this afternoon.”

Spanish (es)

“Tu pedido ya está en reparto y llegará hoy antes de las cuatro de la tarde.”

French (fr)

“Votre colis est en cours de livraison et devrait arriver avant seize heures aujourd'hui.”

German (de)

“Ihr Paket ist bereits in der Zustellung und sollte heute vor sechzehn Uhr ankommen.”

Italian (it)

“Il tuo pacco è in consegna oggi e dovrebbe arrivare prima delle sedici.”

Portuguese (pt)

“A sua encomenda já está em distribuição e deverá chegar hoje antes das quatro da tarde.”

Dutch (nl)

“Uw pakket is onderweg en wordt vandaag vóór vier uur vanmiddag bezorgd.”

Voice cloning: synthetic reference (~6 s, EN-GB)

Input reference clip

“Good afternoon, I am calling from customer support to confirm your delivery window for tomorrow.”

Voice cloning: cross-lingual output (FR)

Cloned French reply in target voice

“Bonjour, votre colis est bien confirmé pour demain matin entre neuf heures et midi.”

Streaming protocol and specifications

Built for interactive voice agents that stream tokens directly from an LLM into speech synthesis. Supports bidirectional WebSocket streaming alongside a drop-in OpenAI-compatible HTTP audio endpoint.

WebSocket endpointwss://api.trelis.com/v1/audio/speech/stream?model=multilingual-eu-tts (authenticate with Authorization: Bearer $TRELIS_API_KEY or browser subprotocol Sec-WebSocket-Protocol: trelis.auth, tk_live_...)
Bidirectional framesSend JSON config, incremental text deltas, flush, cancel (instant barge-in abort; unplayed holds refunded), and end. Receive 48 kHz mono pcm_s16le binary frames (or base64 JSON with audio_encoding=base64) plus ready, configured, cancelled, and done.
Companion HTTP endpointPOST https://api.trelis.com/v1/audio/speech (model=multilingual-eu-tts, buffered or stream=true chunked audio; OpenAI Audio SDK compatible)
LanguagesEnglish (en), Spanish (es), French (fr), German (de), Italian (it), Portuguese (pt), Dutch (nl)
Zero-shot voice cloningOptional 0.5 to 10 second mono or stereo reference clip (reference_audio_base64 in WebSocket config or reference_audio over HTTP), with optional reference_text; works across languages
Pricing$0.25 / generated audio hour ($0.004167 / min), billed per generated audio second ($0.001 minimum). See pricing →
Output formats48 kHz mono raw pcm_s16le (WebSocket or HTTP), streaming wav, or mp3
LimitsUp to 20,000 characters per WebSocket session or 2,000 characters per HTTP request
Voice rights policyClone only voices you have permission to use, and disclose to listeners that the speech is AI-generated

Latency, intelligibility, and cost vs. ElevenLabs

Evaluated live from US East on 35 conversational phone-agent replies across all 7 European languages (5 per language, 587 normalized words, 3,446 characters) against ElevenLabs eleven_flash_v2_5, eleven_v4_turbo, and eleven_v4 (voice: Sarah). All four systems streamed raw PCM over identical keep-alive HTTP connections (after 2 warm-up turns) and completed 35/35 clips with zero silent outputs and zero clipped endings.

Measured: 2026-12-01Region: US EastDataset: EU7 conversational replies (n=35, 7 langs, 587 words, 3,446 chars)Apples-to-apples live HTTP & WebSocket PCM streamingDownload JSON ↓

Warm latency shown after 2 warm-up requests; the first request after an idle period may add cold-start wake-up time before sustaining ~124 ms WebSocket / ~133 ms HTTP TTFA.

Streaming TTFA (p50)
124 ms WS
133 ms p50 / 140 ms p90 HTTP (3.2x tighter tail than v4 Turbo)
Blind EU7 word accuracy
99.0%
1.02% blind ASR WER across 7 languages; 35/35 clean clips
Hosted API price
$0.25 / hr
9.6x to 19.3x lower than ElevenLabs; cloning included

1. Head-to-head EU7 streaming benchmark vs. ElevenLabs

ModelEst. price / hr ↓HTTP TTFA p50 ↓HTTP TTFA p90 ↓WebSocket TTFABlind ASR WER ↓Clean clips
Trelis Multilingual EU Streaming TTSmodel=multilingual-eu-tts (48 kHz native, zero-shot voice cloning)$0.25 / hrbilled per audio s133 ms140 ms124 ms p50169 ms p90 (48 kHz PCM)1.02%6 / 587 words35 / 35
ElevenLabs Eleven Flash v2.5eleven_flash_v2_5 (voice: Sarah, 24 kHz PCM)~$2.57 / hr$0.04 / 1k chars107 ms122 ms100 ms p50338 ms p900.17%1 / 587 words35 / 35
ElevenLabs Eleven v4 Turboeleven_v4_turbo (voice: Sarah, 24 kHz PCM)~$2.40 / hr$0.04 / 1k chars179 ms451 msHTTP /stream400 on /stream-input WS0.17%1 / 587 words35 / 35
ElevenLabs Eleven v4eleven_v4 (voice: Sarah, 24 kHz PCM)~$4.83 / hr$0.08 / 1k chars660 ms874 msHTTP /stream400 on /stream-input WS0.17%1 / 587 words35 / 35

Tradeoff summary: ElevenLabs achieves the lowest blind ASR WER (0.17% vs. 1.02%), and eleven_flash_v2_5 has slightly lower HTTP median TTFA (107 ms vs. 133 ms), though Trelis delivers a 2.0x tighter WebSocket p90 tail (169 ms vs. 338 ms). Compared to eleven_v4_turbo and eleven_v4, Trelis is faster at median and 3.2x to 6.2x tighter at p90 (140 ms vs. 451 ms and 874 ms HTTP p90), outputs native 48 kHz audio with zero-shot cross-lingual voice cloning, and costs 9.6x to 19.3x less per generated audio hour ($0.25/hr vs. ~$2.40/hr for v4 Turbo and ~$2.57/hr for Flash v2.5 at $0.04/1k chars, and ~$4.83/hr for v4 at $0.08/1k chars, converted using each model’s measured characters per audio hour on this 35-clip set).

Streaming tail latency (p90 TTFA) and hourly synthesis costLower is better on both charts; live US East HTTP streaming (n=35 clips across 7 EU languages)
Live api.trelis.com vs. api.elevenlabs.io

2. Per-language blind ASR WER across all 7 languages

Language (5 replies each)Trelis WER ↓ElevenLabs Flash v2.5 WER ↓ElevenLabs v4 Turbo WER ↓ElevenLabs v4 WER ↓
English (en)0.00%0.00%0.00%0.00%
Spanish (es)1.20%0.00%0.00%0.00%
French (fr)1.12%0.00%0.00%0.00%
German (de)2.53%0.00%0.00%0.00%
Italian (it)0.00%0.00%0.00%0.00%
Portuguese (pt)1.14%1.14%1.14%1.14%
Dutch (nl)1.18%0.00%0.00%0.00%

Methodology: Blind ASR WER is transcribed across all four systems with ElevenLabs scribe_v3 using identical lowercase, punctuation, and symmetrical clock-time normalization (so “16:00” and “seize heures” score equivalently across every arm). Three of Trelis’s six diffs across 587 words are colloquial spoken contractions (such as ich hab for ich habe and pra for para). Audio naturalness is best judged directly using the samples above. For Cairene Egyptian Arabic, see Egyptian Arabic Streaming TTS.

Quickstart (WebSocket streaming & OpenAI SDK)

Stream LLM tokens straight into WS /v1/audio/speech/stream for live voice agents, or use the companion OpenAI Audio SDK endpoint for buffered and chunked HTTP playback.

Python (bidirectional WebSocket + cloning)

pythonstream_tts_ws.py
import asyncio, base64, json, os, websockets

WS_URL = "wss://api.trelis.com/v1/audio/speech/stream?model=multilingual-eu-tts"

async def stream_tts(ref_wav_path: str | None = None):
    headers = {"Authorization": f"Bearer {os.environ['TRELIS_API_KEY']}"}
    async with websockets.connect(WS_URL, additional_headers=headers) as ws:
        print(json.loads(await ws.recv()))  # {"type": "ready", "sample_rate": 48000, ...}

        # Optional zero-shot voice cloning from a 0.5 to 10 s reference clip
        if ref_wav_path:
            with open(ref_wav_path, "rb") as f:
                ref_b64 = base64.b64encode(f.read()).decode("ascii")
            await ws.send(json.dumps({
                "type": "config",
                "reference_audio_base64": ref_b64,
                "reference_text": "Good afternoon, I am calling from customer support.",
            }))
            print(json.loads(await ws.recv()))  # {"type": "configured", "has_reference": true}

        async def send_llm_tokens():
            for chunk in ["Bonjour, ", "votre colis est bien confirmé ", "pour demain matin."]:
                await ws.send(json.dumps({"type": "text", "text": chunk}))
                await asyncio.sleep(0.05)
            await ws.send(json.dumps({"type": "flush"}))
            # Send {"type": "cancel"} anytime if the caller interrupts mid-sentence
            await ws.send(json.dumps({"type": "end"}))

        pcm = bytearray()
        send_task = asyncio.create_task(send_llm_tokens())
        async for msg in ws:
            if isinstance(msg, bytes):
                pcm.extend(msg)  # Play 48 kHz mono pcm_s16le immediately (~124 ms TTFA p50)
            else:
                ev = json.loads(msg)
                if ev["type"] == "done":
                    print("Done:", ev["audio_seconds"], "s, $", ev["cost_usd"])
                    break
        await send_task

asyncio.run(stream_tts())

OpenAI SDK & HTTP streaming

pythonhttp_tts.py
# 1. OpenAI Audio SDK (HTTP streaming WAV, MP3, or PCM)
from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["TRELIS_API_KEY"],
    base_url="https://api.trelis.com/v1",
)

with client.audio.speech.with_streaming_response.create(
    model="multilingual-eu-tts",
    voice="default",
    input="Hola, tu pedido llega manana por la manana.",
    response_format="mp3",  # or "wav" / "pcm"
) as response:
    response.stream_to_file("reply.mp3")

# 2. curl (chunked HTTP streaming WAV)
curl -X POST https://api.trelis.com/v1/audio/speech \
  -H "Authorization: Bearer $TRELIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "multilingual-eu-tts",
    "voice": "default",
    "input": "Your package is out for delivery today.",
    "response_format": "wav",
    "stream": true
  }' \
  --output reply.wav

Start streaming in 7 European languages

Sign in with email in the console to create an API key and add prepaid credits, with optional automatic top-up. Pair with Streaming ASR and Conversational Gemma for a low-latency voice pipeline.