/api/v1/redact returns the masked text only. There's no encrypted
envelope, no decryption material, no way to recover the original
values. Use it for analytics, logs, and prompts that the LLM doesn't
need to un-mask.mk_live_… key below (it stays in this browser only and is sent
as a Bearer header, never as a cookie), then run a real /redact
call. You'll get back the redacted text and a per-type count of distinct
values.12345678910111213import requests resp = requests.post( "https://api.kindi.me/api/v1/redact", headers={"Authorization": "Bearer mk_live_..."}, json={"text": "Call John Doe at +966 50 123 4567"}, ).json() print(resp["redacted_text"]) # → "Call PERSON_NAME_01 at PHONE_01" print(resp["entity_counts"]) # → {"PERSON_NAME": 1, "PHONE": 1}
12345678{ "redacted_text": "Call PERSON_NAME_01 at PHONE_01", "pii_count": 2, "entity_counts": {"PERSON_NAME": 1, "PHONE": 1}, "request_id": "redact_9f21ac0e", "processing_time_ms": 38, "judge_used": false }
pii_count counts distinct values, not occurrences, and
entity_counts is keyed by redact placeholder prefix. See the
/redact reference for every field.PERSON_NAME_01
refers to the same person every time it appears in redacted_text.
Across requests, numbering restarts at _01.