Transcript editing
This guide shows you how to apply natural-language edit instructions to committed transcripts with the Realtime Speech to Text API.
How-to guide · Assumes you have completed the client-side or server-side streaming guide.
Overview
Transcript editing is an experimental feature and adds a 30% premium to the base transcription cost, billed for at least 10 seconds of audio per committed transcript. See the API pricing page for detailed pricing information.
Realtime transcription can apply a natural-language edit instruction to every committed transcript, for example to write spoken dates in a fixed format or to expand abbreviations and acronyms. The instruction is passed once when the connection is opened, and each committed transcript is followed by a separate edited_transcript event with the edited text.
Partial transcripts are never edited. The committed_transcript event is not changed either, so existing integrations keep working when you turn the feature on.
Transcript editing cannot be combined with entity_detection. Connections that set both are
rejected with an invalid_request error.
Enabling transcript editing
Pass the instruction with the transcriptEdit option when connecting (the transcript_edit query parameter of the WebSocket API). The instruction can be up to 2000 characters long. See the batch transcript editing guide for guidance on writing instructions.
In all SDKs the edited transcripts arrive through the RealtimeEvents.EDITED_TRANSCRIPT event.
Client-side
Use @elevenlabs/client in the browser with a single-use token issued by your server, as described in the client-side streaming guide.
Server-side
Use the official SDK on your server, as described in the server-side streaming guide. Only the option and the event handler differ from that guide; sending audio and closing the connection work the same way.
Receiving edited transcripts
When enabled, each committed transcript is followed by an edited_transcript event carrying the committed text and its edited version:
Behavior to be aware of:
- Edits are applied per committed segment. The
edited_transcriptevent is emitted shortly after the correspondingcommitted_transcriptevent, since editing runs asynchronously. It may arrive after the next partial transcript, and edits for consecutive segments may arrive out of order. Use thetextfield to match an edit to its committed transcript. - If no edits were made to a segment,
edited_textis identical totext. - If an edit cannot be produced for a segment, no
edited_transcriptevent is sent for it. Thecommitted_transcriptevent is not affected. - Word-level timestamps in
committed_transcript_with_timestampsdescribe the original committed text, not the edited text.