Speech to text over WebSocket
Changed onOpen a WebSocket connection to stream audio and receive transcriptions in real-time. Authentication is provided via the standard Authorization: Bearer <API_KEY> header.
Supported engines: Azure, Deepgram, Google, Telnyx, xAI, Speechmatics, Soniox, Parakeet, Humain, Reson8, Cohere.
Connection flow:
- Open WebSocket with query parameters specifying engine, input format, and language.
- Send binary audio frames (mp3, wav, linear16, or linear32 format, per input_format).
- Receive JSON transcript frames with transcript, is_final, and confidence fields.
- Close connection when done.
Request
- Base URL: wss://api.telnyx.com/v2
- URL: wss://api.telnyx.com/v2/speech-to-text/transcription
- Auth: HTTP bearer
Query parameters
The transcription engine to use for processing the audio stream.
The format of input audio stream.
Audio sample rate in Hz. Required when input_format is a raw encoding (linear16, linear32) — those formats carry no header metadata. Ignored for container formats (mp3, wav), which self-describe their rate. speechmatics/linden-1 accepts only 16000.
The language spoken in the audio stream. For cohere/ar-stt, this must be ar or en — unlike other engines, Cohere does not auto-detect the language, and rejects unsupported values including auto; omitting it defaults to ar. For speechmatics/linden-1, omitting it defaults to en; auto, auto_beta, multi, or a language outside its supported list is rejected when the connection is established. speechmatics/linden-1 also accepts en-US, en-GB, en-AU, cmn-Hans, and cmn-Hant, which select the spelling or script variant (en alone uses the default spelling).
Whether to receive interim transcription results.
The specific model to use within the selected transcription engine.
Silence duration (in milliseconds) that triggers end-of-speech detection. When set, the engine uses this value to determine when a speaker has stopped talking. Supported by xAI, Deepgram, Google, Speechmatics (speechmatics/standard only; speechmatics/linden-1 uses fixed service-side voice activity detection and ignores it), and Soniox. Soniox accepts values between 500 and 3000. Other engines may not support this parameter.
Enable redaction of sensitive information (e.g., PCI data, SSN) from transcription results. Supported values depend on the transcription engine.
A key term to boost in the transcription. The engine will be more likely to recognize this term. Can be specified multiple times for multiple terms.
Comma-separated list of keywords to boost in the transcription. The engine will prioritize recognition of these words.
Request body application/octet-stream
Binary audio data in mp3, wav, linear16, or linear32 format, per input_format.
Response
WebSocket upgrade successful — this response is not returned directly. See 101 for frame documentation.
Changes
- info
added the enum value
speechmatics/linden-1to the propertyoneOf[speechmatics_models]/of thequeryrequest parametermodel
- info
- info
added the enum value
omi-health/omi-med-stt-v1to the propertyoneOf[parakeet_models]/of thequeryrequest parametermodel
- info