Skip to main content
Keyterm prompting improves transcription accuracy for important terms and phrases by biasing the model toward transcribing them. It’s most useful for important or uncommon words and phrases, such as domain-specific terminology, brand or product names, and rare or invented words. Pass one or more terms with the keyterm query parameter when you open the WebSocket connection:
To pass multiple terms, repeat the keyterm parameter, one per term:
For a multi-word phrase, keep it in a single 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.
Connection URLs longer than about 8 KB are rejected with HTTP 414 before the WebSocket opens. A few hundred keyterms can pass that limit, especially non-Latin ones, which grow when URL-encoded. With ink-preview, connect with a few keyterms or none, then send the full list in a config message right away.

SDK usage

The Cartesia Python and TypeScript/JavaScript SDKs both take a keyterm 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.
The same keyterm argument is available on client.stt.manual_finalize.websocket(...) and on the async equivalents (AsyncCartesia).

Change keyterms mid-stream

With ink-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 keyterms and language_hints together. On Realtime STT (Auto), it can also change turn settings, 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 error event, nothing changes, and the connection stays open.
If the new list has too many keyterms, you get an error like this:
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