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_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.

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