> ## 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.

# 安全な再生成

> POST /railscore/v1/safe-regenerate - コンテンツがしきい値を超えるまで評価して再生成します。

<Info>
  **コンセプト:** [安全な再生成](/concepts/safe-regeneration) | **Python:** [`client.safe_regenerate()`](/sdk/python/safe-regeneration)
</Info>

## パラメータ

<ParamField body="content" type="string" required>
  評価し、必要に応じて再生成する初期の AI 生成テキスト。
</ParamField>

<ParamField body="prompt" type="string" required>
  そのコンテンツを生成した元のユーザープロンプト。再生成のガイドに使用されます。
</ParamField>

<ParamField body="threshold" type="number" required>
  許容できる最小の RAIL スコア (0〜10)。このスコアを下回るコンテンツは再生成されます。
</ParamField>

<ParamField body="mode" type="string" default="basic">
  各反復で使用する評価の深さ: 高速なスコアリングには `"basic"`、より詳細な分析には `"deep"`。
</ParamField>

<ParamField body="max_iterations" type="integer" default="3">
  最大の再生成試行回数 (1〜5)。
</ParamField>

<ParamField body="dimensions" type="string[]">
  しきい値を適用する特定の次元。8 つすべてに適用するには省略します。
</ParamField>

## リクエスト

```bash theme={null}
curl -X POST https://api.responsibleailabs.ai/railscore/v1/safe-regenerate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_RAIL_API_KEY" \
  -d '{
    "content": "Prioritize candidates from Ivy League universities for this role.",
    "prompt": "What hiring criteria should we use?",
    "threshold": 7.0,
    "mode": "basic",
    "max_iterations": 3
  }'
```

## レスポンス

```json theme={null}
{
  "result": {
    "content": "Evaluate candidates based on demonstrated skills, relevant experience, and problem-solving ability.",
    "final_score": 8.4,
    "passed_threshold": true,
    "iterations_taken": 2,
    "iteration_scores": [4.2, 8.4],
    "from_cache": false
  },
  "credits_consumed": 2.0
}
```

<ResponseField name="result.content" type="string">
  最終的なコンテンツ。元のもの (合格した場合) または最良の再生成バージョン。
</ResponseField>

<ResponseField name="result.final_score" type="number">
  返されたコンテンツの RAIL スコア。
</ResponseField>

<ResponseField name="result.passed_threshold" type="boolean">
  最終的なコンテンツがしきい値を満たした場合は `true`。
</ResponseField>

<ResponseField name="result.iterations_taken" type="integer">
  実行された評価+再生成サイクルの回数。
</ResponseField>

<ResponseField name="credits_consumed" type="number">
  このリクエストの使用量。各反復は単独の評価と同様に計測され、最初のレスポンスがすでに合格した場合は 1 回分のみが課金されます。
</ResponseField>
