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.
| Field | Type | Description |
|---|---|---|
modelrequired | string | A TTS model id (e.g. tts-1). |
inputrequired | string | The text to speak. |
voice | string | Voice name (provider-dependent), e.g. alloy. |
speed | number | Playback speed factor. Default 1.0. |
response_format | string | mp3 (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.mp3The 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).
| Field | Type | Description |
|---|---|---|
modelrequired | string | An STT model id (e.g. whisper-1). |
filerequired | file | The audio file to transcribe. |
language | string | ISO-639-1 hint, e.g. en, fr. |
response_format | string | json (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.mp3json
{ "text": "transcribed words go here" }