API Reference
Complete reference documentation for all RAIL API endpoints with request/response examples.
Base URL
https://api.responsibleailabs.aiAll API endpoints use this base URL. Authentication is required for all requests using the Authorization: Bearer header.
API Categories
Utilities
Health checks, API key verification, and monitoring endpoints (no credits required)
Popular endpoints:
Evaluation
Score and analyze content across 8 RAIL dimensions
Popular endpoints:
Generation
Generate safe, responsible AI content
Popular endpoints:
Compliance
Regulatory compliance for 7 frameworks: GDPR, EU AI Act, HIPAA, CCPA, India DPDP, SOC2, NIST
Popular endpoints:
Authentication
All API requests require authentication using your API key. Include your key in the Authorization header:
curl -X POST "https://api.responsibleailabs.ai/railscore/v1/score/basic" \
-H "Authorization: Bearer your-rail-api-key" \
-H "Content-Type: application/json" \
-d '{
"content": "Your content to evaluate"
}'Security Best Practices
- •Never expose your API key in client-side code or public repositories
- •Always make API calls from your backend server
- •Rotate your API keys regularly for enhanced security
- •Use environment variables to store API keys
Response Format
All endpoints return JSON responses with comprehensive scoring data. Here's a typical response:
{
"scores": {
"fairness": {"score": 8.5, "confidence": 0.92},
"safety": {"score": 9.2, "confidence": 0.95},
"reliability": {"score": 8.8, "confidence": 0.89},
"transparency": {"score": 8.4, "confidence": 0.87},
"privacy": {"score": 9.1, "confidence": 0.94},
"accountability": {"score": 8.6, "confidence": 0.88},
"inclusivity": {"score": 8.3, "confidence": 0.86},
"user_impact": {"score": 8.7, "confidence": 0.91}
},
"overall_rail_score": {
"score": 8.7,
"confidence": 0.90
}
}Each dimension includes a score (0-10) and a confidence rating (0-1) indicating the reliability of the assessment.
Error Handling
The API uses standard HTTP status codes. Here are the most common error responses:
| Code | Meaning | Solution |
|---|---|---|
401 | Invalid/missing API key | Check your Authorization: Bearer header |
402 | Insufficient credits | Purchase credits or upgrade plan |
403 | Plan tier insufficient | Upgrade to required tier |
429 | Rate limit exceeded | Wait before retrying |
500 | Internal server error | Retry or contact support |
Rate Limits
Rate limits vary by plan tier:
Ready to Start Building?
Explore detailed documentation for each API category.