Documentation

Quick Start

Get up and running with the RAIL Score API in under 5 minutes

1. Get Your API Key

  1. a.Sign up for a free account
  2. b.Navigate to your dashboard
  3. c.Click "Generate Key" in the API Keys section
  4. d.Save your API key — it starts with rail_ and won't be shown again

2. Verify Your Key

Test that the API is reachable and your key works:

curl https://api.responsibleailabs.ai/health

Expected response:

{ "status": "healthy", "service": "rail-score-engine" }

Then verify your API key:

curl -X POST https://api.responsibleailabs.ai/verify \
  -H "Authorization: Bearer YOUR_API_KEY"

3. Install the SDK

The rail-score-sdk provides sync and async clients with full type hints.

Python (recommended)

pip install rail-score-sdk

With provider integrations

pip install "rail-score-sdk[openai]"       # OpenAI wrapper
pip install "rail-score-sdk[integrations]"  # All integrations

4. Make Your First Request

Evaluate content across all 8 RAIL dimensions:

from rail_score_sdk import RailScoreClient

client = RailScoreClient(api_key="YOUR_API_KEY")

# Basic evaluation (1 credit)
result = client.eval(
    content="AI systems should treat all users equally regardless of background.",
    mode="basic"
)

print(f"RAIL Score: {result.rail_score.score}/10")
print(f"Confidence: {result.rail_score.confidence}")

for dim, scores in result.dimension_scores.items():
    print(f"  {dim}: {scores.score} (confidence: {scores.confidence})")

Example Response

{
  "result": {
    "rail_score": {
      "score": 8.4,
      "confidence": 0.85,
      "summary": "RAIL Score: 8.4/10 — Good"
    },
    "dimension_scores": {
      "fairness":       { "score": 9.0, "confidence": 0.9 },
      "safety":         { "score": 8.5, "confidence": 0.85 },
      "reliability":    { "score": 8.0, "confidence": 0.8 },
      "transparency":   { "score": 8.0, "confidence": 0.85 },
      "privacy":        { "score": 5.0, "confidence": 1.0 },
      "accountability": { "score": 8.5, "confidence": 0.8 },
      "inclusivity":    { "score": 9.5, "confidence": 0.9 },
      "user_impact":    { "score": 8.0, "confidence": 0.8 }
    },
    "from_cache": false
  },
  "metadata": {
    "req_id": "b00379a5-d6a7-45d6-905c-82925666a616",
    "method": "rail_core",
    "model": "hybrid",
    "mode": "basic",
    "latency_ms": 423.5,
    "timestamp": "2026-02-26T10:30:00.000000Z"
  },
  "credits_consumed": 1.0
}

You're ready! The response includes an overall RAIL score, individual scores for all 8 dimensions, and a credits_consumed field showing the cost.

5. Try Deep Mode

Deep mode uses LLM-as-Judge for detailed per-dimension explanations and issue detection (3 credits):

result = client.eval(
    content="Your AI-generated text here...",
    mode="deep",
    include_explanations=True,
    include_issues=True,
    include_suggestions=True
)

# Access per-dimension explanations
for dim, scores in result.dimension_scores.items():
    print(f"{dim}: {scores.score}/10")
    if scores.explanation:
        print(f"  → {scores.explanation}")
    if scores.issues:
        print(f"  Issues: {scores.issues}")

Next Steps