> ## 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 and API key verification endpoints - both are free and require no credits.

Two utility endpoints that cost **0 credits** and are available to all plans.

## Health check

`GET /health` - returns the current service status. No 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"` when the service is fully operational. Use this for uptime monitoring and load balancer health probes.
</ResponseField>

<ResponseField name="service" type="string">
  Always `"rail-score-engine"`.
</ResponseField>

## Key verification

`POST /verify` - verifies that an API key is valid and active. Returns the plan and remaining credits for the key.

```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` if the key is active and authorized. `false` if the key is revoked or does not exist.
</ResponseField>

<ResponseField name="plan" type="string">
  The plan associated with this key: `"free"`, `"pro"`, `"business"`, or `"enterprise"`.
</ResponseField>

<ResponseField name="credits_remaining" type="number">
  Credit balance remaining in the current monthly period.
</ResponseField>

## Error responses

| Status | Meaning                                                          |
| ------ | ---------------------------------------------------------------- |
| `401`  | Missing or invalid `Authorization` header                        |
| `403`  | Key is revoked or inactive                                       |
| `503`  | Service temporarily unavailable - retry with exponential backoff |

## Usage in SDKs

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

## What's next

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/getting-started/authentication">
    How to generate and manage API keys.
  </Card>

  <Card title="Credits & Pricing" icon="coins" href="/getting-started/credits">
    Credit costs for each endpoint and plan allocations.
  </Card>
</CardGroup>
