The examples on this page use the Redaction APIs.
Batch
Send a complete audio file. The response ismultipart/form-data with two parts: metadata (JSON transcript) and audio (redacted MP3).
Install
requests-toolbelt to decode the multipart response: pip install requests-toolbelt.Expected metadata response
Expected metadata response
<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 frames —
utterancemessages with the redacted transcript text - Binary frames — MP3 clips with the silenced audio for each utterance
Example messages received
Example messages received
API reference
- PII/PHI Redaction Batch — full parameter and response schema
- PII/PHI Redaction Streaming — WebSocket protocol, message format, close codes