Support: support@tinplate.dev · Zero-Retention Edge Security Support Trust Center DPA GitHub Issues
AI Safety & Agents Tier 2 All-Access

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.

Interactive Sandbox · No API Key Required 200 OK · Ready
POST /v1/hallucination-diffinput
200 OK sample / live responsejson
{
  "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
  }
}
OpenAPI 3.0.3 Get All-Access Key ($29/mo) No signup. No payload storage.
Quickstart Code Examples
curl -X POST "https://api.tinplate.dev/v1/hallucination-diff" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TINPLATE_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";

const tinplate = new TinplateClient({
  apiKey: process.env.TINPLATE_API_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",
        "Authorization": "Bearer YOUR_TINPLATE_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",
    "Authorization": "Bearer YOUR_TINPLATE_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)

ParameterType & ConstraintsDescription
answer required string
minLen: 1, maxLen: 50000
Generated LLM answer to verify against source documents.
sources required string[] Grounding source passages or RAG chunks.
strictness optional "lenient" | "balanced" | "strict" Threshold profile for classifying claims as supported, partial, or unsupported.
use_ai_judge optional 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)

FieldTypeDescription
grounded_score integer Field 'grounded_score'
verdict "grounded" | "partially_grounded" | "contradicted" | "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'

What Deterministic Hallucination Diff API Detects & Validates

  • Cheap, fast first filter (< 2 ms deterministic) that cross-checks numbers, percentages, dates, and proper-noun entities against RAG sources
  • Normalizes comma-formatted numbers (e.g. 10,000 vs 10000) to avoid false alarms on equivalent figures
  • Per-sentence unigram + bigram overlap scoring with best-matching source evidence quotes
  • Computes a 0–100 grounded_score and three-state verdict (grounded, partially_grounded, ungrounded)
  • Optional Workers AI semantic second pass (use_ai_judge: true) when semantic contradiction detection is needed
Honest Engineering Boundaries

Known Limitations & Test Verification

Release: v1.0.39 · Verified: 16 November 2026 · Portfolio Median: 0.318 ms in-Worker V8 compute (add 15–65 ms HTTPS RTT) · See Full Portfolio Benchmarks →

  • Benchmark v1.0.39 (25 labeled RAG source-answer pairs): 96.0% agreement with human judgment (24/25), 100.0% recall on fabricated numbers & proper-noun entities (13/13), 100.0% precision on grounded answers (10/10), P50 0.037 ms / P99 2.363 ms in deterministic mode.
  • Deterministic mode is a token and entity overlap filter, not a truth detector: it catches unsupported numbers, dates, and names, and cannot judge abstract logical reasoning, heavy paraphrase, or pure antonym/negation swaps ('never' -> 'always') unless use_ai_judge: true is enabled.
  • Typically under 5 ms in deterministic mode (use_ai_judge: false); enabling use_ai_judge: true adds ~150–400 ms for Workers AI inference.

Direct All-Access & Marketplace Plans

Direct Polar All-Access Keys unlock all 42 APIs (49 endpoints), /v1/pipeline, and /mcp on api.tinplate.dev: Pro ($29/mo · 120 req/min · 100k/mo · 128 KB) or Team ($79/mo · 300 req/min · 500k/mo · 256 KB).

PlanMonthly PriceIncluded RequestsRate LimitMax PayloadBest For
BASIC$0.00 / mo500 / month10 req / min64 KBEvaluation & CI smoke tests
PRO$9.99 / mo15,000 / month60 req / min128 KBSolo devs & production apps
ULTRA$29.99 / mo100,000 / month300 req / min256 KBGrowing SaaS & multi-agent pipelines
MEGA$79.99 / mo500,000 / month1,000 req / min256 KBHigh-volume enterprise workloads

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.037 ms, P99 2.363 ms on benchmark). When use_ai_judge: true is enabled, Workers AI inference adds ~150–400 ms.

Zero Payload Logging

Data Handling, Privacy & 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 (observability.enabled = false, head_sampling_rate = 0, invocation_logs = false). Requests via RapidAPI or Zyla traverse marketplace proxies; use a Direct Bearer Key for zero-intermediary routing.

Related Tinplate APIs

POST /v1/prompt-guard Live

Prompt Injection Detection API

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

POST /v1/pii-redactor Live

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.