Keyterm prompting
How-to guide · Assumes you have completed the Speech to Text quickstart.
Overview
Keyterm prompting is available with Scribe v3, Scribe v3 Live, Scribe v2, Scribe v2 Medical (batch), and Scribe v2 Realtime, and comes at an additional cost. See the API pricing page for detailed pricing information.
Keyterm prompting is a feature that allows you to highlight words or phrases to bias the model towards transcribing them. This is useful for transcribing specific words or sentences that are not common in the audio, such as product names, names, or other specific terms. Keyterms are more powerful than biased keywords or customer vocabularies offered by other models, because it relies on the context to decide whether to transcribe that term or not.
In batch transcription, each keyterm can also contain at most 5 words.
For a larger realtime vocabulary, Scribe v3 Live also accepts a keyterm library of up to 10,000 terms.
For example, if your company name is not a common phrase or has a unique spelling or pronunciation you can use keyterms to ensure the model transcribes correctly. Take the following audio:
Without keyterm prompting, the model might transcribe the above as:
Which uses the wrong style for the company name. With keyterm prompting, you can ensure the model transcribes the above with the correct spelling and style:
Context
The model is able to use context to determine whether a term should be transcribed or not. When providing the keyterm “ElevenLabs”, the above audio transcribes as expected, yet the model will still be able to transcribe the following correctly based on the context:
Which outputs the following transcription:
Batch transcription
Keyterm prompting is integrated into the batch Speech to Text API by passing the keyterms parameter to the convert method.
Realtime streaming
Keyterm prompting is also available for the realtime Speech to Text WebSocket API. Pass the keyterms parameter when connecting.
When using the WebSocket API directly, pass keyterms as query parameters:
Keyterm library
The keyterm library is only available with Scribe v3 Live
(scribe_v3_live).
Keyterm prompting works best for a few terms you know will appear in the audio. A keyterm library is a large vocabulary for a whole domain, such as a medical dictionary, legal terms or a product catalog. The model consults the library only when it hears a likely match.
Send the library as keyterm_library in the first input_audio_chunk message of the session:
A keyterm library has the following limits:
- Up to 10,000 terms.
- Up to 50 characters per term.
- Up to 2 MB of text in total.
- Terms cannot be empty.
You can combine a keyterm library with the keyterms query parameter in the same session. Sessions that use either one are billed the keyterm prompting cost once.
keyterm_library is only accepted in the first input_audio_chunk of a session. Sending it in a
later chunk, or sending a library that exceeds the limits, returns an input_error and closes the
connection.
The official SDKs don’t support keyterm_library yet. To use it, connect to the WebSocket API
directly.