跳转到主要内容
1

Get your API key

  1. Sign up for a free account.
  2. Open your Dashboard.
  3. Click Generate Key in the API Keys section.
Copy your key immediately. It starts with rail_ and will not be shown again.
2

Verify your key

curl https://api.responsibleailabs.ai/health
Response
{ "status": "healthy", "service": "rail-score-engine" }
3

Install an SDK

pip install rail-score-sdk
4

Score your first response

from rail_score_sdk import RailScoreClient

client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

result = client.eval(
    content="Establishing a consistent sleep schedule and limiting screen "
            "time before bed are well-supported strategies for better sleep.",
    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}/10")
{
  "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.00 },
      "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
}
5

Try deep mode

Deep mode adds per-dimension explanations, issue detection, and improvement suggestions.
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,
)

for dim, scores in result.dimension_scores.items():
    print(f"{dim}: {scores.score}/10")
    if scores.explanation:
        print(f"  Why: {scores.explanation}")
    if scores.issues:
        print(f"  Issues: {scores.issues}")

What’s next

Concepts: Evaluation

Understand basic vs deep mode, scoring tiers, and custom weights.

Concepts: Safe Regeneration

Auto-fix content that scores below your thresholds.

Integrations

Wrap your OpenAI, Anthropic, or Gemini calls with automatic RAIL scoring.

Python SDK

Full SDK reference with sync/async clients.