Veritas AI API
Advanced multi-model spam detection, toxicity, sentiment, and content safety via a simple REST API.
Getting Started
Welcome to Veritas AI. Use our REST API to run comprehensive spam detection and content analysis with specialized models.
Why Veritas?
- Specialized models for spam, toxicity, sentiment, and safety
- High accuracy with model consensus
- Global support across 20+ languages
- Real-time low-latency responses
- Simple REST integration
Quick Example
curl -X POST https://spam.audent.ai/check \ -H "Content-Type: application/json" \ -H "X-API-KEY: your-api-key" \ -d '{ "text": "Congratulations! You'\''ve won a $1,000 gift card!" }'
{ "processing_time": 482, "results": { "bert": { "result": "Not Spam", "processing_time": 2 }, "otis": { "result": { "prediction": "Spam", "probability": 0.9999 }, "processing_time": 4 }, "roberta": { "result": "Spam", "processing_time": 393 }, "sentiment": { "result": { "label": "Very Negative", "score": 0.55 }, "processing_time": 21 } } }
Authentication
Include your API key in the header of each request.
API Key Header
Send your key via X-API-KEY
:
X-API-KEY: your-api-key-here
Demo Access
For testing, use the demo key:
X-API-KEY: demo
Note: Demo is limited to 1 request every 5 seconds.
Security Tips
- Do not expose your API key in client-side code
- Store keys in environment variables
- Rotate keys periodically
- Monitor usage
API Endpoints
Use the comprehensive endpoint or call individual models.
curl -X POST https://spam.audent.ai/check \ -H "Content-Type: application/json" \ -H "X-API-KEY: your-api-key" \ -d '{ "text": "Congratulations! You'\''ve won a $1,000 gift card!" }'
Request Body
{ "text": "Your text content to analyze" }
Example Response
{ "is_spam": true, "processing_time": 643, "results": { "bert": { "is_spam": false, "processing_time": 6, "result": "Not Spam" }, "bertsms": { "is_spam": false, "processing_time": 0, "result": { "probability": 0.9273, "type": "Not Spam" } }, "detoxify": { "processing_time": 45, "result": { "details": [...], "prediction": { "label": "ok", "probability": 0.00083 } } }, "koala": { "processing_time": 77, "result": { "details": [...], "prediction": "OK" } }, "otis": { "is_spam": true, "processing_time": 5, "result": { "prediction": "Spam", "probability": 0.99996 } }, "roberta": { "is_spam": true, "processing_time": 489, "result": "Spam" }, "sentiment": { "processing_time": 20, "result": { "label": "Very Negative", "score": 0.5498 } } }, "spam_detections_count": 2, "spam_detectors_count": 4 }
/bert
— BERT MoE spam detection/bertsms
— BERT Tiny SMS/koala
— Content safety/otis
— Advanced spam intelligence/roberta
— Enterprise spam/sentiment
— Multilingual sentiment/detoxify
— Toxicity detection/unicodedetect
— Unicode spam patterns
Request Body
{ "text": "Your text content to analyze", "threshold": 0.15 }
Example Response
{ "result": { "prediction": "Spam", "suspicious_ratio": 0.25, "threshold_used": 0.15 }, "processing_time": 12, "rate_limit": { "limits": [ { "limit": "60 per minute", "remaining": 59, "reset_at": "2023-10-01T12:00:00Z" } ] } }
Request Body
{ "text": "Your text content to analyze" }
Example Response
{ "results": { "bert": { "result": "Not Spam", "processing_time": 6, "is_spam": false }, "roberta": { "result": "Spam", "processing_time": 489, "is_spam": true }, "otis": { "result": { "prediction": "Spam", "probability": 0.9999 }, "processing_time": 5, "is_spam": true }, "bertsms": { "result": { "type": "Not Spam", "probability": 0.9273 }, "processing_time": 2, "is_spam": false }, "detoxify": { "result": { "prediction": {"label": "ok", "probability": 0.001}, "details": [...] }, "processing_time": 45 } }, "processing_time": 547, "is_spam": true, "spam_detections_count": 2, "spam_detectors_count": 4, "rate_limit": { "limits": [ { "limit": "60 per minute", "remaining": 58, "reset_at": "2023-10-01T12:00:00Z" } ] } }
Request Body
{ "text": "Your text content to analyze" }
Example Response
{ "results": { "detoxify": { "result": { "prediction": { "label": "toxicity", "probability": 0.9977 }, "details": [ {"label": "toxicity", "probability": 0.9977}, {"label": "severe_toxicity", "probability": 0.6995}, {"label": "obscene", "probability": 0.9852}, {"label": "threat", "probability": 0.0449}, {"label": "insult", "probability": 0.9720}, {"label": "identity_attack", "probability": 0.9054} ] }, "processing_time": 42 } }, "processing_time": 50, "is_toxic": true, "toxic_detections_count": 1, "toxic_detectors_count": 1, "rate_limit": { "limits": [ { "limit": "60 per minute", "remaining": 57, "reset_at": "2023-10-01T12:00:00Z" } ] } }
Request Body
{ "text": "Your text content to analyze", "config": { "preprocessing": { "settings": { "strip_urls": true, "strip_emails": true, "strip_phone_numbers": true } }, "spam": { "models": { "roberta": { "enabled": true, "authoritative": false }, "bert": { "enabled": true, "authoritative": true }, "otis": { "enabled": true, "required_probability": 80 } }, "spam_detection_logic": { "default_threshold": 2 } }, "toxicity": { "models": { "detoxify": { "enabled": true } }, "threshold": 0.15 } } }
Example Response
{ "results": { "preprocessing": { "result": { "stripped_urls": 1, "stripped_emails": 0, "stripped_phone_numbers": 0 }, "sanitized_text": "Check out this amazing offer!" }, "roberta": { "result": "Spam", "processing_time": 412, "is_spam": true }, "bert": { "result": "Spam", "processing_time": 8, "is_spam": true }, "otis": { "result": { "prediction": "Spam", "probability": 0.9999 }, "processing_time": 6, "is_spam": true }, "detoxify": { "result": { "prediction": {"label": "ok", "probability": 0.001}, "details": [...] }, "processing_time": 38 } }, "processing_time": 464, "is_spam": true, "spam_detections_count": 3, "spam_detectors_count": 3, "is_toxic": false, "is_ai": false }
Error Responses
{ "error": "Rate limit exceeded", "message": "Please wait before making another request", "retry_after": 5 }
{ "error": "Invalid request", "message": "Missing required field: text" }
AI Models Overview
Choose a specific model for your use case or run them all for comprehensive analysis.
Rate Limits & Usage
Limits vary by plan. Values below are examples.
Rate Limit Headers
Each response includes rate limit metadata:
X-RateLimit-Limit: 60 X-RateLimit-Remaining: 45 X-RateLimit-Reset: 1640995200
Handling 429
Use exponential backoff when you receive 429 responses:
async function makeAPIRequest(text, retries = 3) { for (let i = 0; i < retries; i++) { const res = await fetch('https://spam.audent.ai/check', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'your-api-key' }, body: JSON.stringify({ text }) }); if (res.status === 429) { const retryAfter = Number(res.headers.get('Retry-After')) || Math.pow(2, i); await new Promise(r => setTimeout(r, retryAfter * 1000)); continue; } return await res.json(); } }
Ready to get started?
Protect your app with Veritas AI spam and safety models.