Skip to main content
WSS
bearerAuth
type:http

Telnyx API v2 Bearer token authentication.

query
type:object

Query parameters passed when opening the WebSocket connection.

Audio Frame
type:string

Client-to-server binary frame with raw mono PCM audio, in the format and sample_rate set on the connection. No container and no WAV header. The frame must contain a whole number of samples (a multiple of 2 bytes for l16, 4 bytes for f32le) and must not exceed 65,536 bytes. 20 ms chunks are a good default.

End of Stream
type:object

Client-to-server text frame. Send it when you have no more audio. The server returns all remaining audio, including the audio held back by the model's processing delay, as one final binary frame, then closes with code 1000. If you close the connection without it, the end of your stream is lost. Any other text frame gets an unsupported_message error frame and the session continues.

Denoised Audio Frame
type:string

Server-to-client binary frame with denoised audio, in the same format and sample_rate as the input. The model processes fixed-size internal frames and has a short processing delay, so a frame can be smaller or larger than the matching input frame, or empty. Ignore empty frames. Over the session, total output equals the input length plus the processing delay.

Error Frame
type:object

Server-to-client text frame. If the error ends the session, the server closes the connection right after this frame, with the close code listed below and the error code as the close reason.

  • invalid_params (close 1008): a query parameter has an unsupported value.
  • max_session_duration (close 1008): the session reached the 590-second limit. The remaining audio is returned first.
  • server_shutdown (close 1001): the server is restarting. The remaining audio is returned first. Reconnect with backoff.
  • session_error (close 1011): the server could not start the noise suppression session.
  • processing_error (close 1011): the noise suppression engine failed.
  • encode_error (close 1011): the server could not encode the denoised audio.
  • max_connections (close 1013): the server has too many open sessions. Try again later.
  • overloaded (close 1013): the server is overloaded and does not accept new sessions. Try again later.
  • chunk_too_large (session continues): the binary frame is larger than 65,536 bytes. The chunk is dropped.
  • decode_error (session continues): the frame length is not a whole number of samples. The chunk is dropped.
  • unsupported_message (session continues): the text frame is not a supported message.