Skip to main content
POST
/
post
/
speech
/
tts
cURL
curl -L -X POST https://api.gradium.ai/api/post/speech/tts \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello, world!", "voice_id": "YTpq7expH9539ERJ", "output_format": "wav", "only_audio": true}' \
  > output.wav

Documentation Index

Fetch the complete documentation index at: https://docs.gradium.ai/llms.txt

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

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,
mulaw_8000,
alaw_8000,
pcm_8000,
pcm_16000,
pcm_22050,
pcm_24000,
pcm_44100,
pcm_48000
only_audio
boolean

When true, returns raw audio bytes instead of JSON

Response

Audio data returned successfully