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

# クイックスタート

> 5分以内に RAIL Score API を使い始めましょう。

<Steps>
  <Step title="API キーを取得する">
    1. [無料アカウントに登録します](https://responsibleailabs.ai/register)。
    2. [ダッシュボード](https://responsibleailabs.ai/dashboard)を開きます。
    3. API キーセクションで **Generate Key** をクリックします。

    <Warning>
      キーはすぐにコピーしてください。`rail_` で始まり、二度と表示されません。
    </Warning>
  </Step>

  <Step title="キーを検証する">
    <CodeGroup>
      ```bash Health check theme={null}
      curl https://api.responsibleailabs.ai/health
      ```

      ```bash Key verification theme={null}
      curl -X POST https://api.responsibleailabs.ai/verify \
        -H "Authorization: Bearer YOUR_RAIL_API_KEY"
      ```
    </CodeGroup>

    ```json Response theme={null}
    { "status": "healthy", "service": "rail-score-engine" }
    ```
  </Step>

  <Step title="SDK をインストールする">
    <CodeGroup>
      ```bash Python theme={null}
      pip install rail-score-sdk
      ```

      ```bash JavaScript theme={null}
      npm install @responsible-ai-labs/rail-score
      ```

      ```bash Python (with OpenAI wrapper) theme={null}
      pip install "rail-score-sdk[openai]"
      ```

      ```bash Python (all integrations) theme={null}
      pip install "rail-score-sdk[integrations]"
      ```
    </CodeGroup>
  </Step>

  <Step title="最初のレスポンスをスコアリングする">
    AI が生成したコンテンツを送信し、RAIL スコアを受け取ります。ここでは典型的なサポートボットの返信を評価します。

    <CodeGroup>
      ```python Python theme={null}
      from rail_score_sdk import RailScoreClient

      client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

      result = client.eval(
          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",
      )

      print(f"RAIL Score: {result.rail_score.score}/10")
      for dim, scores in result.dimension_scores.items():
          print(f"  {dim}: {scores.score}/10")
      ```

      ```typescript JavaScript theme={null}
      import { RailScoreClient } from "@responsible-ai-labs/rail-score";

      const client = new RailScoreClient({ apiKey: "YOUR_RAIL_API_KEY" });

      const result = await client.eval({
        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",
      });

      console.log(`RAIL Score: ${result.railScore.score}/10`);
      ```

      ```bash cURL 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"}'
      ```
    </CodeGroup>

    ```json Response 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": { "enforcement": "block", "threshold": 7.0, "score": 7.6, "passed": true, "enforced": false },
      "metadata": { "req_id": "b00379a5-d6a7-45d6-905c-82925666a616", "mode": "basic" }
    }
    ```

    **レスポンスの読み方:**

    * `rail_score.score` — 全体スコア (0〜10) で、8 つの次元の加重平均です。ここでの `7.6` は **Good** バンドに入ります。
    * `dimension_scores` — 8 つの [RAIL 次元](/concepts/rail-framework)それぞれのスコアと信頼度です。ここでスコアが低い項目 (透明性、説明責任、包括性が 6.6 前後) は改善すべき点を示しています。この返信は、誰に連絡すればよいか、メールが届かなかった場合にどうなるかを説明していません。
    * `policy_outcome` — [アプリケーションのポリシー](/concepts/applications)がこの結果をどう判断したかを示します。合格に必要なしきい値、`passed` したかどうか、そして現在エンフォースメントが有効かどうかです。ここではモニターモード (`enforced: false`) のため、判定は報告されますがレスポンス自体は変更されません。
  </Step>

  <Step title="deep モードでさらに深く分析する">
    basic モードはスコアを教えてくれます。**deep モード**は同じコンテンツについてより詳細な分析を実行し、次元ごとの説明、問題タグ、改善提案を追加します。これにより、ある次元が*なぜ*そのスコアになったのかを確認できます。

    ```python theme={null}
    result = client.eval(
        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="deep",
        include_explanations=True,
        include_issues=True,
    )

    for dim, scores in result.dimension_scores.items():
        print(f"{dim}: {scores.score}/10 — {scores.explanation}")
    ```

    ```json Response (excerpt) theme={null}
    {
      "result": {
        "rail_score": { "score": 8.1, "confidence": 0.77, "summary": "RAIL Score: 8.1/10 — Good" },
        "dimension_scores": {
          "transparency": {
            "score": 7.0, "confidence": 0.8,
            "explanation": "The process is mostly clear, but more details on security could help.",
            "issues": ["Lack of detailed security information"]
          },
          "safety": {
            "score": 8.0, "confidence": 0.8,
            "explanation": "The process includes a secure link, but users must be cautious of phishing.",
            "issues": ["Potential phishing risks"]
          }
        },
        "issues": [
          { "dimension": "safety", "description": "Potential phishing risks" },
          { "dimension": "transparency", "description": "Lack of detailed security information" }
        ]
      },
      "metadata": { "mode": "deep" }
    }
    ```

    各次元が `explanation` と `issues` を持つようになり、レスポンスはフラグ付けされたすべての問題をトップレベルの `issues` 配列にまとめます。レビューキューやダッシュボードにそのまま表示できます。
  </Step>
</Steps>

## 次のステップ

<CardGroup cols={2}>
  <Card title="コンセプト: 評価" icon="magnifying-glass" href="/concepts/evaluation">
    basic モードと deep モード、スコアリングティア、カスタム重みを理解します。
  </Card>

  <Card title="コンセプト: 安全な再生成" icon="rotate" href="/concepts/safe-regeneration">
    しきい値を下回ったコンテンツを自動的に修正します。
  </Card>

  <Card title="インテグレーション" icon="plug" href="/integrations/overview">
    OpenAI、Anthropic、Gemini の呼び出しをラップし、RAIL スコアリングを自動化します。
  </Card>

  <Card title="Python SDK" icon="python" href="/sdk/python/overview">
    同期/非同期クライアントを含む完全な SDK リファレンス。
  </Card>
</CardGroup>
