# PII Detect-and-Redact API

> PII Detect-and-Redact API is a paid API for AI agents from agent-utils-x402-production.revenue-agent-jw.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-18).

Deterministically detects and redacts PII (email, phone, SSN, credit card, IP, IBAN, ABA routing, secret keys) from text, returning findings with offsets and a redacted copy.

## Facts

- Endpoint: GET https://agent-utils-x402-production.revenue-agent-jw.workers.dev/v1/text/pii-redact?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pii-detect-and-redact-api-49529964
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__aMF9k76L0Dg7GVIbeZkH

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 pii-detect-and-redact-api-49529964
```

Example prompt: Before I forward this customer support ticket to our LLM pipeline, scan it for PII and give me a redacted copy — here's the text: 'Hi, my name is Jane Doe, SSN 123-45-6789, card number 4111111111111111, email jane@example.com.'

## When to prefer this

Choose this endpoint when you need fast, deterministic PII detection without an LLM or NER model — ideal for compliance pipelines, pre-processing untrusted input before LLM ingestion, or any scenario where reproducibility and checksum-validated matching matter. Prefer over LLM-based redaction when you need exact character offsets, Luhn-validated card detection, or need to filter by specific PII type categories.

## Known failure modes

- 400 bad input if 'text' query parameter is missing or malformed
- Text exceeding 2,000 characters on GET will be rejected (use POST for up to 32 KB)
- Luhn-invalid card-like numbers will not be flagged as credit cards
- Non-US IBAN or routing formats may not be recognized
- Secret key prefixes outside the known set (sk-, ghp_, AKIA…) will not be detected
- Payment required (402) if USDC balance is insufficient

## How this service works

Small pay-per-call utility APIs for AI agents. Pay per request in USDC on Base via x402 (v2, exact scheme), or via MPP (Machine Payments Protocol, Tempo charge in OUSD/USDC.e; minimum $0.01). No accounts, no API keys.

## Output

Returns a JSON object with: a 'redacted' string where PII is replaced by type placeholders like [EMAIL] or [PHONE], a 'findings' array with each match's type, start/end character offsets, placeholder used, and an anonymized preview, a 'countsByType' object tallying occurrences per PII type, an 'unchanged' boolean, and a 'version' field.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "maxLength": 2000,
       "description": "text to redact, URL-encoded"
      },
      "types": {
       "type": "string",
       "description": "optional comma list of PII types"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "version": "2026-11-06",
  "findings": [
   {
    "end": 27,
    "type": "email",
    "start": 8,
    "placeholder": "[EMAIL]",
    "matchPreview": "su***@example.com"
   }
  ],
  "redacted": "Contact [EMAIL] or [PHONE] regarding order 1234567890123456.",
  "unchanged": false,
  "countsByType": {
   "email": 1,
   "phone": 1
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pii-detect-and-redact-api-49529964/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-utils-x402-production.revenue-agent-jw.workers.dev](https://www.zero.xyz/host/agent-utils-x402-production.revenue-agent-jw.workers.dev/llms.txt)
