Skip to main content
This guide shows how to authenticate with Corti and run your first real-time dictation session using the /transcribe WebSocket endpoint.
1

Authentication

See details here
2

Open a `/transcribe` WebSocket

Base URL: wss://api.$environment.corti.app/audio-bridge/v2/transcribeRequired query parameters:
  • tenant-name
  • token (URL-encoded Bearer <access_token>)
Full URL template:
Example:
JavaScript
3

Send configuration

After the wss connection is opened, send a config message within 10 seconds or the server closes the socket with CONFIG_TIMEOUT.Example configuration message:
Send the configuration as soon as the socket opens:
JavaScript
Wait for a message with {"type": "CONFIG_ACCEPTED"} before sending audio. If you receive CONFIG_DENIED or CONFIG_TIMEOUT, close the socket and fix the configuration.
4

Real-Time Stateless Dictation

Send audio frames

Send audio as binary WebSocket messages. See details on supported audio formats here.
Send continuous stream of 250ms audio chunks while recording is active - no overlapping frames.

Handle responses

The server sends messages with different type values, for example:
Basic message handler:
JavaScript
5

Flush the audio buffer (optional)

Use flush to force pending transcript segments and/or dictation commands to be returned, without closing the session. This is useful to separate dictation into logical sections.
Wait for type: "flushed" before treating the section as complete.
6

End the session

Send end when you are done sending audio:
The server then:
  1. Emits any remaining transcript or command messages.
  2. Sends usage info, for example:
  1. Sends:
  1. Closes the WebSocket.
You can also close the client socket explicitly after receiving ended:
7

Basic end-to-end example