Skip to main content
Modulate offers two approaches to PII/PHI handling depending on what you need: The examples on this page use the Redaction APIs.

Batch

Send a complete audio file. The response is multipart/form-data with two parts: metadata (JSON transcript) and audio (redacted MP3).
Install requests-toolbelt to decode the multipart response: pip install requests-toolbelt.
Marker tags in the transcript (<pii:name></pii:name>, <pii:ssn></pii:ssn>, <phi></phi>, etc.) correspond directly to the silenced redaction_ranges in the audio. Each detected span is replaced with an empty marker tag: <phi></phi> for health information and <pii:CATEGORY></pii:CATEGORY> for personal information, with the surrounding text preserved. Batch accepts common audio formats (MP3, WAV, FLAC, MP4, OGG, and more) — see Audio formats.

Streaming (WebSocket)

Connect over WebSocket and receive redacted utterances and silenced MP3 clips as each utterance completes. The stream delivers two message types interleaved:
  • JSON text framesutterance messages with the redacted transcript text
  • Binary frames — MP3 clips with the silenced audio for each utterance

API reference