Audio

Text-to-speech and speech-to-text, both synchronous and OpenAI-compatible.

Text to speech#

POST/v1/audio/speech

Synthesizes speech from text and returns the raw audio bytes.

FieldTypeDescription
modelrequiredstringA TTS model id (e.g. tts-1).
inputrequiredstringThe text to speak.
voicestringVoice name (provider-dependent), e.g. alloy.
speednumberPlayback speed factor. Default 1.0.
response_formatstringmp3 (default), wav, opus, aac, flac, pcm.
bash
curl https://api.studio.whalli.com/v1/audio/speech \
  -H "Authorization: Bearer $WHALLI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "tts-1", "input": "Hello from Whalli!", "voice": "alloy" }' \
  --output speech.mp3
The response body is binary audio (e.g. audio/mpeg), not JSON. Write it straight to a file.

Speech to text#

POST/v1/audio/transcriptions

Transcribes an audio file to text. Send the file as multipart/form-data(max 25 MB).

FieldTypeDescription
modelrequiredstringAn STT model id (e.g. whisper-1).
filerequiredfileThe audio file to transcribe.
languagestringISO-639-1 hint, e.g. en, fr.
response_formatstringjson (default) or text.
bash
curl https://api.studio.whalli.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $WHALLI_API_KEY" \
  -F model=whisper-1 \
  -F file=@audio.mp3
json
{ "text": "transcribed words go here" }