Skip to main content
POST
Convert Text to Audio

Authorizations

Authorization
string
header
required

Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).

Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).

Body

application/json

Request body for text-to-audio conversion. Provide either message_id or text.

message_id
string<uuid>

ID of the message whose answer to voice. Takes priority over text when both are provided. Get message IDs from List Conversation Messages.

text
string

Text to synthesize into speech.

user
string

End-user identifier, defined by your app and unique within it. See End User Identity.

voice
string

Voice to use for text-to-speech. Available voices depend on the TTS provider configured for this app. Use the voice value from Get App Parameterstext_to_speech.voice for the default.

streaming
boolean

Accepted for backward compatibility but has no effect. Whether the audio is streamed is determined by the configured TTS provider's output, not by this field.

Response

Returns the generated audio. The Content-Type header reflects the provider's audio container, verified from the response bytes when recognizable.

The body can be AAC, FLAC, MP4, MP3, Ogg, WAV, or WebM. Output that cannot be recognized is labeled with the provider's declared type, or audio/mpeg when none is declared.

Streamed provider output is delivered with chunked transfer encoding; the request streaming field does not control this.

The response is of type file.

Last modified on August 24, 2026