Continuous Text Stream

Deepgram Text to Speech WebSocket

HandshakeTry it

GET
wss://api.deepgram.com/v1/speak

Headers

AuthorizationstringRequired

API key for authentication. Format should be be either ‘token <DEEPGRAM_API_KEY>’ or ‘Bearer <JWT_TOKEN>’

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:

Send

textToSpeechRequestobjectRequired
OR
speak_controlMessagesRequestobjectRequired

Receive

textToSpeechResponsestringRequired
OR
controlMessagesResponseobjectRequired
OR
speak_closeFrameobjectRequired