Quickstart
Request body
TTS model ID (e.g.
eleven_v3, cartesia-sonic-2).Text to synthesize.
Provider-specific voice ID. Falls back to the model’s default voice when
omitted.
Container / codec for the returned audio.
Output sample rate in Hz.
Playback speed multiplier where supported.
Response
The body is the raw audio file. InspectContent-Type to confirm the codec:
format | Content-Type |
|---|---|
mp3 | audio/mpeg |
wav | audio/wav |
opus | audio/opus |
flac | audio/flac |
aac | audio/aac |
Streaming
For low-latency playback, open a WebSocket towss://gateway.llm-stats.com/v1/tts/stream and follow the protocol described in the dashboard’s TTS playground. The HTTP endpoint above is the right choice for short, batch synthesis.
Errors
Failures use the shared error envelope. Common ones:| Status | error.code | When |
|---|---|---|
400 | invalid_input | Missing text, unsupported format, … |
401 | unauthenticated | Missing or invalid API key. |
402 | insufficient_quota | Out of credit. |
429 | rate_limited | Quota exceeded — back off using Retry-After. |
502 | provider_unavailable | Every TTS provider for this model errored. |