All API requests require authentication via an API key. Create API keys from your dashboard.
Include your key in the Authorization header:
Authorization: Bearer cg_your_api_key_here
API keys use the cg_ prefix. The key is hashed (SHA-256) on the server — CiteGuardian never stores your raw key after creation.
127.0.0.1 bypass authentication. This allows the Chrome extension to work without an API key when running locally.
Submit an AI-generated answer and its claimed sources for verification.
| Field | Type | Required | Description |
|---|---|---|---|
answer | string | Yes | The AI-generated text to verify. |
sources | array | Yes | Array of source objects. |
sources[].id | string | Yes | Stable source ID (e.g., "S1", "S2"). |
sources[].url | string | No* | URL to fetch source content from. |
sources[].text | string | No* | Raw source text (use when URL isn't available). |
gate | boolean | No | Return pass/fail verdict instead of full report. See Gate Mode. |
threshold | number | No | Gate pass threshold (default: 0.7). Only used when gate: true. |
callback_url | string | No | URL to POST results to when complete. See Async Mode. |
* Each source must have at least one of url or text.
curl -X POST https://citeguardian.com/api/verify \
-H "Authorization: Bearer cg_your_key" \
-H "Content-Type: application/json" \
-d '{
"answer": "The Earth orbits the Sun in 365.25 days [S1].",
"sources": [
{"id": "S1", "url": "https://example.com/astronomy"}
]
}'
{
"run_id": "abc12345def",
"overall": {
"supported_rate": 1.0,
"total_claims": 1,
"decorative_citations": 0,
"contradictions_found": 0
},
"claims": [
{
"claim": "The Earth orbits the Sun in 365.25 days",
"citations": ["S1"],
"verdict": "supported",
"confidence": 0.95,
"contradiction": false,
"scrub_test": {
"p0": 0.5,
"p1": 0.95,
"delta": 0.45,
"decorative": false
},
"evidence_chunk_ids": ["S1:C0"],
"notes": "Source confirms orbital period."
}
],
"meta": {}
}
Add "gate": true to get a simple pass/fail verdict instead of a full report. Designed for RAG pipelines that need to block hallucinated responses.
curl -X POST https://citeguardian.com/api/verify \
-H "Authorization: Bearer cg_your_key" \
-H "Content-Type: application/json" \
-d '{
"answer": "The speed of light is 300,000 km/s [S1].",
"sources": [{"id": "S1", "url": "https://example.com/physics"}],
"gate": true,
"threshold": 0.8
}'
{
"pass": true,
"supported_rate": 1.0,
"threshold": 0.8,
"total_claims": 1,
"contradictions_found": 0,
"decorative_citations": 0,
"run_id": "abc12345def"
}
supported_rate >= threshold (default threshold: 0.7)contradictions_found == 0Both conditions must be met. A single contradiction causes a fail regardless of the supported rate.
Hit our gate endpoint against a real pre-verified example report. This example contains 3 claims checked against an NHS source — including a fabricated WHO statistic and a contradiction. No API key required.
Add a callback_url to receive results via webhook instead of waiting for the response.
curl -X POST https://citeguardian.com/api/verify \
-H "Authorization: Bearer cg_your_key" \
-H "Content-Type: application/json" \
-d '{
"answer": "AI text to verify [S1].",
"sources": [{"id": "S1", "url": "https://example.com"}],
"callback_url": "https://your-server.com/webhook"
}'
{
"run_id": "abc12345def",
"status": "processing"
}
When verification completes, results are POSTed to your callback_url. See Webhooks for the payload format.
Submit multiple verification requests at once. Processing happens in the background.
curl -X POST https://citeguardian.com/api/batch \
-H "Authorization: Bearer cg_your_key" \
-H "Content-Type: application/json" \
-d '[
{
"answer": "Claim one [S1].",
"sources": [{"id": "S1", "url": "https://example.com/1"}]
},
{
"answer": "Claim two [S1].",
"sources": [{"id": "S1", "url": "https://example.com/2"}]
}
]'
curl -X POST https://citeguardian.com/api/batch \
-H "Authorization: Bearer cg_your_key" \
-H "Content-Type: application/json" \
-d '{
"items": [
{"answer": "...", "sources": [{"id": "S1", "url": "..."}]},
{"answer": "...", "sources": [{"id": "S1", "url": "..."}]}
],
"callback_url": "https://your-server.com/batch-done"
}'
{
"batch_id": "batch123abc",
"total_items": 2,
"poll_url": "/api/batch/batch123abc"
}
Maximum batch size: 50 items. Each item costs 1 credit.
Poll the status and results of a batch job.
curl https://citeguardian.com/api/batch/batch123abc \
-H "Authorization: Bearer cg_your_key"
{
"batch": {
"id": "batch123abc",
"total_items": 2,
"completed_items": 1,
"failed_items": 0,
"status": "processing",
"created_at": "2025-01-15T10:30:00",
"completed_at": null
},
"runs": [
{
"id": "run12345abc",
"answer_preview": "Claim one [S1]...",
"supported_rate": 1.0,
"total_claims": 1,
"status": "completed"
}
]
}
The status field is one of: processing, completed, failed.
Check your current credit balance.
curl https://citeguardian.com/api/credits \
-H "Authorization: Bearer cg_your_key"
{"credits": 42}
When you provide a callback_url, CiteGuardian POSTs results to your server when verification completes.
{
"event": "verify.completed",
"run_id": "abc12345def",
"report": { ... }
}
{
"event": "verify.failed",
"run_id": "abc12345def",
"error": "Error description"
}
When gate: true is set with a callback_url, the webhook includes a gate field:
{
"event": "verify.completed",
"run_id": "abc12345def",
"report": { ... },
"gate": {
"pass": true,
"supported_rate": 0.85,
"threshold": 0.7,
"contradictions_found": 0
}
}
| Status | Meaning | Common Cause |
|---|---|---|
400 | Bad Request | Invalid JSON, missing answer or sources, malformed request. |
401 | Unauthorized | Missing or invalid API key. Make sure to include Authorization: Bearer cg_.... |
402 | Payment Required | Insufficient credits. Purchase more from the pricing page. |
404 | Not Found | Report or batch ID doesn't exist. |
500 | Internal Server Error | Verification pipeline failure. Try again or contact support. |
All error responses return JSON:
{"error": "Description of what went wrong"}