28  TTS

1 operation.

28.0.1 synthesizeSpeech

POST /api/tts/synthesize

Turns assistant text into spoken audio via Google Cloud, falling back to the browser’s built-in voice if unavailable.

Why it exists. ‡ Turn text into speech through the external synthesis service, so an answer can be listened to rather than read.

Called by — lib/tts/client.ts

Reached from — /settings

Proxies text to Google Cloud Text-to-Speech and returns base64 MP3 audio. When the API key is unset or the upstream call fails, returns 200 with fallback:true so the client can use browser speech synthesis instead of surfacing an error.

Authentication: CookieAuth

Returns — fallback · audio

Field names as the handler returns them; the source states no types for them.

Request body

Field Type Required
text string no
voiceId string — one of en-US-Neural2-C, en-US-Neural2-F, en-US-Neural2-D, en-US-Neural2-J no

Responses

Status Meaning Body
200 Base64 MP3 audio, or a fallback signal.
400 Missing text/voiceId or unknown voice. Error
401 Unauthorized. Error