Documentation

API Reference

Complete reference for all RAIL Score API endpoints

API Endpoints at a Glance

Your Application
POST /eval

Score content across 8 RAIL dimensions. Basic or deep mode.

1–3 credits

POST /safe-regenerate

Evaluate + automatically improve content until thresholds are met.

2–15 credits

POST /compliance/check

Check content against regulatory frameworks (GDPR, HIPAA, etc.).

5–10 credits

Your Application (JSON Response)

Base URL

https://api.responsibleailabs.ai

Authentication

All scoring endpoints require a Bearer token in the Authorization header. Your API key starts with rail_.

Authorization: Bearer YOUR_RAIL_API_KEY

Endpoints Overview

POST/railscore/v1/eval

Score content across 8 RAIL dimensions. Supports basic and deep analysis modes, custom dimension selection, and custom weights.

POST/railscore/v1/safe-regenerate

Evaluate content against thresholds and iteratively regenerate improved versions until quality targets are met.

POST/railscore/v1/compliance/check

Assess content against regulatory frameworks: GDPR, CCPA, HIPAA, EU AI Act, India DPDP, India AI Governance.

POST/railscore/v1/agent/tool-call

Pre-execution evaluation of an agentic tool call. Returns ALLOW, FLAG, or BLOCK with compliance signals. Requires agent:evaluate scope.

POST/railscore/v1/agent/tool-result

Post-execution scan of a tool result. Checks for PII, prompt injection, and RAIL dimension violations.

POST/railscore/v1/agent/prompt-injection

Fast prompt injection classifier. Detects direct override, role hijack, jailbreak, data exfiltration, and indirect injection patterns.

GETPOSTDELETE/railscore/v1/agent/registry/tools

Manage your organization's Tool Risk Registry. List, register, and delete custom tool risk profiles. Org overrides take precedence over system defaults.

POST/verify

Verify your API key is valid and check your account status.

Request Lifecycle

Auth Check

API key valid?

Credits Check

balance sufficient?

Cache Lookup

cached result?

Scoring

ML + NLP pipeline

Response

JSON + credits_consumed

Cache hit → skip Scoring, return immediately at 0 credits

Error Handling

All errors return a JSON body with an error message.

CodeMeaning
400Bad Request — Invalid parameters, content too short/long, invalid mode or dimensions
401Unauthorized — Missing or invalid API key
402Insufficient Credits — Includes balance and required amounts
403Forbidden — API key inactive, suspended, or insufficient tier
422Unprocessable — Content refused due to critical ethical violations (regeneration only)
429Rate Limit Exceeded
500Internal Server Error

402 Error Example

{
  "error": "Insufficient credits: 0.5 available, 3.0 required",
  "balance": 0.5,
  "required": 3.0
}

Status & Support

Content Limits

EndpointMinMax
/eval10 chars10,000 chars
/compliance/check1 char50,000 chars