“Your package is out for delivery and should arrive before four this afternoon.”
← 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.
“Tu pedido ya está en reparto y llegará hoy antes de las cuatro de la tarde.”
“Votre colis est en cours de livraison et devrait arriver avant seize heures aujourd'hui.”
“Ihr Paket ist bereits in der Zustellung und sollte heute vor sechzehn Uhr ankommen.”
“Il tuo pacco è in consegna oggi e dovrebbe arrivare prima delle sedici.”
“A sua encomenda já está em distribuição e deverá chegar hoje antes das quatro da tarde.”
“Uw pakket is onderweg en wordt vandaag vóór vier uur vanmiddag bezorgd.”
Input reference clip
“Good afternoon, I am calling from customer support to confirm your delivery window for tomorrow.”
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 endpoint | wss://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 frames | Send 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 endpoint | POST https://api.trelis.com/v1/audio/speech (model=multilingual-eu-tts, buffered or stream=true chunked audio; OpenAI Audio SDK compatible) |
| Languages | English (en), Spanish (es), French (fr), German (de), Italian (it), Portuguese (pt), Dutch (nl) |
| Zero-shot voice cloning | Optional 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 formats | 48 kHz mono raw pcm_s16le (WebSocket or HTTP), streaming wav, or mp3 |
| Limits | Up to 20,000 characters per WebSocket session or 2,000 characters per HTTP request |
| Voice rights policy | Clone 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.
1. Head-to-head EU7 streaming benchmark vs. ElevenLabs
| Model | Est. price / hr ↓ | HTTP TTFA p50 ↓ | HTTP TTFA p90 ↓ | WebSocket TTFA | Blind ASR WER ↓ | Clean clips |
|---|---|---|---|---|---|---|
| Trelis Multilingual EU Streaming TTSmodel=multilingual-eu-tts (48 kHz native, zero-shot voice cloning) | $0.25 / hrbilled per audio s | 133 ms | 140 ms | 124 ms p50169 ms p90 (48 kHz PCM) | 1.02%6 / 587 words | 35 / 35 |
| ElevenLabs Eleven Flash v2.5eleven_flash_v2_5 (voice: Sarah, 24 kHz PCM) | ~$2.57 / hr$0.04 / 1k chars | 107 ms | 122 ms | 100 ms p50338 ms p90 | 0.17%1 / 587 words | 35 / 35 |
| ElevenLabs Eleven v4 Turboeleven_v4_turbo (voice: Sarah, 24 kHz PCM) | ~$2.40 / hr$0.04 / 1k chars | 179 ms | 451 ms | HTTP /stream400 on /stream-input WS | 0.17%1 / 587 words | 35 / 35 |
| ElevenLabs Eleven v4eleven_v4 (voice: Sarah, 24 kHz PCM) | ~$4.83 / hr$0.08 / 1k chars | 660 ms | 874 ms | HTTP /stream400 on /stream-input WS | 0.17%1 / 587 words | 35 / 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).
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)
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
# 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.wavStart 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.