API Docs

Minimal endpoints for health checks and AI text review

FinalCheck exposes a lightweight health endpoint plus a server-side review endpoint for AI-generated text. The review route supports hallucination, tone, and policy checks and uses an OpenAI path when a valid OPENAI_API_KEY is available.

Authentication

Every POST /api/check request must include x-api-key: fc_test_key.
x-api-key: fc_test_key

GET /api/health

Returns a basic liveness payload.
{
  "status": "ok"
}

POST /api/check

Send AI-generated text and the checks you want to run.
FieldTypeRequiredNotes
textstringYesThe text to review.
checksstring[]NoAllowed values: hallucination, tone, policy. Omit to run all three.
{
  "text": "According to a Gartner report, we reduced incidents by 97%. You must approve this today.",
  "checks": ["hallucination", "tone", "policy"]
}

Response shape

FieldTypeNotes
passedbooleanFalse when one or more issues were found.
issuesarrayStructured issues returned by the review engine.
scorenumber0 to 100 quality score.
summarystringShort human-readable result summary.
{
  "passed": false,
  "issues": [
    {
      "type": "hallucination",
      "severity": "high",
      "detail": "Potentially unsupported factual claim: \"According to a Gartner report, we reduced incidents by 97%\""
    },
    {
      "type": "tone",
      "severity": "low",
      "detail": "Tone may be too forceful for a business setting: \"You must approve this today.\""
    }
  ],
  "score": 62,
  "summary": "1 critical issue found across 2 total issues."
}

Check types

CheckWhat it looks for
hallucinationUnsupported factual claims, invented certainty, or unsourced statistics.
toneLanguage that is too casual, aggressive, or mismatched for a professional context.
policyPotentially sensitive personal, payment, or confidential content.

cURL example

curl -X POST https://finalcheck.nanocorp.app/api/check \
  -H "Content-Type: application/json" \
  -H "x-api-key: fc_test_key" \
  -d '{
    "text": "According to a Gartner report, we reduced incidents by 97%. You must approve this today.",
    "checks": ["hallucination", "tone", "policy"]
  }'

Debug headers

Successful review responses include x-finalcheck-engine so you can tell whether the result came from the OpenAI path or the deterministic fallback. When an LLM path is attempted, the response also includes x-finalcheck-model.