Skip to main content
All requests require authentication with a bearer token in the Authorization header: Authorization: Bearer YOUR_API_KEY. See API authentication for how to create a key.
Include modelId=coda in the connection query. If you omit it, the server routes the request to Mist v3 and speakers outside the Mist v3 catalog can fail with Speaker not found.

Overview

Rime’s websocket implementation accepts bare text, and responds with audio bytes of the selected format. All synthesis arguments are provided as query parameters when establishing the connection.

Messages

Send

The messages your client will send to the websocket API will be bare (non-serialized) text.

Receive

The messages your client will receive will be raw audio bytes in the audio format specified at connection time.

Commands

There will be times when you want to interact with the API and manipulate the stored buffer. These are the currently supported commands.

<CLEAR>

This clears the current buffer. Used in the event of interruptions.

<FLUSH>

This forces whatever buffer exists, if any, to be synthesized, and the generated audio to be sent over.

<EOS>

This forces whatever buffer exists, if any, to be synthesized, and for the server to close the connection after sending the generated audio.

Variable parameters

string
required
Must be a coda voice from the Rime voice catalog.
string
required
The text you’d like spoken. Character limit per request is 1,000 via the API and in the dashboard UI.
string
default:"mistv3"
Set this to coda. It is not strictly required, but if you omit it the server defaults to the Mist v3 backend, and speakers outside the Mist v3 catalog fail with a “Speaker not found” error.
string
One of mp3, ogg, mulaw, or pcm
string
default:"eng"
If provided, the language must match the language spoken by the provided speaker. Both the 2-letter ISO 639-1 and the 3-letter ISO 639-2/3 form are accepted:See the voices documentation for which speakers support each language.
int
default:"24000"
The sampling rate (Hz).
  • On-cloud: Accepted values: 8000, 16000, 22050, 24000, 44100, 48000, 96000. Anything above 24000 is up sampling.
  • On-prem: Any value is accepted.
string
default:"bySentence"
Controls how text is segmented for synthesis. Available options:
  • “immediate” - Synthesizes text immediately without waiting for complete sentences
  • “never” - Never segments the text, waits for explicit flush or EOS
  • “bySentence” (default) - Waits for complete sentences before synthesis
Note: For backward compatibility, setting immediate=true in query params is equivalent to segment=immediate. If a null value is provided, it will default to “bySentence”.