Live sessions
Start a live session
Opens a WebSocket that takes your audio and sends back partial and final text as it is spoken.
Serverwss://api.eu.vatis.tech
WS/v1/speech-to-text/realtime
A live session has no form here: the console's Real-time page runs one.
model_id (required)
The real-time model: List models lists those your workspace can use. Missing, or one not listed:
invalid_parameter.Values
vatis_ro_v9_realtimeInstead of the
Authorization header, for a web page (Create a token). An empty one counts as not sent.Valuesa single-use
realtime tokenThe audio you send, mono, or two channels with
multichannel: Audio formats.Values
pcm_s16le, pcm_f32le, mulaw, alawDefaultpcm_s16leThe audio's sample rate, in Hz. The API converts every rate to 16 kHz.
Values
pcm_s16le, pcm_f32le: 8000, 16000, 22050, 24000, 44100, 48000; mulaw, alaw: 8000Default16000; mulaw, alaw: 8000What ends a segment: a pause (
vad), your commit message (manual), or the end of the speaker's turn (turn): Partial and final text. turn is for Romanian models only (else invalid_parameter, param commit), and each final then says what ended it in end_reason: End of turn.Values
vad, manual, turnDefaultvadWith
vad: the pause, in seconds, that ends a segment. A shorter one gives faster finals, but cuts more of them in the middle of a sentence. With turn: the longest pause, after which a segment ends whatever the speaker sounds like.Values0.2 to 3.0Default1.5
Only with
commit=turn (else invalid_parameter, param turn_sensitivity). Higher answers sooner, and cuts more pauses inside a sentence; lower waits until the speaker sounds more clearly finished.Values0.0 to 1.0Default0.5
Values
true, falseDefaultfalseThe number of speakers, when you know it. Only with
diarize=true (else invalid_parameter).Values1 to 8
Only with
diarize=true (else invalid_parameter). true: a final comes as soon as its text is done, and its speakers follow in a final.speakers message: The text first, its speakers after.Values
true, falseDefaultfalseThe audio has two channels, interleaved, each transcribed on its own; the channel is the speaker. Counts as 2 live sessions. Not with
diarize: Two-channel calls.Values
true, falseDefaultfalsePunctuation and capitals in final text, and in the finished part of a partial.
false: lowercase words without punctuation.Values
true, falseDefaulttrueNumbers in final text as digits, with times and units in their short form (
30, 3:30, 70km/h). words: in words (treizeci). The words being spoken in a partial have numbers in words either way.Values
digits, wordsDefaultdigitsNames, dates and the like. Given as
true, each word of a final carries entity, the kind found or null (words come with timestamps=true). false turns the marking off.Values
true, falseDefaultthe value of punctuationA saved list of names and terms to get right, in effect from the first word (Vocabularies). An id that names no vocabulary of your workspace:
invalid_parameter, message vocabulary_id: no vocabulary with this id.Valuesa vocabulary id,
voc_...How hard the service leans towards the vocabulary's entries, of both lists. Higher finds more of them, and also writes more of them where they were not said (Strength).
Values0 to 2, a decimal numberDefault
1.0Repeated in
session.started, for your own logs.Valuesat most 200 printable characters
false: nothing about the session is kept but its usage. Its Activity row has no id, model or key (List activity).Values
true, falseDefaulttrue- You receive
session.startedonce the session is ready. A refused session gets oneerrormessage instead, then the server closes. - You send audio in binary frames, at the pace of real time: 100 ms a frame gives the lowest latency, and 1 s is the most a frame can hold (Sending audio).
- You receive
partialwhile a segment is spoken, each one replacing the last, andfinalwhen the segment ends (Partial and final text). Withspeaker_updates=true, each final's speakers follow in afinal.speakers. Withcommit=turn, each final carriesend_reason:turnwhen the speaker sounded finished (End of turn). - You can send
{"type": "commit"}to end the segment now, and{"type": "ping"}while the source is paused. The server answers a ping with{"type": "pong"}.{"type": "vocabulary", "entries": [...]}sets the session's own vocabulary entries, answered withvocabulary.applied(Vocabularies). - You send
{"type": "end"}when the audio is over. The lastfinalmessages come, thensession.ended, then the server closes with 1000 (Ending a session).
Every field of every message: Messages you send and Messages you receive.
The WebSocket opens, and a good session starts with
session.started. Every refusal comes after this point, as an error message and a close code, so a browser can read the reason too (Errors in a session).1000
The normal end, after your
end and session.ended.A query parameter that is unknown, empty, not supported or out of range (
param names it), one sent without the one it needs (turn_sensitivity without commit=turn), commit=turn with a model that is not Romanian, a vocabulary_id that names no vocabulary of your workspace, a vocabulary message with a bad entry (param entries[3]), or a text message the server does not know (param type).Every live session your workspace may have open is in use (a two-channel session needs 2), or there is no free capacity for a new session. A workspace runs 10 at a time (Work at once).
An
error before session.started, or in an open session about a minute after the pause, after its last finals: the workspace is paused, its credit used up or over its hourly spend limit. The message says which (While a workspace is paused).1008 idle_timeout
15 s without any message or audio. While your source is paused, send silence or
{"type": "ping"}.1008 session_time_limit
The session reached the longest a session runs: 4 hours. Its last finals come before the error. Open a new session to go on.
1009 audio_chunk_too_large
A frame of more than 1 s of audio. Send smaller frames: 100 ms is best.
1009
A WebSocket message over 1 MiB closes the connection at once, without an error message.
1011 transcriber_error
The speech service or speaker separation failed, was not available at the start, or did not finish within 30 s of your
end. The close code is 1012 when a speech service stopped for an update.1011 internal_error
An error on our side, or a saved vocabulary (
vocabulary_id) that cannot be read for a moment. Connect again in a few seconds.The service restarts, for an update. The
final messages of all the audio it received come first, and resume_s says from which second to send the audio again (Reconnect after a restart).1006
No error message: the connection dropped, or it failed before the WebSocket opened (a wrong host or path).
- Example address:
wss://api.eu.vatis.tech/v1/speech-to-text/realtime?model_id=vatis_ro_v9_realtime&sample_rate=16000×tamps=true&diarize=true - Booleans are
trueorfalse(also1or0). - Strict query: an unknown parameter or an empty value is refused with
invalid_parameter, message<name>: unknown parameteror<name>: empty, andparamnames it (Strict parameters). An emptytokencounts as not sent. A parameter given twice takes the last value. session.startedrepeats every parameter as applied, inconfig, without the token. Withvocabulary_idorvocabulary_strengthit also hasvocabulary_entries, the saved vocabulary's entries when the session started, never the entries themselves. Withcommit=turnit hasturn_sensitivitytoo,"commit": "turn", "turn_sensitivity": 0.5(the key is absent in other modes).multichannel: every message and word carrieschannel(0,1) and the speakerchannel_0orchannel_1. Withdiarizeit isinvalid_parameter(paramdiarize). It needs 2 of your workspace's live sessions free.- Romanian only on the cloud for now: an English model is not listed yet (Not in this release).
- No transcript is kept of a live session: keep the finals you receive. The session counts as usage when it ends, the audio it received (Get usage).
- A session that ends early (a restart, a dropped connection) can go on in a new one, from where its finals end: Reconnect after a restart.