Authentication
Send a token as Authorization: Bearer <token>. Read API conventions.
Endpoints
| Method | Path | Purpose | Role |
|---|---|---|---|
| POST | /api/v1/transcribe | Transcribe an audio file | Any |
| GET | /api/v1/transcriptions | List transcriptions | Any |
| GET | /api/v1/transcriptions/history | Transcription history | Any |
| POST | /api/v1/transcriptions/compare | Compare two transcriptions | Any |
| POST | /api/v1/voice/dialect-detect | Estimate the Arabic dialect of a text | Any |
| POST | /api/v1/voice/chat | Send a spoken question. Returns the transcript and a text answer. | Any |
| GET | /api/v1/voice/conversations | List voice assistant conversations | Any |
| GET | /api/v1/voice/conversations/{conversation_id} | Get a voice assistant conversation | Any |
| POST | /api/v1/tts/synthesize | Turn text into speech. Returns audio. | Any |
| POST | /api/v1/tts/synthesize/json | Turn text into speech. Returns JSON with the audio. | Any |
| GET | /api/v1/tts/voices | List the voices | Any |
| GET | /api/v1/tts/history | Speech history | Any |
| GET | /api/v1/languages | List the languages and dialects | Any |
| GET | /api/v1/analytics | Usage analytics | Any |
| GET | /api/v1/health | Health check | None |
Transcribe a file
curl "https://voice.example.gov/api/v1/transcribe?language=ar" \
-H "Authorization: Bearer $TOKEN" \
-F "file=@call-0142.wav"
| Parameter | Where | Meaning |
|---|---|---|
file | Form | The audio file |
language | Query | ar, en or auto. The default is auto. |
model | Query | The 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
| Status | Cause |
|---|---|
| 400 | No file, a format that Voice does not support, or a file larger than 25 MB |
| 401 | The token is missing or not valid |