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

# Gesundheit & Überprüfung

> Gesundheitsprüfung und API-Schlüsselverifizierungsendpunkte - beide sind kostenlos und erfordern keine Credits.

Zwei Dienstendpunkte, die **0 Credits** kosten und für alle Pläne verfügbar sind.

## Gesundheitsprüfung

`GET /health` - gibt den aktuellen Status des Dienstes zurück. Keine Authentifizierung erforderlich.

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

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

<ResponseField name="status" type="string">
  `"healthy"` wenn der Dienst voll funktionsfähig ist. Verwenden Sie dies für die Überwachung der Betriebszeit und Gesundheitsprüfungen des Lastenausgleichs.
</ResponseField>

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

## Schlüsselverifizierung

`POST /verify` - überprüft, ob ein API-Schlüssel gültig und aktiv ist. Gibt den Plan und die verbleibenden Credits für den Schlüssel zurück.

```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` wenn der Schlüssel aktiv und autorisiert ist. `false` wenn der Schlüssel widerrufen oder nicht vorhanden ist.
</ResponseField>

<ResponseField name="plan" type="string">
  Der mit diesem Schlüssel verbundene Plan: `"free"`, `"pro"`, `"business"` oder `"enterprise"`.
</ResponseField>

<ResponseField name="credits_remaining" type="number">
  Verbleibender Kreditbetrag im aktuellen monatlichen Zeitraum.
</ResponseField>

## Fehlerantworten

| Status | Bedeutung                                                                          |
| ------ | ---------------------------------------------------------------------------------- |
| `401`  | Fehlender oder ungültiger `Authorization`-Header                                   |
| `403`  | Schlüssel ist widerrufen oder inaktiv                                              |
| `503`  | Dienst vorübergehend nicht verfügbar - erneut mit exponentiellem Backoff versuchen |

## Verwendung in SDKs

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

  client = RailScoreClient(api_key="YOUR_RAIL_API_KEY")

  # Gesundheitsprüfung
  health = client.health()
  print(health.status)  # "healthy"

  # Schlüsselverifizierung
  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>

## Was kommt als Nächstes

<CardGroup cols={2}>
  <Card title="Authentifizierung" icon="key" href="/getting-started/authentication">
    So generieren und verwalten Sie API-Schlüssel.
  </Card>

  <Card title="Credits & Preise" icon="coins" href="/getting-started/credits">
    Kreditkosten für jeden Endpunkt und Planzuweisungen.
  </Card>
</CardGroup>
