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_keyGET /api/health
Returns a basic liveness payload.
{
"status": "ok"
}POST /api/check
Send AI-generated text and the checks you want to run.
| Field | Type | Required | Notes |
|---|---|---|---|
| text | string | Yes | The text to review. |
| checks | string[] | No | Allowed 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
| Field | Type | Notes |
|---|---|---|
| passed | boolean | False when one or more issues were found. |
| issues | array | Structured issues returned by the review engine. |
| score | number | 0 to 100 quality score. |
| summary | string | Short 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
| Check | What it looks for |
|---|---|
| hallucination | Unsupported factual claims, invented certainty, or unsourced statistics. |
| tone | Language that is too casual, aggressive, or mismatched for a professional context. |
| policy | Potentially 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.