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.| TYPE | DESCRIPTION | Example |
|---|---|---|
| auth | Authenticates the client with the server | { "type": "auth", "access_token": "..." } |
| append | Sends a chunk of audio data and (optionally) metadata to the server | { "type": "append", "audio": "...chunk_audio...", "position": 0 } |
| commit | Mark the end of audio | { "type": "commit", "total_packets": 284 } |
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:"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: 8Receive Final Transcription
When all audio chunks have been sent, send a final append message withfinal: 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: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.