{}"finalize""close"{
"type": "transcript",
"is_final": true,
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8",
"text": "How are you doing today?",
"duration": 2.5,
"language": "en",
"words": [
{
"word": "How",
"start": 0,
"end": 0.12
},
{
"word": "are",
"start": 0.15,
"end": 0.25
},
{
"word": "you",
"start": 0.28,
"end": 0.35
},
{
"word": "doing",
"start": 0.38,
"end": 0.55
},
{
"word": "today?",
"start": 0.58,
"end": 0.78
}
]
}{
"type": "flush_done",
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8"
}{
"type": "done",
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8"
}{
"type": "error",
"title": "Invalid model",
"message": "The model is not valid, make sure it is a valid model ID.",
"error_code": "model_not_found",
"doc_url": "https://docs.cartesia.ai/build-with-cartesia/stt/latest",
"status_code": 400,
"request_id": "2ff8af53-4d38-479d-8287-58940f01c701"
}Realtime Speech-to-Text (Manual)
Realtime speech transcription without turn detection
This endpoint relies on the finalize command to trigger transcription. See Compare STT Endpoints for details.
{}"finalize""close"{
"type": "transcript",
"is_final": true,
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8",
"text": "How are you doing today?",
"duration": 2.5,
"language": "en",
"words": [
{
"word": "How",
"start": 0,
"end": 0.12
},
{
"word": "are",
"start": 0.15,
"end": 0.25
},
{
"word": "you",
"start": 0.28,
"end": 0.35
},
{
"word": "doing",
"start": 0.38,
"end": 0.55
},
{
"word": "today?",
"start": 0.58,
"end": 0.78
}
]
}{
"type": "flush_done",
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8"
}{
"type": "done",
"request_id": "b67e1c5d-2f4c-4c3d-9f82-96eb4d2f12a8"
}{
"type": "error",
"title": "Invalid model",
"message": "The model is not valid, make sure it is a valid model ID.",
"error_code": "model_not_found",
"doc_url": "https://docs.cartesia.ai/build-with-cartesia/stt/latest",
"status_code": 400,
"request_id": "2ff8af53-4d38-479d-8287-58940f01c701"
}Use an API key when you're calling from a trusted server.
Use a short-lived access token when calling from a browser or client app. Learn more here.
Send WebSocket binary messages containing raw audio data as specified by the encoding and sample_rate query parameters.
Audio Requirements:
- Send audio in small chunks, e.g. 100 ms
- Audio format must match the
encodingandsample_rateparameters
Send finalize as a text message when the user is done speaking to receive the transcript for any buffered audio.
finalizeSend close as a text message to flush remaining audio, close session, and receive a done acknowledgment
closeTranscript chunks.
You should send the finalize command after the user is done speaking to make the API emit these transcript chunks;
although, the API may send transcript chunks even before you send the finalize command.
Acknowledgment for the finalize command
Acknowledgment for the close command
Error information for STT WebSocket connections.
Was this page helpful?