Skip to main content
POST
/
tts
/
synthesize
Synthesize speech
curl --request POST \
  --url https://app.myhero.so/tts/synthesize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "<string>",
  "prompt": "<string>",
  "voice": "<string>",
  "model": "gemini-2.5-flash-preview-tts",
  "audioEncoding": "LINEAR16",
  "languageCode": "<string>"
}
'
{
  "success": true,
  "data": {
    "audioContent": "<string>",
    "audioConfig": {
      "audioEncoding": "<string>",
      "sampleRateHertz": 123
    },
    "model": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://developers.myhero.so/llms.txt

Use this file to discover all available pages before exploring further.

Generates text-to-speech audio for the given text using the configured Gemini TTS provider. Accepts an optional prompt for style guidance, voice, model, audioEncoding, and languageCode. Returns { audioContent, audioConfig, model } where audioContent is base64-encoded audio. Combined text and prompt must not exceed 1800 characters.

Authorizations

Authorization
string
header
required

HERO personal access token

Body

application/json
text
string
required
Required string length: 1 - 900
prompt
string
Maximum string length: 900
voice
string
model
enum<string>
Available options:
gemini-2.5-flash-preview-tts,
gemini-2.5-pro-preview-tts
audioEncoding
enum<string>
Available options:
LINEAR16,
MP3,
OGG_OPUS,
ALAW,
MULAW
languageCode
string

Response

200 response

success
enum<boolean>
required
Available options:
true
Example:

true

data
object
required