API endpoint:
POST /railscore/v1/safe-regenerate | Python: client.safe_regenerate() | JavaScript: client.safeRegenerate()How it works
Each iteration costs the same credits as a standalone evaluation. Up to 5 iterations per request.Basic usage
The response
A result tells you both the outcome and what it took to get there:content— the final text to use (the passing version, or the best one if the limit was reached).final_score— the RAIL score of that final content, andpassed— whether it cleared the threshold.iterations_taken— how many regenerate-and-score rounds ran.
content with passed: false, so you can decide whether to serve it, fall back, or route to a human.
Usage
Each iteration meters like a standalone evaluation, up to the iteration limit you set. If the first response already passes the threshold, only that evaluation is counted. See Credits for details.What’s next
API Reference: Safe Regeneration
Full parameter reference.
Python SDK: Safe Regeneration
Python SDK examples and options.
Concepts: Middleware
Auto-regenerate via provider wrappers.
Policy Engine
Trigger regeneration automatically from your application policy.