# PayAI PII Redaction & Tokenization

> PayAI PII Redaction & Tokenization is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Detects structured PII in a text blob and transforms it via redact, mask, hash, or reversible tokenize modes, returning sanitized text plus a findings report.

## Facts

- Endpoint: POST https://payai.agentstools.dev/pii/redact
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/payai-pii-redaction-tokenization-a21c4641
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rKpgZxQ_IEci06AJQ6omm

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability payai-pii-redaction-tokenization-a21c4641 -d '<json body>'
```

Example prompt: Scan this customer support message for any PII — names, emails, phone numbers, SSNs — and return a sanitized version using reversible tokenization so I can recover the originals later: 'Hi, I'm John Smith, my email is john@example.com and my SSN is 123-45-6789, please help me reset my account.'

## When to prefer this

Choose this endpoint when you need stateless, per-call PII transformation with flexible output modes (redact, mask, hash, or reversible tokenize) and a detailed findings report — especially when you want the token map returned in-response rather than stored. Prefer it over regex-based approaches when you need multi-type PII detection in a single pass with optional per-type mode overrides and an allow-list.

## Known failure modes

- Unstructured or ambiguous PII (e.g. colloquial names without context) may not be detected
- Non-English text may have lower detection accuracy
- Malformed input JSON returns a 400 error
- Unknown mode values return a validation error
- Very large text blobs may hit payload size limits
- Results represent structured indicators only, not legal compliance guarantees

## How this service works

Detect and transform structured PII in a text blob. Returns the sanitized text plus a findings report. Modes: redact, mask, hash, or reversible tokenize (the token map is returned in the response — nothing is stored). Optional per-type mode overrides and an allow-list. Structured PII indicators, not legal advice.

## Output

Returns a JSON object containing: (1) the sanitized version of the input text with PII transformed according to the chosen mode, (2) a findings report listing each detected PII item including its type, original span, position, and replacement value, and (3) a token map (when tokenize mode is used) mapping generated tokens back to the original values — nothing is stored server-side.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "enum": [
    "redact",
    "mask",
    "hash",
    "tokenize"
   ],
   "type": "string",
   "description": "Default transform applied to every entity"
  },
  "salt": {
   "type": "string",
   "description": "Optional salt mixed into hash mode"
  },
  "text": {
   "type": "string",
   "description": "The text to sanitize"
  },
  "entities": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "Optional allow-list of entity types to act on (default: all). See GET /pii/recognizers."
  },
  "mode_overrides": {
   "type": "object",
   "description": "Optional per-entity-type transform, keyed by type"
  },
  "include_positions": {
   "type": "boolean",
   "description": "Include character start/end offsets per finding"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/payai-pii-redaction-tokenization-a21c4641/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
