Continuous Text Stream
Convert text into natural-sounding speech using Deepgram’s TTS WebSocket
HandshakeTry it
WSS
wss://api.deepgram.com/v1/speak
Headers
Authorization
API key for authentication. Format should be be either ‘token <DEEPGRAM_API_KEY>’ or ‘Bearer <JWT_TOKEN>’
Query parameters
encoding
Encoding allows you to specify the expected encoding of your audio output
mip_opt_out
Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip
model
AI model used to process submitted text
sample_rate
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
sendText
Send text to Deepgram's Text to Speech API
OR
sendSpeakControlMessage
Send control messages to Deepgram's Text to Speech API
Receive
receiveAudio
Receive audio from Deepgram's Text to Speech API
OR
receiveSpeakControlResponse
Receive control messages from Deepgram's Text to Speech API
OR
receiveSpeakCloseFrame
Receive close frame from Deepgram's Text to Speech API