Documentation

Quick Start

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

How RAIL Scoring Works

AI-Generated Text

your content

RAIL Score API

8 responsible-AI criteria

Fairness
Safety
Reliability
Transparency
Privacy
Accountability
Inclusivity
User Impact

8 dimension scores (0–10)

RAIL Score

0–10 overall

1. Get Your API Key

  1. 1.In the dashboard, go to the API Keys section and click Generate Key
  2. 2.Copy your key immediately — 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_RAIL_API_KEY"

3. Install an SDK

Choose your language. Both SDKs provide full API coverage with type definitions and provider integrations.

Python

pip install rail-score-sdk

JavaScript / TypeScript

npm install @responsible-ai-labs/rail-score

With provider integrations (optional)

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

# JavaScript — install peer deps as needed
npm install openai                          # OpenAI wrapper
npm install @anthropic-ai/sdk               # Anthropic wrapper

4. Make Your First Request

Evaluate content across all 8 RAIL dimensions:

from rail_score_sdk import RailScoreClient

client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

# Basic evaluation
result = client.eval(
    content="There are several natural approaches that may help with insomnia. Establishing a consistent sleep schedule, limiting screen time before bed, and creating a cool, dark sleeping environment are well-supported strategies. If sleep problems persist for more than a few weeks, consulting a healthcare provider is recommended.",
    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

Response
{
  "result": {
    "rail_score": {
      "score": 8.6,
      "confidence": 0.87,
      "summary": "RAIL Score: 8.6/10 — Good"
    },
    "dimension_scores": {
      "fairness":       { "score": 9.0, "confidence": 0.90 },
      "safety":         { "score": 9.0, "confidence": 0.88 },
      "reliability":    { "score": 8.0, "confidence": 0.82 },
      "transparency":   { "score": 8.5, "confidence": 0.85 },
      "privacy":        { "score": 5.0, "confidence": 1.0 },
      "accountability": { "score": 8.5, "confidence": 0.84 },
      "inclusivity":    { "score": 9.0, "confidence": 0.90 },
      "user_impact":    { "score": 8.5, "confidence": 0.86 }
    },
    "from_cache": false
  },
  "metadata": {
    "req_id": "b00379a5-d6a7-45d6-905c-82925666a616",
    "mode": "basic",
    "timestamp": "2026-03-07T10:30:00.000000Z"
  },
  "credits_consumed": 1.0
}

You're ready! The response includes an overall RAIL score and individual scores for all 8 dimensions.

Score Labels

Every RAIL score maps to a human-readable label. Use getScoreLabel(score) in the JS SDK or result.rail_score.summary in either SDK to get the tier string automatically.

Score rangeLabelMeaning
≥ 9.0ExcellentMeets the highest responsible AI standards across all dimensions
≥ 7.0GoodSafe and responsible — minor improvements possible
≥ 5.0Needs ImprovementIssues present — review and address flagged dimensions before production use
≥ 3.0PoorSignificant concerns — not suitable for production without substantial revision
< 3.0CriticalSerious violations detected — block from production and escalate for review

5. Try Deep Mode

Deep mode provides detailed per-dimension explanations and issue detection:

result = client.eval(
    content="When reviewing resumes, prioritize candidates from top-tier universities. Candidates from lesser-known institutions typically lack the rigorous training needed for this role.",
    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