Generate chat completions with automatic PII and secrets protection.Documentation Index
Fetch the complete documentation index at: https://pasteguard.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
This is the only endpoint that receives PII detection and masking. All other OpenAI endpoints (
/models, /embeddings, /files, etc.) are proxied directly to OpenAI without modification.Request
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID (e.g., gpt-5.2) |
messages | array | Yes | Conversation messages |
stream | boolean | No | Enable streaming |
temperature | number | No | Sampling temperature (0-2) |
max_tokens | number | No | Maximum tokens to generate |
Response
Streaming
Setstream: true for Server-Sent Events:
Response Headers
PasteGuard adds headers to indicate PII and secrets handling:| Header | Description |
|---|---|
X-PasteGuard-Mode | Current mode (mask or route) |
X-PasteGuard-Provider | Provider used (openai or local) |
X-PasteGuard-PII-Detected | true if PII was found |
X-PasteGuard-PII-Masked | true if PII was masked (mask mode only) |
X-PasteGuard-Language | Detected language code |
X-PasteGuard-Language-Fallback | true if configured language was not available |
X-PasteGuard-Secrets-Detected | true if secrets were found |
X-PasteGuard-Secrets-Types | Comma-separated list of detected secret types |
X-PasteGuard-Secrets-Masked | true if secrets were masked |