Skip to main content
WSS wss://api.aircaps.com/v1/realtime Requires access to A5S v2 Streaming. For a walkthrough, see Live streaming.

Connection

string
required
Bearer aircaps_sk_..., sent with the WebSocket handshake.
The flow: connect, send start, wait for ready, stream binary audio, send finish, then receive finished. The server then closes with 1000.

Client messages

start

The first message, as a JSON text frame.
string
required
"start"
string
default:"en-US"
Language of the audio. English only today: en or a regional variant (en-US, en-GB, en-AU, en-CA, en-IN, en-IE, en-NZ, en-ZA). Any other value is refused with unsupported_language. Multilingual support is planned.
string
default:"pcm_s16le"
Only pcm_s16le (signed 16-bit little-endian PCM).
integer
default:"16000"
Only 16000.
integer
default:"1"
Only 1 (mono).
string[]
default:"[\"a5sv2\"]"
The streaming engine. Only "a5sv2".
boolean
default:"false"
Bias recognition toward custom_vocabulary.
object[]
Up to 64 terms.
Example

Audio

Binary frames of raw PCM in the start format. Send them after ready, in real time; a 2-second burst is allowed. 20 ms frames (640 bytes) are recommended. A frame can be at most 64 KB.

ping

{"type": "ping"}. The server answers pong.

finish

{"type": "finish"}. The server flushes the final transcript, sends finished, and closes.

Server messages

Each is a JSON text frame with a type.

provider_status

Startup progress. Starting capacity can take up to about a minute after a quiet period.
string
For example "Getting things ready, please hold on (1 min)".

ready

Start sending audio.
integer
Maximum audio for this session: 5 minutes, or less if little usage remains.
integer
The account’s usage limit, in milliseconds.
integer
Usage so far, in milliseconds.
string
"en-US"
integer
16000
string
"pcm_s16le"

transcript

string
The complete transcript so far, punctuated and cased. Replace what you display instead of appending.
boolean
true when the current segment is settled.
string
"a5sv2"
Example

session_limit

The session reached 5 minutes or the account’s usage limit. The final transcript and finished follow.
string
Why the session ended.

finished

integer
Audio received.
integer
Audio counted toward usage.
integer
Account usage after this session.
integer
The account’s usage limit.

error

Sent just before the server closes the connection.
string
One of the codes below.
string
Human-readable detail.

pong

The reply to ping.

Close codes