keyterm query parameter when you open the WebSocket connection:
keyterm parameter, one per term:
keyterm value and encode spaces as %20:
keyterms also works as the parameter name.
How many keyterms you can pass per connection depends on the model:
Exact duplicates are dropped before counting.
Keyterms work on both Realtime STT (Manual) and Realtime STT (Auto). With
ink-2, you set them when you connect, and they last for the whole connection. With ink-preview, you can also change them mid-stream.SDK usage
The Cartesia Python and TypeScript/JavaScript SDKs both take akeyterm argument on their STT WebSocket clients. Pass a list with one entry per term or phrase. The SDK adds each one to the URL for you.
- Python
- TypeScript
keyterm argument is available on client.stt.manual_finalize.websocket(...) and on the async equivalents (AsyncCartesia).Change keyterms mid-stream
Withink-preview, send a config message to change keyterms without reconnecting. This works on both realtime endpoints:
- The new list replaces the old one. Send
[]to clear it, or leave the field out to keep the current list. - One message can change
keytermsandlanguage_hintstogether. On Realtime STT (Auto), it can also changeturnsettings, on any model. - The change takes effect right away, so it also applies to words not returned yet. Those can include speech from just before the message.
- The message is checked against the same limits as at connect time. There’s no reply when it works. If anything is wrong, you get an
errorevent, nothing changes, and the connection stays open.
ink-2 doesn’t support changing keyterms mid-stream. It returns an error event and keeps the keyterms you connected with.
Send keyterms before the caller starts speaking: in the URL, or in a config message right after you connect. If you change them later in the call, a name the model already misheard can still come back the same way.
Best practices
- Add important or uncommon words and phrases
- Leave out common words such as “the” and “and”
- Keep the list short. Accuracy is strongest when it holds only the terms you expect in this conversation
- Spell each keyterm exactly as it should appear, capitals included