Skip to main content
Generate messages with automatic PII and secrets protection using the Anthropic Messages API.
This endpoint supports both mask mode and route mode. Route mode requires a local LLM with Anthropic API support (e.g., Ollama). The request format follows the Anthropic Messages API.

Request

Parameters

All Anthropic Messages API parameters are supported.

Response

Streaming

Set stream: true for Server-Sent Events:

Response Headers

PasteGuard adds headers to indicate PII and secrets handling:

Content Types

PasteGuard scans configured text roles in Anthropic requests. By default it scans:
  • User messages — String content or text blocks
  • Tool results — Text content in tool responses
Assistant messages and system prompts are available as scan roles, but are skipped by default. Add them to pii_detection.scan_roles or secrets_detection.scan_roles if you want PasteGuard to inspect them.