> ## Documentation Index
> Fetch the complete documentation index at: https://docs.responsibleailabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Evaluation

> POST /railscore/v1/eval - Score AI content across 8 RAIL dimensions.

<Info>
  **Concept:** [Evaluation](/concepts/evaluation) | **Python:** [`client.eval()`](/sdk/python/evaluation)
</Info>

## Parameters

<ParamField body="content" type="string" required>
  The AI-generated text to evaluate. Must be 10–10,000 characters.
</ParamField>

<ParamField body="mode" type="string" default="basic">
  Evaluation mode:

  * `"basic"` — RAIL's core scoring models for fast, real-time scoring.
  * `"deep"` — a deeper, more detailed analysis that can also return per-dimension explanations and issue tags.
  * `"auto"` — runs `basic`, and automatically escalates to `deep` only when a real issue is detected (a low-scoring or low-confidence dimension, or a flagged signal). You get fast scoring on clean content and deep analysis exactly where it matters. The response `result` includes `resolved_mode` (`"basic"` or `"deep"` — which tier actually ran) and `escalated` (boolean). Billed at the tier that ran.
</ParamField>

<ParamField body="dimensions" type="string[]">
  Subset of dimensions to score. Omit to score all 8. Options: `fairness`, `safety`, `reliability`, `transparency`, `privacy`, `accountability`, `inclusivity`, `user_impact`.
</ParamField>

<ParamField body="weights" type="object">
  Custom dimension weights. Values must sum to 100. E.g. `{"safety": 25, "reliability": 20, ...}`.
</ParamField>

<ParamField body="domain" type="string">
  Domain context hint: `"general"`, `"healthcare"`, `"legal"`, `"finance"`, `"code"`. Improves scoring accuracy.
</ParamField>

<ParamField body="include_explanations" type="boolean" default="false">
  Include per-dimension explanations (deep mode only).
</ParamField>

<ParamField body="include_issues" type="boolean" default="false">
  Include detected issue tags per dimension (deep mode only).
</ParamField>

<ParamField body="include_suggestions" type="boolean" default="false">
  Include improvement suggestions per dimension (deep mode only).
</ParamField>

## Request

```bash theme={null}
curl -X POST https://api.responsibleailabs.ai/railscore/v1/eval \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_RAIL_API_KEY" \
  -d '{
    "content": "To reset your password, open Settings, choose Security, and select Reset password. We will email you a secure link that expires in 30 minutes.",
    "mode": "basic"
  }'
```

## Response

```json theme={null}
{
  "result": {
    "rail_score": { "score": 7.6, "confidence": 0.51, "summary": "RAIL Score: 7.6/10 — Good" },
    "dimension_scores": {
      "fairness":       { "score": 7.7, "confidence": 0.84 },
      "safety":         { "score": 10.0, "confidence": 0.70 },
      "reliability":    { "score": 7.7, "confidence": 0.16 },
      "transparency":   { "score": 6.5, "confidence": 0.50 },
      "privacy":        { "score": 8.0, "confidence": 0.59 },
      "accountability": { "score": 6.6, "confidence": 0.97 },
      "inclusivity":    { "score": 6.6, "confidence": 0.74 },
      "user_impact":    { "score": 7.8, "confidence": 0.09 }
    },
    "from_cache": false
  },
  "policy_outcome": {
    "enforced": false,
    "enforcement": "block",
    "threshold": 7.0,
    "score": 7.6,
    "passed": true
  },
  "metadata": { "req_id": "abc123", "mode": "basic", "timestamp": "2026-03-31T10:00:00Z" },
  "credits_consumed": 1.0
}
```

<ResponseField name="policy_outcome" type="object">
  How your application's [policy](/concepts/policy-engine) judged this result.

  * `enforcement` — the policy's mode (`log_only`, `block`, or `regenerate`).
  * `threshold` — the overall score required to pass.
  * `score` — this result's overall score.
  * `passed` — whether the score met the threshold.
  * `enforced` — whether the outcome was acted on. When `false`, the policy is in monitor mode: the verdict is reported but the response is not altered, so you can see what *would* be blocked. Check the live state with [`GET /config`](/api-reference/config).

  When enforcement is active and a result does not pass, a `block` policy returns `422 POLICY_BLOCKED` and a `regenerate` policy attempts a safe rewrite before applying its fallback.
</ResponseField>

<ResponseField name="result.rail_score.score" type="number">
  Overall RAIL score (0.0–10.0), weighted average of all evaluated dimensions.
</ResponseField>

<ResponseField name="result.rail_score.confidence" type="number">
  Model confidence in the score (0.0–1.0).
</ResponseField>

<ResponseField name="result.dimension_scores" type="object">
  Per-dimension scores. Each entry has `score` (0–10) and `confidence` (0–1). In deep mode: also `explanation`, `issues`, `suggestions`.
</ResponseField>

<ResponseField name="result.from_cache" type="boolean">
  `true` if this result was returned from cache (0 credits charged).
</ResponseField>

<ResponseField name="result.resolved_mode" type="string">
  For `mode: "auto"`, the tier that actually ran — `"basic"` or `"deep"`. Use `result.escalated` to tell whether the deeper analysis was invoked.
</ResponseField>

<ResponseField name="credits_consumed" type="number">
  Credits charged for this request. `0` for cached responses.
</ResponseField>
