Skip to main content
POST
Stream speech over SSE

Authorizations

Authorization
string
header
required

API key in the Authorization header: Bearer sk_hopper_... Keys are minted in the dashboard at withhopper.com/console/keys and shown once at creation. WebSocket connections also accept ?api_key=.

Body

application/json
model_id
string
required

TTS model id, e.g. omnivoice.

transcript
string
required

Text to synthesize, 1-5000 characters. Billed per character of the submitted transcript, before dictionary expansion.

Required string length: 1 - 5000
voice
object
required
output_format
object
required
language
string

ISO language code.

Pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})?$
generation_config
object
pronunciation_dict_id
string

Dictionary applied before synthesis; 404 dict_not_found if unknown.

stream
boolean
default:false

On /tts/bytes: relay raw WAV/PCM bytes progressively as they are generated. Ignored on /tts/sse, which always streams.

Response

Event stream of base64 audio chunks, terminated by a done event.

data: {"type":"chunk","data":""} repeated, then data: {"type":"done"}.