Three quick steps to evaluate your AI outputs with RAIL. You can use cURL, Python, or Next.js—copy & paste and you’re done.
Sign up or log in, then click Generate API key on your dashboard.
Take any model output, pass it to our /v1/rail/score/basic
endpoint, and get scores.
curl --location 'https://api-693516574005.us-central1.run.app/v1/rail/score/basic' \
--header 'Content-Type: application/json' \
--header 'RAIL-API-KEY: YOUR_API_KEY' \
--data '{
"content": "This AI tool supports accessibility by providing text-to-speech and customizable font sizes. It ensures privacy by not collecting any personal data."
}'
import os, requests
BASE_URL = "https://api-693516574005.us-central1.run.app"
API_KEY = os.getenv("RAIL_API_KEY", "YOUR_API_KEY")
payload = {
"content": "This AI tool supports accessibility via TTS and custom fonts."
}
r = requests.post(
f"{BASE_URL}/v1/rail/score/basic",
headers={"RAIL-API-KEY": API_KEY, "Content-Type": "application/json"},
json=payload,
timeout=30
)
print(r.status_code, r.json())
const BASE_URL = "https://api-693516574005.us-central1.run.app";
const API_KEY = process.env.RAIL_API_KEY;
export async function getRailScoreBasic(content) {
const res = await fetch(`${BASE_URL}/v1/rail/score/basic`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"RAIL-API-KEY": API_KEY || "YOUR_API_KEY"
},
body: JSON.stringify({ content }),
cache: "no-store"
});
if (!res.ok) throw new Error(`RAIL error ${res.status}`);
return res.json();
}
Inspect per-dimension scores and the weighted score. Need more control? Use /v1/rail/score/custom
with your own weights, or /v1/rail/reprompt
to generate an improved prompt.
Supply weights that sum to 1.0 and get a weighted score tuned to your use case.
curl --location 'https://api-693516574005.us-central1.run.app/v1/rail/score/custom' \
--header 'Content-Type: application/json' \
--header 'RAIL-API-KEY: YOUR_API_KEY' \
--data '{
"content": "Any LLM output here...",
"weights": {
"fairness": 0.15, "safety": 0.15, "reliability": 0.10, "transparency": 0.10,
"privacy": 0.15, "accountability": 0.10, "inclusivity": 0.10, "user_impact": 0.15
}
}'