id
and the GET /v2/live/:id endpoint to obtain the status and results.
Why initiate with POST instead of connecting directly to the WebSocket?
Why initiate with POST instead of connecting directly to the WebSocket?
- Security: Generate the WebSocket URL on your backend and keep your API key private. The init call returns a connectable URL and a session
id
that you can safely pass to web, iOS, or Android clients without exposing credentials in the app. - Lower infrastructure load: The secure URL is generated on your backend, the client can connect directly to Gladia’s WebSocket server without a pass-through on your side, saving your own resources.
- Resilient reconnection and session continuity: If the WebSocket disconnects (which can happen on unreliable networks), the session created by the init call lets the client reconnect without losing context. Traditional flows that open a socket first typically force a brand‑new session on disconnect, dropping in‑progress state.
Authorizations
Your personal Gladia API key
Query Parameters
The region used to process the audio.
us-west
, eu-west
Body
The encoding format of the audio stream. Supported formats:
- PCM: 8, 16, 24, and 32 bits
- A-law: 8 bits
- μ-law: 8 bits
Note: No need to add WAV headers to raw audio as the API supports both formats.
wav/pcm
, wav/alaw
, wav/ulaw
The bit depth of the audio stream
8
, 16
, 24
, 32
The sample rate of the audio stream
8000
, 16000
, 32000
, 44100
, 48000
The number of channels of the audio stream
1 <= x <= 8
Custom metadata you can attach to this live transcription
{ "user": "John Doe" }
The model used to process the audio. "solaria-1" is used by default.
solaria-1
, solaria-2
The endpointing duration in seconds. Endpointing is the duration of silence which will cause an utterance to be considered as finished
0.01 <= x <= 10
The maximum duration in seconds without endpointing. If endpointing is not detected after this duration, current utterance will be considered as finished
5 <= x <= 60
Specify the language configuration
Specify the pre-processing configuration
Specify the realtime processing configuration
Specify the post-processing configuration
Specify the websocket messages configuration
If true, messages will be sent to configured url.
Specify the callback configuration
Response
The live job has been initiated
Id of the job
"45463597-20b7-4af7-b3b3-f5fb778203ab"
Creation date
"2023-12-28T09:04:17.210Z"
The websocket url to connect to for sending audio data. The url will contain the temporary token to authenticate the session.
"wss://api.gladia.io/v2/live?token=4a39145c-2844-4557-8f34-34883f7be7d9"