Skip to main content

Health

System health monitoring endpoint that aggregates status from all subsystems.

Check System Health

GET /api/v1/health

Returns the overall health status and individual subsystem checks.

Example Request

curl http://localhost/api/v1/health

Response

Status: 200 OK

{
"healthy": true,
"status": "ok",
"checks": {
"ollama": {
"status": "ok",
"message": "Connected (v0.9.0)",
"details": {
"base_url": "http://localhost:11434",
"version": "0.9.0"
}
},
"chat_model": {
"status": "ok",
"message": "qwen3:30b-instruct installed"
},
"extraction_model": {
"status": "warning",
"message": "Not configured (using chat model)"
},
"embeddings": {
"status": "ok",
"message": "Qwen3-Embedding-0.6B ready (ollama)",
"details": {
"provider": "ollama",
"model": "Qwen/Qwen3-Embedding-0.6B",
"dimensions": 1024
}
},
"queue": {
"status": "ok",
"message": "Valkey connected"
},
"llm_worker": {
"status": "ok",
"message": "Running (idle)"
},
"ops_worker": {
"status": "ok",
"message": "Running (idle)"
},
"search_index": {
"status": "ok",
"message": "1,500 docs / 1,500 vectors",
"details": {
"fulltext_count": 1500,
"vector_count": 1500,
"vector_dimension": 1024
}
},
"graph": {
"status": "ok",
"message": "1,500 entities / 3,200 relationships"
},
"disk_space": {
"status": "ok",
"message": "Disk space OK: 412.5 GB free"
},
"error_rate": {
"status": "ok",
"message": "Error rate 2% (1/50 tasks)"
},
"database": {
"status": "ok",
"message": "Database accessible and writable"
}
}
}

Response Fields

FieldTypeDescription
healthybooltrue when no critical check reports error (see below)
statusstringOverall status: "ok" (healthy) or "degraded" (a critical check is failing)
checksobjectPer-subsystem check results — omitted for unauthenticated callers
checks.ollamaobjectOllama connectivity, version, and installed models (Ollama provider only)
checks.providerobjectCloud provider API-key configuration (OpenAI / Anthropic / Gemini providers — replaces ollama)
checks.chat_modelobjectWhether the configured chat model is installed (Ollama only)
checks.extraction_modelobjectWhether the configured extraction model is installed (Ollama only; warning when unconfigured)
checks.vision_modelobjectWhether the configured vision model is installed (Ollama only; present only when configured)
checks.embeddingsobjectEmbedding provider status (provider, model, dimensions)
checks.queueobjectValkey queue connection status
checks.llm_workerobjectLLM queue worker heartbeat
checks.ops_workerobjectOperations queue worker heartbeat
checks.search_indexobjectSearch index status (details: fulltext_count, vector_count, vector_dimension)
checks.graphobjectKnowledge graph entity / relationship counts
checks.disk_spaceobjectFree disk space on the data directory vs. warn/error thresholds
checks.error_rateobjectRecent task failure rate across the worker queues
checks.databaseobjectDatabase connectivity and writability

When Ollama itself is unreachable, the model checks (chat_model, extraction_model, vision_model) are omitted — only the ollama error is reported.

Each subsystem check includes:

  • status"ok", "warning", or "error"
  • message — human-readable description
  • details — provider-specific key-value pairs (optional)
  • category"resource", "service", or "operational" (optional)
  • auto_recoverabletrue when the check expects self-healing (optional)

What Drives healthy

Only the critical checks flip the overall flag: ollama (or provider on cloud providers), chat_model (Ollama only), queue, llm_worker, and ops_worker. Any other check (search_index, graph, disk_space, error_rate, database, embeddings, ...) can report error without changing healthy — inspect checks directly if you need to alert on those.

Response Caching

Detailed health responses are cached in-process for 5 seconds — polling faster than that returns the cached snapshot without re-running the probes.

Unauthenticated access

The checks field is omitted when the request bypasses the auth gate (e.g. Docker HEALTHCHECK probes hitting the internal port directly). This prevents fingerprinting the deployed LLM stack. Unauthenticated callers see only {"healthy": true, "status": "ok"}.

Check Auth Diagnostic

GET /api/v1/health/auth

Diagnostic endpoint for detecting nginx auth_request misconfiguration. No authentication required — the endpoint is intentionally public so it remains usable when auth itself is broken.

When nginx's auth_request directive is misconfigured, X-Auth-User may not arrive at Cortex, producing silent 401 storms. Poll this endpoint to detect and diagnose the problem without needing a working auth session.

Example Request

curl http://localhost/api/v1/health/auth

Response

Status: 200 OK

Healthy (nginx forwarding correctly):

{
"x_auth_user_present": true,
"recent_failed_attempts": 0,
"last_failure_at": null
}

Broken nginx (auth header not being forwarded):

{
"x_auth_user_present": false,
"recent_failed_attempts": 142,
"last_failure_at": "2026-05-06T18:32:11.000000+00:00"
}

Response Fields

FieldTypeDescription
x_auth_user_presentboolWhether X-Auth-User is present in this specific request — reflects only the current call
recent_failed_attemptsintCount of 401 responses issued in the last 5-minute sliding window
last_failure_atstring | nullISO-8601 UTC timestamp of the most recent 401, or null if none has occurred in this process lifetime

When recent_failed_attempts is non-zero on requests that should be authenticated, the nginx auth_request forward is not reaching Cortex. Check nginx logs and verify the auth_request directive points to the correct upstream.

See Diagnosing auth misconfiguration for troubleshooting steps.