DEVELOPER API

3 Lines of Code. 273 Entity Types.

Anonymize PII in your pipeline. MCP Server (9 tools), REST API. Synchronous API. Bearer token auth. Enterprise-grade privacy infrastructure.

The Security Problem

🚨

MCP 8000+ Exposed

Claude's Model Context Protocol has 8000+ exposed servers. Agents can enumerate internal APIs without auth. Data exfiltration in seconds.

πŸ”—

LangChain CVE-2025-68664

CVSS 9.3. Attacker-controlled LLM can execute arbitrary tool calls. Database queries, file access, network requests. No PII filtering.

πŸ›‘οΈ

Zero Privacy by Default

LLMs don't understand PII. LangChain agents paste customer data. RAG systems upload contracts to Claude context. No redaction layer.

No. There is no SDK package. The REST API works with any HTTP client: call it with requests in Python or fetch in Node.js. Code examples are on the Code Examples page.

The MCP Server exposes 9 privacy tools, for example anonym_legal_analyze_text, anonym_legal_anonymize_text and anonym_legal_detokenize_text, that MCP-capable agents can call directly. MCP access is included in Pro and Business. Prevents PII leakage in RAG pipelines and agent workflows.

The API is synchronous. Batch endpoints process arrays of text in a single call. The API runs on EU servers. Document content is not stored after processing, unless you use the optional history.

The API runs on our EU-hosted infrastructure. Document content is not stored after processing, unless you use the optional history. For enterprise self-hosting requirements, contact us.

Yes. Send arrays of text strings in a single API call. The batch endpoint (POST /api/presidio/batch) takes up to 5 texts per request on Basic, 10 on Pro and 50 on Business.

Free tier: 200 tokens per 30 days in the web app (API access starts with Basic). Basic: €3/month (1,000 tokens). Pro: €15/month (4,000 tokens, adds the MCP Server). Business: €29/month (10,000 tokens). What a call costs depends on text length and the entities found, so one call can cost more than one token.

MCP Server (9 Tools)

anonym_legal_analyze_text

Detect PII in text without changing it. Returns entity type, confidence and position.

anonym_legal_anonymize_text

Replace PII in text. Operators per entity: replace, redact, hash, encrypt, mask, keep. Mode "tokenize" returns a session for later detokenizing.

anonym_legal_detokenize_text

Restore the original values in tokenized text, using the session_id from an earlier tokenize call.

anonym_legal_redact_image

Redact or analyze PII in PNG or JPEG images (OCR-based).

anonym_legal_list_presets

List the presets available to your account.

anonym_legal_estimate_cost

Estimate the token cost before processing. Free, no tokens deducted.

anonym_legal_get_balance

Check your token balance, usage and billing cycle.

anonym_legal_list_sessions

List your active tokenization sessions. Free, no tokens deducted.

anonym_legal_delete_session

Delete a tokenization session and its token mappings.

REST API Quick Start

curl -X POST https://anonym.legal/api/presidio/analyze \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "My SSN is 123-45-6789 and email is john@example.com",
    "language": "en"
  }'

# Response:
# {
#   "results": [
#     { "entity_type": "US_SSN", "start": 11, "end": 23, "score": 0.99 },
#     { "entity_type": "EMAIL_ADDRESS", "start": 38, "end": 56, "score": 0.99 }
#   ]
# }

Why Developers Choose This

  • ⚑ Coverage: 48 languages. 273 entity types.
  • πŸ” EU Hosting: Document content is not stored after processing, unless you use the optional history.
  • πŸ“Š Flexible Auth: Bearer token, API key, OAuth 2.0. Works with LangChain, LlamaIndex, custom agents.
  • πŸ’° Cost Predictable: Token-based pricing. No surprise bills. Batch calls use the same per-text token rates.

Code Examples

🐍 Python (requests)

import requests

r = requests.post(
  'https://anonym.legal/api/presidio/analyze',
  headers={'Authorization': 'Bearer YOUR_KEY'},
  json={'text': 'SSN: 123-45-6789',
        'language': 'en'}
)
results = r.json()['results']

πŸ“˜ Node.js (fetch)

const r = await fetch(
  'https://anonym.legal/api/presidio/analyze',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      text: 'SSN: 123-45-6789',
      language: 'en'
    })
  }
);
const { results } = await r.json();

πŸ”— cURL

curl -X POST \
  https://anonym.legal/api/presidio/analyze \
  -H "Authorization: Bearer KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"SSN:123","language":"en"}'

Watch the API In Action

See PII detection and anonymization via REST API and MCP Server

Start Building Privacy-First Today

Get API key. No credit card required. 200 free tokens to start.

Generate API Key

Frequently Asked Questions

Yes. The REST API integrates into any data pipeline β€” Kafka consumers, Spark jobs, Airflow DAGs, dbt models. Process text through the /api/analyze endpoint to detect PII, then /api/anonymize to redact. Synchronous request-response.

The REST API supports synchronous request-response. For high-volume streaming, batch requests to /api/anonymize with arrays of text. For event-driven architectures, wrap the API in a Kafka consumer or AWS Lambda function.

Two approaches: (1) MCP Server β€” add anonym.legal as a tool in Claude, Cursor, or any MCP-compatible AI. (2) REST API β€” call /api/presidio/anonymize before sending data to any LLM. Both detect 273 entity types and anonymize in real-time.

REST API for any HTTP client. MCP Server for AI tools (Claude, Cursor, VS Code). Compatible with Kafka, Spark, Snowflake, dbt, Airflow, AWS Lambda, Google Cloud Functions, and Azure Functions.