Skip to main content
POST
/
api
/
post
/
speech
/
tts
TTS POST Endpoint
curl --request POST \
  --url https://eu.api.gradium.ai/api/api/post/speech/tts \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "text": "<string>",
  "voice_id": "<string>",
  "output_format": "wav",
  "only_audio": true
}
'

Headers

x-api-key
string
required

Your Gradium API key

Body

application/json
text
string
required

The text to convert to speech

voice_id
string
required

Voice ID from the library or custom voice ID

output_format
enum<string>
required

Audio output format

Available options:
wav,
pcm,
opus,
ulaw_8000,
alaw_8000,
pcm_8000,
pcm_16000,
pcm_24000
only_audio
boolean

When true, returns raw audio bytes instead of JSON

Response

Audio data returned successfully