Streaming profanity filtering lets you automatically mask profane words in your streaming transcripts in real time. When enabled, the API replaces profane words with asterisks in both partial and final turns before sending them to the client.
The mask uses the first letter of the word followed by n - 1 asterisks (for example, shit becomes s***). Apostrophes, capitalization, and surrounding punctuation are preserved (for example, shit's becomes s***'s).
Profanity filtering supports all streaming models: u3-rt-pro, universal-streaming-english, and universal-streaming-multilingual. It also works alongside other features such as format_turns and PII redaction.
For profanity filtering on pre-recorded audio, see Filter profanity from transcripts.
Get started with streaming profanity filtering using the code below. This example streams 16 kHz mono PCM audio from your microphone and prints each turn with profanity masked.
Profanity filtering applies to both partial and final turns, but during word-completion an unmasked partial can briefly appear before the model resolves the word and applies the mask. If your application surfaces partials directly to end-users (for example a live caption stream or voice-agent UI), set include_partial_turns: false on the connection to suppress all partial turns and only receive masked finals. The default is true (partials enabled), so this requires an explicit opt-out.
With filter_profanity=true, a final turn might look like:
The mask preserves word length, apostrophes, and surrounding punctuation, so a word like shit's is returned as s***'s and motherfucker becomes m***********.
Streaming profanity filtering works with all streaming models on both the US and EU endpoints:
u3-rt-prouniversal-streaming-englishuniversal-streaming-multilingualThe streaming filter targets the same word list as pre-recorded profanity
filtering and only masks words on that list. Some words you might consider
profane, such as crap and damn, are intentionally not masked and pass
through unchanged. If you need stricter filtering, apply your own
post-processing on top of the masked transcript.
Profanity masking applies during word classification, so an unmasked partial
can briefly appear before the word is fully recognized and masked. If your
UI surfaces partials directly to users, set include_partial_turns: false
on the connection. Final turns are always masked.