Speech to Text
Transcribe Arabic audio — batch over REST and realtime over WebSocket (preview).
قريباً · Preview
واجهة تفريغ الكلام في مرحلة المعاينة. الحقول أدناه مبنية على عقدٍ مبدئي وقد تتغيّر قبل الإصدار العام. لا تبنِ اعتماداً إنتاجياً على تفاصيلها بعد.
The STT contract below is a preview built against an assumed contract and may
change before general availability. Billing authority (decoded audio_seconds) and
the public shape are committed; field-level details may still move.
ASAS STT transcribes Arabic audio, including Gulf dialects and MSA. Short audio is transcribed synchronously; long audio becomes an async job whose result is delivered by webhook. A realtime WebSocket streams partial and final results as you speak.
Endpoints
| Endpoint | Shape | Use it for |
|---|---|---|
POST /v1/stt/transcriptions | Multipart upload → sync (short) or job (long) | Files, recordings |
GET /v1/stt/jobs/{id} | Job status + result | Polling long transcriptions |
WS /v1/stt/realtime | WebSocket, binary audio in / JSON results out | Live captioning, dictation |
Batch transcription
Upload an audio file (WAV/MP3/M4A). Short audio returns the transcript directly;
long audio returns 202 with a job_id.
curl https://api.asas.flitc.tech/v1/stt/transcriptions \
-H "Authorization: Bearer $ASAS_API_KEY" \
-F file=@meeting.mp3 \
-F language=ar \
-F diarize=trueSynchronous response (short audio):
{
"text": "النص الكامل للتفريغ…",
"language": "ar",
"duration_seconds": 63.4,
"segments": [
{ "id": 0, "start": 0.0, "end": 4.2, "text": "…", "confidence": 0.94, "speaker": "spk_0" }
]
}For long audio you get a job, then subscribe to the
job.completed webhook (or poll GET /v1/stt/jobs/{id}) instead
of holding a request open.
Parameters
| Field | Type | Notes |
|---|---|---|
file | file | Required. The audio to transcribe. |
language | string | Default auto. ISO-639 code such as ar. |
diarize | boolean | Speaker labels on segments. Default false. |
word_timestamps | boolean | Per-word timings. Default false. |
Realtime WebSocket
Open a socket (authenticate with a ws-token),
send a JSON start frame, then stream binary PCM audio. You receive partial
(mutable) and final (committed) result frames.
// client → server
{ "type": "start", "encoding": "pcm_s16le", "sample_rate": 16000, "language": "ar", "interim_results": true }// server → client
{ "type": "final", "text": "…", "start": 0.0, "end": 4.2, "duration_so_far": 4.2 }Send { "action": "keepalive" } during silence, and { "action": "close_stream" }
to finalize. The server replies with a completed frame carrying the authoritative
duration_seconds.
Billing
STT bills by decoded audio_seconds, reported by the engine — never by the
bytes or sample rate you declare. Streams are metered in checkpoints (roughly every
30–60 seconds of audio) with a final true-up on completion, so a dropped connection
loses at most one checkpoint. Failed jobs and upstream errors are not billed.