> For AI agents: the documentation index is at https://platform.detectif.ai/llms.txt. Every page is also available as Markdown by adding `.md` to its path.

# Check service health

`GET /v1/health`

Whether the service and its parts are up: `status` is `ok`, or `degraded` when a part is unavailable. No authentication needed.

## Authentication

None. This endpoint does not need an API key.

## Response

`200`: Success.

| Field | Type | Required | Description |
|---|---|---|---|
| `request_id` | string | yes |  |
| `status` | string | yes | (one of `ok`, `degraded`) |
| `version` | string | yes |  |
| `database` | string | yes | (one of `ok`, `unavailable`) |
| `inference` | string | yes | (one of `ok`, `unavailable`) |

### Example response

```json
{
  "request_id": "req_8f14e45fceea167a5a36dedd",
  "status": "ok",
  "version": "1.0.0",
  "database": "ok",
  "inference": "ok"
}
```

## Errors

| Status | Meaning |
|---|---|
| `429` | Too many requests or too many operations at the same time. Wait for the number of seconds in Retry-After. |
| `500` | Something went wrong on our side. No credits were used. |

Error bodies use the shape described in [Errors](https://platform.detectif.ai/docs/errors/), with a stable `error.code`.

## Code samples

```bash
curl "https://platform.detectif.ai/v1/health"
```

```python
import os

import requests

resp = requests.get(
    "https://platform.detectif.ai/v1/health",
    timeout=30,
)
print(resp.status_code, resp.json())
```

```javascript
const res = await fetch("https://platform.detectif.ai/v1/health");
console.log(res.status, await res.json());
```
