v3

latestOpenAPI 3.1.02026-08-0150254154.0 KB
speak > v2 > audio

Flux Text to Speech (batch)

Synthesize a complete block of text into a single audio response using Deepgram's Flux TTS batch (REST) API. Use this for pre-rendering fixed audio (IVR prompts, notifications, narration) where the whole text is known up front and you don't need incremental playback or interruption.

post/v2/speak

Query parameters

callbackstring

URL to which we'll make the callback request

callback_method'POST' | 'PUT'

HTTP method by which the callback request will be made

mip_opt_outboolean

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

string
OR
string[]

Label your requests for the purpose of identification during usage reporting

'8000' | '16000' | '24000' | '32000' | '40000' | '48000'

Encoding - mp3(default). Supported bitrates - 8000, 16000, 24000, 32000, 40000, 48000(default) bps.

OR
integer
OR
integer

The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.

'none'

No container.

OR
'wav'

Encoding - linear16. Supported container - wav (default), or no container.

OR
'wav'

Encoding - mulaw. Supported container - wav (default), or no container.

OR
'wav'

Encoding - alaw. Supported container - wav (default), or no container.

OR
'ogg'

Encoding - opus. Supported container - ogg (default).

Container specifies the file format wrapper for the output audio. The available options depend on the encoding type.

'linear16'

Encoding - linear16. Uncompressed, high-quality audio format often used for telephony or audio processing.

OR
'flac'

Encoding - flac. Lossless audio format for high-quality compression.

OR
'mulaw'

Encoding - mulaw. Compressed audio format commonly used in telephony.

OR
'alaw'

Encoding - alaw. Similar to mulaw but used in international telephony.

OR
'mp3'

Encoding - mp3. Popular compressed audio format for music and streaming.

OR
'opus'

Encoding - opus. High-compression audio format optimized for real-time communications.

OR
'aac'

Encoding - aac. Advanced audio format offering better quality at smaller file sizes than mp3.

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

modelstring required

Flux TTS model used to synthesize the submitted text, in the form flux-{voice}-{language} (for example, flux-alexis-en). Required; unlike the v1 (Aura) endpoint there is no default and only flux models are accepted. English-only at launch.

'8000' | '16000' | '24000' | '32000' | '44100' | '48000'

Encoding - linear16. Supported sample rates - 8000, 16000, 24000, 32000, 44100, 48000 Hz.

OR
'8000' | '16000'

Encoding - mulaw. Supported sample rates - 8000, 16000 Hz.

OR
'8000' | '16000'

Encoding - alaw. Supported sample rates - 8000, 16000 Hz.

OR
'8000' | '16000' | '22050' | '32000' | '48000'

Encoding - flac. Supported sample rates - 8000, 16000, 22050, 32000, 48000 Hz.

Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable

priority'low'

Processing priority for asynchronous (callback) requests. The only supported value is low.

Headers

Authorizationstring required

Use Authorization: Token <API_KEY> Example: Authorization: Token 12345abcdef

Request body

textstring required

The text content to be converted to speech. The server normalizes and preprocesses the text (e.g. stripping inline controls) before synthesis.

Response

Returns the synthesized audio in the requested encoding as a binary stream. When a callback URL is supplied, the request is processed asynchronously and the response body is instead a JSON acknowledgement (Content-Type application/json) of the form {"request_id": "..."}, with the audio delivered to the callback URL. Because this endpoint is typed as a binary audio stream, SDK callers that set callback receive this JSON acknowledgement through the audio byte iterator as raw bytes and must join the chunks and parse request_id themselves.

request_idstring uuid required

Unique identifier for tracking the asynchronous request