Tinplate 42 Edge APIs

AI Data Prep Live on RapidAPI & Zyla POST /v1/llm-messages-guard

LLM Chat Messages Policy Proxy & Sanitizer API — Multi-Turn OpenAI/Anthropic Guardrail

Sanitize entire multi-turn LLM messages[] arrays in one call before forwarding to OpenAI, Anthropic, or Gemini. Drop-in guardrail for OpenAI, Anthropic, and Gemini messages[] arrays. Scans user and tool turns for prompt injection, redacts PII and secrets with a unified cross-turn restoration map, and strips email reply noise.

Try It Live in Your Browser · No API Key Required

1. Interactive Sandbox & Sample JSON Output

200 OK · Ready

Editable Request JSON (POST /v1/llm-messages-guard)

Live 200 OK Response Envelope

{
  "ok": true,
  "data": {
    "safe": true,
    "verdict": "allow",
    "max_risk_score": 0,
    "sanitized_messages": [
      {
        "role": "system",
        "content": "You are an enterprise billing assistant."
      },
      {
        "role": "user",
        "content": "Please email the receipt to [PII_EMAIL_1]. Key: [SECRET_GITHUB_TOKEN_1]"
      }
    ],
    "restoration_map": {
      "[PII_EMAIL_1]": "alice@acme.eu",
      "[SECRET_GITHUB_TOKEN_1]": "ghp_1234567890abcdefghijklmnopqrstuvwxyz"
    },
    "summary": {
      "total_messages": 2,
      "scanned_messages": 1,
      "blocked_turns": 0,
      "total_pii_redacted": 1,
      "total_secrets_redacted": 1,
      "injection_categories": []
    },
    "turn_findings": [
      {
        "turn_index": 0,
        "role": "system",
        "verdict": "allow",
        "risk_score": 0,
        "injection_categories": [],
        "pii_redacted_count": 0,
        "secrets_redacted_count": 0,
        "pii_types": [],
        "secret_types": []
      },
      {
        "turn_index": 1,
        "role": "user",
        "verdict": "allow",
        "risk_score": 0,
        "injection_categories": [],
        "pii_redacted_count": 1,
        "secrets_redacted_count": 1,
        "pii_types": [
          "EMAIL"
        ],
        "secret_types": [
          "GITHUB_TOKEN"
        ]
      }
    ]
  },
  "meta": {
    "request_id": "req_msg_01",
    "ms": 2
  }
}

2. Quickstart Code Examples

Full TypeScript & Python SDK →
curl -X POST "https://api.tinplate.dev/v1/llm-messages-guard" \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -d '{"messages":[{"role":"system","content":"You are an enterprise billing assistant."},{"role":"user","content":"Please email the receipt to alice@acme.eu. Key: ghp_1234567890abcdefghijklmnopqrstuvwxyz"}],"check_prompt_injection":true,"redact_pii":true,"scan_secrets":true,"strip_email_quotes":true,"sensitivity":"medium"}'
import { TinplateClient } from "@tinplate/sdk"; // npm install @tinplate/sdk

const tinplate = new TinplateClient({
  rapidApiKey: process.env.RAPIDAPI_KEY!,
});

const { data, meta } = await tinplate.call("/v1/llm-messages-guard", {
  "messages": [
    {
      "role": "system",
      "content": "You are an enterprise billing assistant."
    },
    {
      "role": "user",
      "content": "Please email the receipt to alice@acme.eu. Key: ghp_1234567890abcdefghijklmnopqrstuvwxyz"
    }
  ],
  "check_prompt_injection": true,
  "redact_pii": true,
  "scan_secrets": true,
  "strip_email_quotes": true,
  "sensitivity": "medium"
});
console.log(`[${meta.ms} ms]`, data);
import requests

response = requests.post(
    "https://api.tinplate.dev/v1/llm-messages-guard",
    headers={
        "Content-Type": "application/json",
        "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
    },
    json={
  "messages": [
    {
      "role": "system",
      "content": "You are an enterprise billing assistant."
    },
    {
      "role": "user",
      "content": "Please email the receipt to alice@acme.eu. Key: ghp_1234567890abcdefghijklmnopqrstuvwxyz"
    }
  ],
  "check_prompt_injection": true,
  "redact_pii": true,
  "scan_secrets": true,
  "strip_email_quotes": true,
  "sensitivity": "medium"
}
)
print(response.json())
const response = await fetch("https://api.tinplate.dev/v1/llm-messages-guard", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
  },
  body: JSON.stringify({
  "messages": [
    {
      "role": "system",
      "content": "You are an enterprise billing assistant."
    },
    {
      "role": "user",
      "content": "Please email the receipt to alice@acme.eu. Key: ghp_1234567890abcdefghijklmnopqrstuvwxyz"
    }
  ],
  "check_prompt_injection": true,
  "redact_pii": true,
  "scan_secrets": true,
  "strip_email_quotes": true,
  "sensitivity": "medium"
}),
});
const result = await response.json();
console.log(result);
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "tinplate_llm_messages_guard",
    "arguments": {
      "messages": [
        {
          "role": "system",
          "content": "You are an enterprise billing assistant."
        },
        {
          "role": "user",
          "content": "Please email the receipt to alice@acme.eu. Key: ghp_1234567890abcdefghijklmnopqrstuvwxyz"
        }
      ],
      "check_prompt_injection": true,
      "redact_pii": true,
      "scan_secrets": true,
      "strip_email_quotes": true,
      "sensitivity": "medium"
    }
  }
}
OpenAPI 3.0.3 Schema Contract

Request Parameters & Response Schema Reference

Request Body Parameters (POST /v1/llm-messages-guard)

Parameter Type & Constraints Description
messagesrequired object[] Array of OpenAI, Anthropic, or agent chat messages to inspect and sanitize in a single pass.
sensitivityoptional "low" | "medium" | "high"
default: "medium"
Prompt-injection threshold sensitivity preset.
check_prompt_injectionoptional boolean
default: true
Scan user and tool turns for prompt injection and jailbreaks.
redact_piioptional boolean
default: true
Mask emails, phones, IBANs, credit cards, and national IDs across turns.
scan_secretsoptional boolean
default: true
Scrub leaked API keys, tokens, PEM keys, and credentials across turns.
strip_email_quotesoptional boolean
default: false
Strip quoted email reply chains and signature blocks from user turns before scanning.
localesoptional string[]
default: ["GLOBAL","EU","US"]
Locale sets for PII detection.

Response data Object Fields (200 OK)

Field Type Description
safe boolean Field 'safe'
verdict "allow" | "review" | "block" Field 'verdict'
max_risk_score number Field 'max_risk_score'
sanitized_messages object[] Field 'sanitized_messages'
restoration_map object Unified token-to-original map across all turns for stateless restoration after LLM completion.
summary object Field 'summary'
turn_findings object[] Field 'turn_findings'

3. What LLM Chat Messages Policy Proxy & Sanitizer API Detects & Validates

Honest Engineering Boundaries

4. Known Limitations & Test Verification

Release Version: v1.0.7 · Last Verified / Benchmarked: 14 November 2026 · Latency Note: Sub-millisecond figures measure in-Worker V8 compute time (typical client HTTPS network RTT to the nearest Cloudflare PoP is 15–65 ms) · See Full Portfolio Benchmarks & Corpora →

5. Marketplace Plans & Payload Quotas

Plan Monthly Price Included Requests Rate Limit Max Request Payload Best For
BASIC $0.00 / month 500 / month (hard limit) 10 req / min 64 KB Evaluation, local development & CI smoke tests
PRO $9.99 / month 15,000 / month 60 req / min 128 KB Solo developers & production apps
ULTRA $29.99 / month 100,000 / month 300 req / min 256 KB Growing SaaS & multi-agent pipelines
MEGA $79.99 / month 500,000 / month 1,000 req / min 256 KB High-volume enterprise workloads

6. Frequently Asked Questions

Why use this instead of calling Prompt Guard and PII Redactor on each message?

Calling PII Redactor per message resets token numbering on every turn. This API maintains a unified cross-turn restoration map across the entire conversation history in a single network call.

Does it modify system or developer prompts?

No—system and developer prompts are preserved verbatim so your instructions and few-shot examples are never altered.

Zero Payload Logging

7. Data Handling, Privacy & Marketplace Proxy Disclosure

Chat arrays and reversible restoration maps are processed in memory and never logged or stored.

Worker Zero-Logging Guarantee: Cloudflare Workers Observability and invocation logging are disabled in configuration (observability.enabled = false, head_sampling_rate = 0, invocation_logs = false). Payloads are processed strictly in volatile V8 memory and never logged or stored by Tinplate.

Marketplace Proxies vs. Direct Bearer Key: Requests sent via RapidAPI or Zyla API Hub pass through those marketplaces' proxy infrastructure (subject to their respective privacy policies). Security-sensitive workloads requiring end-to-end zero-intermediary processing can connect directly to https://api.tinplate.dev using a Direct Bearer Key (Authorization: Bearer <API_KEY>). Read our full Privacy Notice and OpenAPI 3.0.3 JSON Schema.

Related Tinplate APIs

🔒 POST /v1/prompt-guard Live on Hub

Prompt Injection Detection API

Catch prompt injections, role hijacks, and encoded jailbreaks in user inputs and RAG chunks.

🛡️ POST /v1/pii-redactor Live on Hub

PII Redactor API

Mask emails, phones, IBANs, cards, and EU IDs with reversible tokens before LLM calls.

🧮 POST /v1/prompt-cache-budgeter AI Safety & Agents

Prompt Cache Key & Context Budgeter API

Estimate tokens, optimize message order for prompt caching, and calculate LLM API costs.