Get started with RAIL

Three quick steps to evaluate your AI outputs with RAIL. You can use cURL, Python, or Next.js—copy & paste and you’re done.

View API docs
Step 1

Create your account & generate a key

Sign up or log in, then click Generate API key on your dashboard.

Step 2

Send content to RAIL Score (basic)

Take any model output, pass it to our /v1/rail/score/basic endpoint, and get scores.

cURL
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."
  }'
Python (requests)
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())
Next.js / Node (fetch)
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();
}
Step 3

Review results & iterate

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.

Explore full API reference

Custom weights example

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
    }
  }'