AI Safety & Agents
Tier 2 Ready
POST /v1/hallucination-diff
Fast first filter to catch unsupported numbers, dates, and names in LLM answers vs RAG sources. Fast first-pass RAG grounding check that catches unsupported numbers, dates, percentages, and proper nouns in LLM answers against source text.
POST /v1/hallucination-diff){
"ok": true,
"data": {
"grounded_score": 4,
"verdict": "partially_grounded",
"summary": {
"total_claims": 1,
"supported_claims": 0,
"partial_claims": 1,
"unsupported_claims": 0,
"missing_numbers": [
"24%"
],
"missing_entities": [
"Berlin"
]
},
"claims": [
{
"index": 0,
"text": "Acme Corp generated $4.2M in Q3 2026 (24% YoY growth) and launched in Berlin.",
"status": "partial",
"overlap_score": 0.442,
"missing_numbers": [
"24%"
],
"missing_entities": [
"Berlin"
],
"evidence": {
"source_index": 0,
"quote": "In Q3 2026, Acme Corp reported revenue of $4.2M and 18% year-over-year growth."
}
}
],
"judge": "disabled",
"ai_judge": null
},
"meta": {
"request_id": "req_hd_01",
"ms": 1
}
}
curl -X POST "https://api.tinplate.dev/v1/hallucination-diff" \
-H "Content-Type: application/json" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-d '{"sources":["In Q3 2026, Acme Corp reported revenue of $4.2M and 18% year-over-year growth."],"answer":"Acme Corp generated $4.2M in Q3 2026 (24% YoY growth) and launched in Berlin."}'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/hallucination-diff", {
"sources": [
"In Q3 2026, Acme Corp reported revenue of $4.2M and 18% year-over-year growth."
],
"answer": "Acme Corp generated $4.2M in Q3 2026 (24% YoY growth) and launched in Berlin."
});
console.log(`[${meta.ms} ms]`, data);import requests
response = requests.post(
"https://api.tinplate.dev/v1/hallucination-diff",
headers={
"Content-Type": "application/json",
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
},
json={
"sources": [
"In Q3 2026, Acme Corp reported revenue of $4.2M and 18% year-over-year growth."
],
"answer": "Acme Corp generated $4.2M in Q3 2026 (24% YoY growth) and launched in Berlin."
}
)
print(response.json())const response = await fetch("https://api.tinplate.dev/v1/hallucination-diff", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
},
body: JSON.stringify({
"sources": [
"In Q3 2026, Acme Corp reported revenue of $4.2M and 18% year-over-year growth."
],
"answer": "Acme Corp generated $4.2M in Q3 2026 (24% YoY growth) and launched in Berlin."
}),
});
const result = await response.json();
console.log(result);{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "tinplate_hallucination_diff",
"arguments": {
"sources": [
"In Q3 2026, Acme Corp reported revenue of $4.2M and 18% year-over-year growth."
],
"answer": "Acme Corp generated $4.2M in Q3 2026 (24% YoY growth) and launched in Berlin."
}
}
}POST /v1/hallucination-diff)| Parameter | Type & Constraints | Description |
|---|---|---|
answerrequired |
stringminLen: 1, maxLen: 50000 |
Generated LLM answer to verify against source documents. |
sourcesrequired |
string[] |
Grounding source passages or RAG chunks. |
strictnessoptional |
"lenient" | "balanced" | "strict" |
Threshold profile for classifying claims as supported, partial, or unsupported. |
use_ai_judgeoptional |
boolean |
Enable optional Cloudflare Workers AI second-pass semantic grounding judge (default false). When true, up to 4,000 chars of sources and 1,500 chars of answer are sent over Cloudflare's internal binding to @cf/meta/llama-3.1-8b-instruct (adds ~150-400 ms; zero model training or retention). |
data Object Fields (200 OK)| Field | Type | Description |
|---|---|---|
grounded_score |
integer |
Field 'grounded_score' |
verdict |
"grounded" | "partially_grounded" | "ungrounded" |
Field 'verdict' |
summary |
object |
Field 'summary' |
claims |
object[] |
Field 'claims' |
judge |
"disabled" | "workers_ai" | "unavailable" |
Field 'judge' |
ai_judge |
object | null |
Field 'ai_judge' |
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 →
| 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 |
Deterministic mode catches fabricated numbers, altered percentages/prices, wrong dates, and invented company/city/person names (100% recall on benchmark). Because it uses token and entity overlap, it cannot judge abstract reasoning, heavy paraphrase, or pure negation swaps ('is permitted' -> 'is not permitted')—it is a cheap first filter, not a truth detector.
By default use_ai_judge is false and text never leaves the Worker isolate. When use_ai_judge: true is set, an excerpt (up to 4,000 chars of sources and 1,500 chars of answer) is passed to Cloudflare Workers AI (@cf/meta/llama-3.1-8b-instruct) for a stateless semantic contradiction check with zero payload logging or model training.
Typically under 5 ms in deterministic mode (P50 0.051 ms, P99 1.30 ms on benchmark). When use_ai_judge: true is enabled, Workers AI inference adds ~150–400 ms.
In default deterministic mode (use_ai_judge: false), all token/entity diffing runs in volatile V8 memory with zero external calls or payload logging. When use_ai_judge: true is explicitly passed, up to 4,000 chars of sources and 1,500 chars of answer are sent over Cloudflare's internal binding to Cloudflare Workers AI (@cf/meta/llama-3.1-8b-instruct) for stateless inference; neither Tinplate nor Cloudflare trains models on or retains Workers AI inputs/outputs.
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.
POST /v1/prompt-guard
Live on Hub
Catch prompt injections, role hijacks, and encoded jailbreaks in user inputs and RAG chunks.
POST /v1/pii-redactor
Live on Hub
Mask emails, phones, IBANs, cards, and EU IDs with reversible tokens before LLM calls.
POST /v1/prompt-cache-budgeter
AI Safety & Agents
Estimate tokens, optimize message order for prompt caching, and calculate LLM API costs.