Tinplate 42 Edge APIs

AI Safety & Agents Tier 2 Ready POST /v1/hallucination-diff

LLM Grounding & Hallucination Check API — Fast First Filter for Numbers & Entities

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.

Try It Live in Your Browser · No API Key Required

1. Interactive Sandbox & Sample JSON Output

200 OK · Ready

Editable Request JSON (POST /v1/hallucination-diff)

Live 200 OK Response Envelope

{
  "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
  }
}

2. Quickstart Code Examples

Full TypeScript & Python SDK →
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."
    }
  }
}
OpenAPI 3.0.3 Schema Contract

Request Parameters & Response Schema Reference

Request Body Parameters (POST /v1/hallucination-diff)

Parameter Type & Constraints Description
answerrequired string
minLen: 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).

Response 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'

3. What Deterministic Hallucination Diff 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

What types of hallucinations does deterministic mode catch vs miss?

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.

What happens to my text when use_ai_judge: true is enabled?

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.

How fast is it?

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.

Zero Payload Logging

7. Data Handling, Privacy & Marketplace Proxy Disclosure

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.

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.