Fact It
Developers

Quickstart

Send a piece of AI-generated text and read back per-claim verdicts and an overall trust score. Only the response field is required.

1. Mint an API token (required)

Every call to /api/check must be authenticated, so start by minting an API token from the account page — the raw fk_… value is shown once, so copy it right away. (Calling from the signed-in dashboard instead? Your session cookie authenticates you and no token is needed.)

2. Make your first check

POST a JSON body to https://fact-it-web-412159981305.us-central1.run.app/api/check— Fact It's hosted origin (swap in your own if you self-host). Pass your token in the Authorization header; the response stays open until every verdict is ready, then returns the completed Check. Only response is required.

curl https://fact-it-web-412159981305.us-central1.run.app/api/check \
  -H 'Authorization: Bearer fk_your_token' \
  -H 'Content-Type: application/json' \
  -d '{
    "response": "The Eiffel Tower is 984 feet tall.",
    "sourceApp": "other"
  }'

3. Read the result in JavaScript

The same call with a plain fetch. Read overallConfidence (the 0–1 trust score) and iterate verdicts for each claim.

const res = await fetch('https://fact-it-web-412159981305.us-central1.run.app/api/check', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer fk_your_token',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    response: 'The Eiffel Tower is 984 feet tall.',
  }),
});

if (!res.ok) throw new Error(`Fact It check failed: ${res.status}`);

const check = await res.json();
console.log('trust score:', check.overallConfidence);
for (const verdict of check.verdicts) {
  console.log(verdict.status, verdict.confidence, verdict.reasoning);
}

4. Streaming & the typed client

Want verdicts to render as they land instead of waiting for the whole check? The same input is available over Server-Sent Events — see Streaming.

Inside the Fact It monorepo, the first-party surfaces (extension, desktop, dashboard) call the API through FactItClient from @fact-it/sdk — the same typed client, with CheckRequest/Check parsing built in:

// @fact-it/sdk is an internal workspace package (not published to npm).
// It is the typed client our own apps use.
import { FactItClient } from '@fact-it/sdk';

const factIt = new FactItClient({
  baseUrl: 'https://fact-it-web-412159981305.us-central1.run.app',
  token: 'fk_your_token',
});

const check = await factIt.check({ response: 'The Eiffel Tower is 984 feet tall.' });
console.log(check.overallConfidence);

Outside the monorepo, integrate over plain REST as shown above — there is no npm install @fact-it/sdk.