Overview
The WebSocket Secure (WSS)/transcribe
API enables real-time, bidirectional communication with the Corti system for stateless speech-to-text. Clients can send and receive structured data, including transcripts and detected commands.
This documentation provides a comprehensive guide for integrating these capabilities.
This
/transcribe
endpoint supports real-time stateless dictation.- If you are looking for real-time ambient documentation interactions, you should use the /stream WSS
- If you are looking for asynchronous transcript generation as part of an interaction, then please refer to the /transcripts endpoint
Environment Options
Environment | Description |
---|---|
us | US-based instance |
eu | EU-based instance |
Establishing a Connection
Clients must initiate a WebSocket connection using thewss://
scheme.
The authentication for the WSS stream requires in addition to the
tenant-name
parameter a token
parameter to pass in the Bearer access token.Query Parameters
Specifies the tenant context
Bearer $token
Using SDK
You can use the Corti SDK (currently in “beta”) to connect to the /transcribe endpoint.
Handshake Response
101 Switching Protocols
Indicates a successful WebSocket connection. Upon successful connection, send a message including the configuration to specify the input and expected output formats.Sending Messages
Clients must send a stream configuration message and wait for a response of typeCONFIG_ACCEPTED
before transmitting other data.
If the configuration is not valid it will return CONFIG_DENIED
.
The configuration must be committed within 10 seconds of opening the WebSocket, else it will time-out with CONFIG_TIMEOUT
.
Basic Stream Configuration
The locale of the primary spoken language. See supported languages codes and more information here.
When true, returns interim results with reduced latency than final results. Interim (preview) results are indicated by
isFinal=false
in the stream response.Preview (interim) results feature is currently in
beta
status. API details and availability subject to change. Read more about this feature here.When true, converts spoken punctuation such as
period
or slash
into .
or /
. Read more about supported punctuation here.When true, automatically punctuates and capitalizes in the final transcript.
Automatic punctuation feature is currently in
beta
status. API details and availability subject to change.Advanced Stream Configuration
Commands
The transcribe endpoint supports registration and detection of commands, common in dictation workflows. Read more about commands here. Extend the configuration with the following parameters to register commands that should be detected.Provide the commands that should be registered and detected
Configuration example
Using SDK
You can use the Corti SDK (currently in “beta”) to send configuration.
Formatting
The transcribe endpoint provides the option to configure formatting preferences. Read more about formatting here. Extend the configuration with the following parameters to apply formatting that should be used when returning text output.Formatting functionality is currently in
beta
status. API details subject to change ahead of general release.Defining formatting configuration is optional
. When these preferences are not configured, the default
values listed below will be applied automatically.Define each type of formatting preferences using the
enum
options described belowConfiguration example with formatting
Sending audio
Raw audio data to be transcribed.Using SDK
You can use the Corti SDK (currently in “beta”) to send audio data.
Ending
To end the /transcribe session send atype: end
.
This will signal the server to send any remaining transcript segments and detected commands before the server sends a usage message
ended
, and then closes.
Using SDK
You can use the Corti SDK (currently in “beta”) to end the /transcribe session.
connect
),
the socket will close itself without reconnecting when it receives an ENDED
message.
When using manual configuration, the socket will attempt to reconnect after the server closes the connection. To prevent this,
you must subscribe to the ended
message and manually close the connection.
Responses
Configuration
Returned when sending a valid configuration.
Returned when sending a valid configuration.
Transcripts
Commands
Command response
Using SDK
You can use the Corti SDK (currently in “beta”) to subscribe to responses from the /transcribe endpoint.
Error Responses
Returned when sending an invalid configuration.Possible errors
CONFIG_DENIED
, CONFIG_TIMEOUT
The reason the configuration is invalid.
The session ID.
usage
and type ENDED
.
Using SDK
You can use the Corti SDK (currently in “beta”) to handle error messages.
CONFIG_DENIED
, etc.) and runtime errors will both trigger the error
event and automatically close the socket. You can also inspect the original message in the message
handler. With manual configuration, configuration errors are only received as messages (not as error
events), and you must close the socket manually to avoid reconnection.