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

# Health & Verify

> Health check और API key verification endpoints - दोनों free हैं और कोई credits नहीं लगते।

दो utility endpoints जो **0 credits** cost करते हैं और सभी plans के लिए available हैं।

## Health check

`GET /health` - current service status return करता है। Authentication required नहीं है।

```bash theme={null}
curl https://api.responsibleailabs.ai/health
```

```json theme={null}
{
  "status": "healthy",
  "service": "rail-score-engine"
}
```

<ResponseField name="status" type="string">
  `"healthy"` जब service fully operational हो। इसे uptime monitoring और load balancer health probes के लिए use करें।
</ResponseField>

<ResponseField name="service" type="string">
  हमेशा `"rail-score-engine"`।
</ResponseField>

## Key verification

`POST /verify` - verify करता है कि API key valid और active है। Key का plan और remaining credits return करता है।

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

```json theme={null}
{
  "valid": true,
  "plan": "pro",
  "credits_remaining": 847.5
}
```

<ResponseField name="valid" type="boolean">
  `true` अगर key active और authorized है। `false` अगर key revoked है या exist नहीं करती।
</ResponseField>

<ResponseField name="plan" type="string">
  इस key से associated plan: `"free"`, `"pro"`, `"business"`, या `"enterprise"`।
</ResponseField>

<ResponseField name="credits_remaining" type="number">
  Current monthly period में बचे हुए credits।
</ResponseField>

## Error responses

| Status | Meaning                                                                 |
| ------ | ----------------------------------------------------------------------- |
| `401`  | Missing या invalid `Authorization` header                               |
| `403`  | Key revoked या inactive है                                              |
| `503`  | Service temporarily unavailable - exponential backoff के साथ retry करें |

## SDKs में usage

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

  client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

  # Check health
  health = client.health()
  print(health.status)  # "healthy"

  # Verify key
  info = client.verify()
  print(info.valid)              # True
  print(info.plan)               # "pro"
  print(info.credits_remaining)  # 847.5
  ```

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

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

  const health = await client.health();
  console.log(health.status); // "healthy"

  const info = await client.verify();
  console.log(info.creditsRemaining); // 847.5
  ```
</CodeGroup>

## आगे क्या देखें

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/getting-started/authentication">
    API keys कैसे generate और manage करें।
  </Card>

  <Card title="Credits & Pricing" icon="coins" href="/getting-started/credits">
    हर endpoint के credit costs और plan allocations।
  </Card>
</CardGroup>
