---
title: "Key Health"
method: POST
path: "/key/health"
tags: ["key management"]
---

# Key Health

`POST /key/health`

Check the health of the key

Checks:
- If key based logging is configured correctly - sends a test log

Usage 

Pass the key in the request header

```bash
curl -X POST "http://localhost:4000/key/health"      -H "Authorization: Bearer sk-1234"      -H "Content-Type: application/json"
```

Response when logging callbacks are setup correctly:

```json
{
  "key": "healthy",
  "logging_callbacks": {
    "callbacks": [
      "gcs_bucket"
    ],
    "status": "healthy",
    "details": "No logger exceptions triggered, system is healthy. Manually check if logs were sent to ['gcs_bucket']"
  }
}
```


Response when logging callbacks are not setup correctly:
```json
{
  "key": "unhealthy",
  "logging_callbacks": {
    "callbacks": [
      "gcs_bucket"
    ],
    "status": "unhealthy",
    "details": "Logger exceptions triggered, system is unhealthy: Failed to load vertex credentials. Check to see if credentials containing partial/invalid information."
  }
}
```

## Response `200`

Successful Response

- KeyHealthResponse
  - `key` 'healthy' | 'unhealthy'
  - `logging_callbacks` LoggingCallbackStatus
    - `callbacks` string[]
    - `status` 'healthy' | 'unhealthy'
    - `details` string, nullable

---

[API](https://skmtc.net/sea-lion/apis/litellm-api.md) · [All operations](https://skmtc.net/sea-lion/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sea-lion/litellm-api/revisions/1e929292ddd5/schema)
