PII redaction

Redact supported sensitive values with the Python SDK.

result = client.redact(
    text="My name is Amina Yusuf and my number is 08012345678.",
    language="English",
)
 
print(result.text)
My name is [PERSON_NAME] and my number is [PHONE_NUMBER].

client.redact() returns a TextResult. Use result.text for the redacted text and result.usage for token and cost information.

For long input, submit client.submit_text_job(task="redact", ...) and poll with client.get_text_job(job_id) or client.wait_for_text_job(job_id).

See PII redaction, Async jobs, and the Redaction API.