The STREAM API uses websockets to perform real-time transcription and clinical notes generation from media capture devices.
General specifications
Example operation:
{ "object": "stop"}
.Server API called from backend application
User API called from frontend application
Send messages to the API
Accepts one of the following messages:
Stream and response config to setup API.
(Sent from the app to the Scribe API) This is the first message sent to the websocket API to configure the stream as well as the transcription/note generation settings.
{
"object": "stream_request",
"output_objects": "transcript",
"streams": [
{
"id": "string",
"speaker": "provider"
}
],
"sample_rate": 0,
"language": "en-US",
"note_template": "soap",
"style": "paragraph",
"transcribe_gen_mode": "fast",
"note_gen_mode": "fast"
}
Small audio segment for transcription/note-generation.
(Sent from the app to the Scribe API) Short audio chunk payload of an audio track from the consultation. Max duration 1s.
{
"object": "audio_chunk",
"payload": "wac=aasdZawvewad234141",
"stream_id": "stream1"
}
To notify stream stoppage.
(Sent from the app to the Scribe API) End audio stream and ask Scribe to return the clinical note and close the websocket.
{
"object": "stop"
}
Messages that you receive from the API
Accepts one of the following messages:
A segment of the ongoing transcript (sent piece-wise)
(Sent from the Scribe API to the app) A segment of the ongoing transcript. Usually, it's the sentence currently spoken, derived from the most recent audio segments sent. This sentence might be partial because transcription continues as we get audio segments. Update the earlier transcript entry with the identical ID until "is_final" is set to true.
{
"object": "transcript_item",
"id": "string",
"text": "string",
"speaker": "provider",
"start_offset_ms": 0,
"end_offset_ms": 0,
"is_final": true
}
Clinical note response
(Sent from the Scribe API to the app) Clinical note generated from the consultation
{
"object": "transcript_item",
"id": "string",
"is_final": true,
"sections": [
{
"sec_title": "SOAP_SUBJECTIVE",
"sec_heading": "string",
"sec_text": "string"
}
]
}
Time left in seconds until the stream limit (1 hour) is reached.
(Sent from the Scribe API to the app) Time left in seconds until the stream limit (1 hour) is reached. Countdown starts at 60s.
{
"object": "duration_limit",
"remaining_sec": 0
}
Error Message
(Sent from the Scribe API to the app) Error Message received from the API
{
"object": "error_msg",
"message": "string"
}
Stream and response config to setup API.
(Sent from the app to the Scribe API) This is the first message sent to the websocket API to configure the stream as well as the transcription/note generation settings.
Small audio segment for transcription/note-generation.
(Sent from the app to the Scribe API) Short audio chunk payload of an audio track from the consultation. Max duration 1s.
To notify stream stoppage.
(Sent from the app to the Scribe API) End audio stream and ask Scribe to return the clinical note and close the websocket.
A segment of the ongoing transcript (sent piece-wise)
(Sent from the Scribe API to the app) A segment of the ongoing transcript. Usually, it's the sentence currently spoken, derived from the most recent audio segments sent. This sentence might be partial because transcription continues as we get audio segments. Update the earlier transcript entry with the identical ID until "is_final" is set to true.
Clinical note response
(Sent from the Scribe API to the app) Clinical note generated from the consultation
Time left in seconds until the stream limit (1 hour) is reached.
(Sent from the Scribe API to the app) Time left in seconds until the stream limit (1 hour) is reached. Countdown starts at 60s.
Error Message
(Sent from the Scribe API to the app) Error Message received from the API