Use Cases
- Browser extensions that need to mask clipboard content before pasting
- CLI tools that pre-process prompts
- Custom integrations that handle their own LLM communication
- Multi-turn conversations where you need to maintain placeholder numbering
Request
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to scan and mask |
language | string | No | Language code for PII detection (auto-detected if not provided) |
startFrom | object | No | Counter values to continue numbering from previous calls |
detect | array | No | What to detect: ["pii"], ["secrets"], or ["pii", "secrets"] (default: both) |
Response
| Field | Description |
|---|---|
masked | Text with PII/secrets replaced by placeholders |
context | Mapping of placeholder to original value (for client-side unmasking) |
counters | Final counter values per entity type |
entities | List of detected entities with their placeholders |
language | Language used for PII detection |
languageFallback | Whether the configured fallback language was used (auto-detection failed) |
Detection Options
Control what gets detected using thedetect parameter:
Multi-Turn Support
For conversations spanning multiple requests, use thecounters from the response as startFrom in the next request to maintain consistent numbering:
First request:
Client-Side Unmasking
Thecontext field provides a mapping for unmasking responses on the client side: