Continuous Text Stream

Handshake

GET

Headers

AuthorizationstringRequired

API key for authentication. Format should be token <DEEPGRAM_API_KEY>

Query parameters

encodingenumOptionalDefaults to mp3

Encoding allows you to specify the expected encoding of your audio output

modelenumOptionalDefaults to aura-asteria-en

AI model used to process submitted text

sample_rateenumOptionalDefaults to 24000

Sample Rate specifies the sample rate for the output audio. Based on encoding 8000 or 24000 are possible defaults. For some encodings sample rate is not configurable.

Allowed values: 800016000240004410048000

Send

Text to Speech Requestobject
OR
Speak Control Messages Requestobject

Receive

abc
string

Audio data in the format specified by the request parameters

OR
Control Messages Responseobject
OR
Speak Close Frameobject

When Deepgram encounters an error during streaming text to speech, a WebSocket Close frame is sent. The frame contains a status code and UTF-8-encoded payload describing the error reason

Built with