Skip to main content
A
Docs

Voice API reference

Endpoints, request and response examples, and errors for the Voice API: transcription, live transcription, dialects and speech.

Authentication

Send a token as Authorization: Bearer <token>. Read API conventions.

Endpoints

MethodPathPurposeRole
POST/api/v1/transcribeTranscribe an audio fileAny
GET/api/v1/transcriptionsList transcriptionsAny
GET/api/v1/transcriptions/historyTranscription historyAny
POST/api/v1/transcriptions/compareCompare two transcriptionsAny
POST/api/v1/voice/dialect-detectEstimate the Arabic dialect of a textAny
POST/api/v1/voice/chatSend a spoken question. Returns the transcript and a text answer.Any
GET/api/v1/voice/conversationsList voice assistant conversationsAny
GET/api/v1/voice/conversations/{conversation_id}Get a voice assistant conversationAny
POST/api/v1/tts/synthesizeTurn text into speech. Returns audio.Any
POST/api/v1/tts/synthesize/jsonTurn text into speech. Returns JSON with the audio.Any
GET/api/v1/tts/voicesList the voicesAny
GET/api/v1/tts/historySpeech historyAny
GET/api/v1/languagesList the languages and dialectsAny
GET/api/v1/analyticsUsage analyticsAny
GET/api/v1/healthHealth checkNone

Transcribe a file

curl "https://voice.example.gov/api/v1/transcribe?language=ar" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@call-0142.wav"
ParameterWhereMeaning
fileFormThe audio file
languageQueryar, en or auto. The default is auto.
modelQueryThe speech-to-text model name to use

Response

{
  "id": "tr_8f21",
  "text": "...",
  "language": "ar",
  "duration": 42.7,
  "segments": [{"start": 0.0, "end": 4.2, "text": "..."}],
  "dialect": {"dialect": "gulf", "confidence": 0.71, "all_scores": {"gulf": 0.71, "msa": 0.18}},
  "created_at": "2026-11-18T09:30:00Z"
}

Live transcription

Open a WebSocket connection to /api/v1/transcribe/stream. Send the token as the token query parameter, because browsers cannot set headers on a WebSocket.

Send each part of the recording as one binary message. Each message must be a complete WAV clip. Voice transcribes each clip on its own and answers with JSON messages:

{"status": "processing"}
{"status": "completed", "text": "...", "language": "ar", "duration": 4.8, "segments": [...]}

On an error, Voice sends {"status": "error", "detail": "..."}.

Errors

StatusCause
400No file, a format that Voice does not support, or a file larger than 25 MB
401The token is missing or not valid