Speech to text
OpenAI-compatible transcription and translation over
multipart/form-data.
POST /v1/audio/transcriptions
Transcribes audio in its source language.
curl "$SONIX_URL/v1/audio/transcriptions" \
-H "Authorization: Bearer $SONIX_API_KEY" \
-F model="whisper-tiny" \
-F file=@meeting.wav
{ "text": "transcribed text" }
| Field | Required | Notes |
|---|---|---|
model | yes | A transcription-capable model ID. |
file | yes | The audio upload. WAV, or headerless PCM sent as audio/pcm or audio/L16. |
language | no | Source language hint. |
prompt | no | Context to guide the transcript. |
temperature | no | Sampling temperature. |
response_format | no | json (default), text, or verbose_json. |
timestamp_granularities[] | no | With verbose_json, adds words / segments arrays. |
srt and vtt formats are rejected until timestamped transcripts are
implemented.
Uploads must be WAV, or headerless PCM declared as audio/pcm or
audio/L16. Any other container — mp3, flac, m4a, ogg — is rejected with a
validation error naming file. Convert to 16 kHz mono WAV before sending.
POST /v1/audio/translations
Same shape, but translates the audio to English and rejects the
transcription-only fields (language, timestamp_granularities[]).
verbose_json responses carry task: "translate" alongside text.
curl "$SONIX_URL/v1/audio/translations" \
-H "Authorization: Bearer $SONIX_API_KEY" \
-F model="whisper-tiny" \
-F file=@bonjour.wav
{ "text": "translated text" }
