Use Authorization: Token <API_KEY>
Example: Authorization: Token 12345abcdef
OR
AuthorizationBearer
Use Authorization: Bearer <JWT>
Example: Authorization: Bearer eyJhbGciOiJ...
Headers
AuthorizationstringRequired
Use your API key or a [temporary token](/guides/fundamentals/token-based-authentication) for authentication via the `Authorization` header. In client-side environments where custom headers are not supported, use the [`Sec-WebSocket-Protocol`](/guides/deep-dives/using-the-sec-websocket-protocol) header instead.
**Example:** `Authorization: Token %DEEPGRAM_API_KEY%` or `Authorization: Bearer %DEEPGRAM_TOKEN%`
Query parameters
encodingenumOptionalDefaults to linear16
Encoding allows you to specify the expected encoding of your audio output for streaming TTS. Only streaming-compatible encodings are supported.
Allowed values:
mip_opt_outanyOptional
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
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:
speeddoubleOptional0.7-1.5Defaults to 1
Speaking rate multiplier that adjusts the pace of generated speech while preserving natural prosody and voice quality. Not yet supported in all languages.
Send
SpeakV1TextobjectRequired
Text to convert to audio
OR
SpeakV1FlushobjectRequired
Flush the buffer and receive the final audio for text sent so far
OR
SpeakV1ClearobjectRequired
Clear the buffer and start a new audio generation. Potentially destructive operation for any text in the buffer
OR
SpeakV1CloseobjectRequired
Flush the buffer and close the connection gracefully after all audio is generated
Use your API key or a temporary token for authentication via the Authorization header. In client-side environments where custom headers are not supported, use the Sec-WebSocket-Protocol header instead.
Example:Authorization: Token %DEEPGRAM_API_KEY% or Authorization: Bearer %DEEPGRAM_TOKEN%
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