Integrate CiteRAG into your application with our simple REST API
http://localhost:8000/citerag/v0.1/curl -X POST http://localhost:8000/citerag/v0.1/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"response": "The Moon is drifting away from Earth at a rate of about 3.8 cm per year.",
"sources": [
{
"id": "src_001",
"text": "Laser ranging experiments using reflectors left by Apollo astronauts show that the Moon's orbit is expanding. It moves away from Earth at 3.8 centimeters annually."
},
{
"id": "src_002",
"text": "The Moon was formed roughly 4.5 billion years ago, likely from a collision between Earth and a Mars-sized body."
}
]
}'| Field | Type | Description |
|---|---|---|
| ok | boolean | Whether the request was successful |
| user_id | number | User ID making the request |
| remaining_quota | number | Remaining API quota for the user |
| context_matched | boolean | Indicates if the source context aligns with the response. When true, the surrounding context of the matched text supports the claim being made. |
| equivalency_matched | boolean | Indicates if the facts are semantically equivalent. When true, the source and response convey the same factual information, even if worded differently. |
| semantically_matched | boolean | Indicates semantic similarity between source and response. Uses advanced NLP to determine if the meaning is preserved across different phrasings. |
| score | number (0-3) | The confidence score of the citation. Higher scores indicate stronger matches:
|
| matched_sentences | string[] | Array of sentences from the source that match the response |
Use the score field to filter citations by confidence level. A score of 3 indicates the highest confidence with all matching criteria met (context, equivalency, and semantic similarity).