Skip to main content
Access the Flow WebSocket API

How it works

Connect:

Open a WebSocket connection to the server API-key endpoint: wss://platform-api.wisprflow.ai/api/v1/dash/ws?api_key=Bearer%20<YOUR_API_KEY> Client auth endpoint (Recommended): wss://platform-api.wisprflow.ai/api/v1/dash/client_ws?client_key=Bearer%20<CLIENT_KEY> We recommend using the client endpoint with client-side authentication to connect directly to our servers to lower latency.

Send Messages:

  • Start: Begin a new transcription session
  • Append: Send audio chunks sequentially, ideally 1-second chunks
Make sure the chunks you send are of the same duration. Varying durations can cause unexpected failures.

Receive Responses:

Partial and final results are returned during the session.
TYPEDESCRIPTIONExample
authAuthenticates the client with the server{ "type": "auth", "access_token": "..." }
appendSends a chunk of audio data and (optionally) metadata to the server{ "type": "append", "audio": "...chunk_audio...", "position": 0 }
commitMark the end of audio{ "type": "commit", "total_packets": 284 }
Once connected, the first message you send must be a start message, with any API properties you’d like to pass in. After receiving confirmation that the session started, you can send multiple chunks of audio data. You must stream base64-encoded single-channel 16-bit (int16) PCM wav data sampled at 16 KHz. When you finish sending all audio chunks, you MUST send a commit message that includes the total number of audio chunks sent.

Step-by-Step Guide

Establish WebSocket Connection

Connect to the WebSocket server using your API key:

Start a Session

Send a start message to initialize the transcription session:
Upon successful authentication, the server will respond with an "auth" message.

Stream Audio

Send audio chunks using append messages. Ensure each chunk is Base64-encoded and includes a sequential chunk_number:
If you send 4 packets in the first and second append messages, the third append message must have position: 8

Receive Final Transcription

When all audio chunks have been sent, send a final append message with final: true:

Responses

Connection Authenticated

Commit Acknowledgement

Partial Transcriptions

Final Transcription

Network Optimization

To reduce the message size being sent over the network, instead of encoding binary data (audio and screenshot) using base64, you can serialize the message into the MessagePack format and send as binary data. To enable binary transmission mode, add the following field to the websocket header:
Also, set byte_encoding: "binary" in the append messages.
When binary transmission mode is activated, the responses received over the websocket will also be serialized using MessagePack and will need deserialization by the client.