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

# Quickstart

> RAIL Score API के साथ 5 मिनट से कम में शुरू करें।

<Steps>
  <Step title="अपनी API key लें">
    1. [फ्री account के लिए sign up करें](https://responsibleailabs.ai/register)।
    2. अपना [Dashboard](https://responsibleailabs.ai/dashboard) खोलें।
    3. API Keys section में **Generate Key** पर click करें।

    <Warning>
      अपनी key तुरंत copy कर लें। यह `rail_` से शुरू होती है और दोबारा नहीं दिखाई जाएगी।
    </Warning>
  </Step>

  <Step title="अपनी key verify करें">
    <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 install करें">
    <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="अपनी पहली response को score करें">
    कोई AI से बना content भेजें और बदले में RAIL score पाएं। यहाँ हम एक आम support-bot की reply को evaluate कर रहे हैं।

    <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" }
    }
    ```

    **Response को कैसे पढ़ें:**

    * `rail_score.score` — overall score, 0–10 के बीच, जो आठों dimensions का weighted average है। यहाँ `7.6` **Good** band में है।
    * `dimension_scores` — हर एक [RAIL dimension](/concepts/rail-framework) का score और confidence। यहाँ जो scores कम हैं (transparency, accountability, inclusivity करीब 6.6) वही बताते हैं कि क्या सुधारना है: reply यह नहीं बताती कि किससे contact करना है या अगर email कभी न आए तो क्या होगा।
    * `policy_outcome` — आपकी [application की policy](/concepts/applications) ने इस result को कैसे judge किया: pass होने के लिए threshold, क्या यह `passed` हुआ, और अभी enforcement active है या नहीं। यहाँ यह monitor mode में है (`enforced: false`), इसलिए verdict report तो होता है पर response बदला नहीं जाता।
  </Step>

  <Step title="Deep mode के साथ और गहराई में जाएं">
    Basic mode आपको scores बताता है। **Deep mode** उसी content का ज्यादा detailed analysis करता है और हर dimension के लिए explanation, issue tags, और सुधार के suggestions जोड़ता है, ताकि आप देख सकें कि कोई dimension जैसा score हुआ *वैसा क्यों* हुआ।

    ```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" }
    }
    ```

    अब हर dimension के साथ एक `explanation` और `issues` आते हैं, और response सारे flagged issues को top-level `issues` array में इकट्ठा कर देता है, जो review queue या dashboard में दिखाने के लिए तैयार रहता है।
  </Step>
</Steps>

## आगे क्या

<CardGroup cols={2}>
  <Card title="Concepts: Evaluation" icon="magnifying-glass" href="/concepts/evaluation">
    Basic vs deep mode, scoring tiers, और custom weights को समझें।
  </Card>

  <Card title="Concepts: Safe Regeneration" icon="rotate" href="/concepts/safe-regeneration">
    आपके thresholds से नीचे score करने वाले content को auto-fix करें।
  </Card>

  <Card title="Integrations" icon="plug" href="/integrations/overview">
    अपने OpenAI, Anthropic, या Gemini calls को automatic RAIL scoring के साथ wrap करें।
  </Card>

  <Card title="Python SDK" icon="python" href="/sdk/python/overview">
    sync/async clients के साथ पूरा SDK reference।
  </Card>
</CardGroup>
