API for LLM Source Verification
A developer-first API that scores the reliability of sources in LLM-generated responses. Integrate trust scoring into your language model applications with a simple REST API.
Trust Scores
LiveUNAIDS Uganda Profile
NASA Climate Data
Blog Post - TechCrunch
Wikipedia Article
Quick Start Guide
Get started with Ancestor in three simple steps
Get API Key
curl -X POST https://api.ancestor.cloud/v1/auth/keys \
-H "Content-Type: application/json" \
-d '{"email": "your@email.com"}'
Evaluate Sources
curl -X POST https://api.ancestor.cloud/v1/evaluate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "What is Uganda'''s HIV prevalence?",
"answer": "According to UNAIDS, Uganda'''s HIV prevalence is 5.7% as of 2022",
"citations": [
{
"url": "https://www.unaids.org/en/regionscountries/countries/uganda",
"title": "UNAIDS Uganda Country Profile"
}
]
}'
Get Results
{
"trust_score": 87,
"factors": {
"source_quality": 92,
"recency": 85,
"provenance": 78
},
"explanation": "High confidence: UNAIDS is authoritative source, data is recent (2022), has stable URL + archived copy",
"ancestry_id": "eval_abc123"
}
API Reference
Complete API documentation with interactive examples and detailed schemas.
/v1/evaluate
Evaluate source quality for LLM-generated responses with detailed trust scoring and analysis.
/v1/ancestry/{id}
Retrieve detailed audit trail and evaluation history for a specific ancestry ID.
Error Handling
The API uses conventional HTTP response codes to indicate success or failure. Error responses include detailed information to help debug issues.
Error Response Format
{
"error": {
"code": "invalid_request",
"message": "Missing required field: question",
"details": {
"field": "question",
"expected": "string",
"received": null
}
},
"request_id": "req_abc123"
}
Common Error Examples
{
"error": {
"code": "invalid_request",
"message": "Invalid URL format in citations",
"details": {
"field": "citations[0].url",
"value": "not-a-valid-url"
}
}
}
{
"error": {
"code": "unauthorized",
"message": "Invalid API key",
"details": {
"hint": "Check your API key in the Authorization header"
}
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded",
"details": {
"limit": 100,
"window": "1 hour",
"retry_after": 3600
}
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred",
"details": {
"request_id": "req_abc123",
"support": "Contact support with this request ID"
}
}
}
HTTP Status Codes
Status Code | Description | Common Causes |
---|---|---|
200 | Success | Request completed successfully |
400 | Bad Request | Invalid JSON, missing fields, malformed URLs |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | API key lacks required permissions |
404 | Not Found | Ancestry ID not found, invalid endpoint |
422 | Unprocessable Entity | Valid JSON but business logic errors |
429 | Too Many Requests | Rate limit exceeded for your plan |
500 | Internal Server Error | Server error, contact support |
503 | Service Unavailable | Temporary maintenance or overload |
Authentication
All API requests require authentication using your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Rate Limits
Rate limits are enforced per API key and reset at the beginning of each time window. Exceeding limits returns a 429 status code.
Tip: Use the X-RateLimit-*
headers in responses to monitor your usage and implement proper backoff strategies.
Webhooks
Webhooks allow you to receive real-time notifications when evaluations are completed, enabling asynchronous processing for high-volume applications.
Webhook Events
Triggered when an evaluation request is successfully processed
Triggered when an evaluation request fails after retries
Webhook Payload Example
{
"event": "evaluation.completed",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"ancestry_id": "eval_abc123",
"request_id": "req_xyz789",
"trust_score": 87,
"factors": {
"source_quality": 92,
"recency": 85,
"provenance": 78
},
"processing_time_ms": 1250,
"webhook_id": "wh_def456"
},
"signature": "sha256=a1b2c3d4e5f6..."
}
Setting Up Webhooks
# Create a webhook endpoint
curl -X POST https://api.ancestor.cloud/v1/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/ancestor",
"events": ["evaluation.completed", "evaluation.failed"],
"secret": "your_webhook_secret"
}'
# Use async evaluation with webhook
curl -X POST https://api.ancestor.cloud/v1/evaluate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "What is the population of Japan?",
"answer": "According to World Bank, Japan has 125 million people",
"citations": [{"url": "https://data.worldbank.org/country/japan"}],
"options": {
"async": true,
"webhook_id": "wh_def456"
}
}'
Webhook Security
All webhook payloads are signed using HMAC-SHA256. Verify the signature to ensure authenticity:
// Node.js example
const crypto = require('crypto');
function verifyWebhookSignature(payload, signature, secret) {
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(payload, 'utf8')
.digest('hex');
return `sha256=${expectedSignature}` === signature;
}
// Verify in your webhook handler
const isValid = verifyWebhookSignature(
req.body,
req.headers['x-ancestor-signature'],
process.env.WEBHOOK_SECRET
);
Note: Webhook functionality is available for Pro and Enterprise plans.
SDKs & Libraries
Official SDKs and code examples to integrate Ancestor into your applications quickly.
# Python SDK
pip install ancestor-python
from ancestor import Client
client = Client(api_key="your_key")
result = client.evaluate(
question="What is the global temperature increase?",
answer="According to NASA, global temperature has increased by 1.1°C since 1880",
citations=[{"url": "https://climate.nasa.gov/evidence/"}]
)
print(f"Trust Score: {result.trust_score}")
print(f"Explanation: {result.explanation}")
# Access detailed factors
factors = result.factors
print(f"Source Quality: {factors.source_quality}")
print(f"Recency: {factors.recency}")
print(f"Provenance: {factors.provenance}")
Need help getting started? Check out our comprehensive documentation and examples.
View Full DocumentationUse Cases
Integrate source quality verification across your AI-powered applications and workflows.
LLM Applications
Verify sources in language model responses to ensure your AI applications provide trustworthy information to users.
- • Real-time source validation for AI assistants
- • Trust scoring for generated content
- • Automated fact-checking workflows
RAG Systems
Score reliability of retrieved documents in RAG pipelines to improve the quality of context-aware responses.
- • Document quality assessment
- • Source ranking for retrieval
- • Context reliability scoring
Conversational AI
Validate citations in chatbot responses to build user trust and ensure accurate information delivery.
- • Citation validation for chatbots
- • Trust indicators in conversations
- • Source transparency features
Research Platforms
Assess source credibility in LLM-assisted research to maintain academic and professional standards.
- • Academic source verification
- • Research quality assurance
- • Citation credibility analysis
Ready to enhance your application with source quality verification?
Contact for Early AccessSimple, transparent pricing
Choose the plan that fits your needs. Start free and scale as you grow.
Free
- API access
- Basic support
- 100 requests/hour
- Community support
Pro
- Everything in Free
- Advanced analytics & insights
- Priority email support
- 1,000 requests/hour
- Webhook support
- Detailed audit trails
Enterprise
- Everything in Pro
- Custom rate limits
- Dedicated support
- SLA guarantees
- Custom integrations
All plans include comprehensive API documentation, SDKs, and 99.9% uptime SLA.