Skip to main content
Concept: Evaluation | Python: client.eval()

Parameters

string
required
The AI-generated text to evaluate. Must be 10–10,000 characters.
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. When a dimensions subset is requested, only those dimensions can trigger the escalation (and its billing). The response result includes resolved_mode ("basic" or "deep" — which tier actually ran) and escalated (boolean). Billed at the tier that ran.
string[]
Subset of dimensions to score. Omit to score all 8. Options: fairness, safety, reliability, transparency, privacy, accountability, inclusivity, user_impact.
object
Custom dimension weights. Values must sum to 100. E.g. {"safety": 25, "reliability": 20, ...}.
string
Domain context hint: "general", "healthcare", "legal", "finance", "code". Improves scoring accuracy.
boolean
default:"false"
Include per-dimension explanations (deep mode only).
boolean
default:"false"
Include detected issue tags per dimension (deep mode only).
boolean
default:"false"
Include improvement suggestions per dimension (deep mode only).

Request

Response

object
How your application’s policy 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.
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.
number
Overall RAIL score (0.0–10.0), weighted average of all evaluated dimensions.
number
Model confidence in the score (0.0–1.0).
object
Per-dimension scores. Each entry has score (0–10) and confidence (0–1). In deep mode: also explanation, issues, suggestions.
boolean
true if this result was returned from cache (0 credits charged).
string
For mode: "auto", the tier that actually ran — "basic" or "deep". Use result.escalated to tell whether the deeper analysis was invoked.
boolean
Present (as true) only when the submitted content exceeds the analysis window (about 4,000 characters): the score reflects the leading portion of the content. Split longer content into multiple calls for full coverage.
number
Credits charged for this request. 0 for cached responses.