Documentation Index
Fetch the complete documentation index at: https://docs.minerva.io/llms.txt
Use this file to discover all available pages before exploring further.
mc.status.health() probes Minerva’s API endpoints to confirm they’re
reachable and healthy. The probe is unauthenticated (works without an
API key) and never raises — failures are returned as values, so you can
call it in a polling loop without try/except.
Why use it
| Use case | What health() gives you |
|---|---|
| Polling liveness from a monitor / cron / Prometheus exporter | ok + latency_ms per endpoint |
| Debugging “is my key wrong, or is the API down?” | Probe works without an API key — if ok=True, the API is fine; the issue is your key |
| Pre-flight at process startup | One quick call before kicking off batches |
Return shape
Always adict[str, HealthStatus] keyed by endpoint name. One entry today
("api"); the dict grows as Minerva exposes more endpoints. Iterating
today’s code keeps working as endpoints come online.
HealthStatus
True when the endpoint is reachable and reports healthy (HTTP 2xx and
status == "ok" in the body, when present).Round-trip time for the probe, in milliseconds.
HTTP status code returned by the endpoint.
None on network-level failure
(DNS, TCP, TLS, timeout).Value of the
status field in the gateway’s response body, when present
(e.g. "ok", "degraded"). None if the body had no such field.Optional human-readable detail from the gateway (e.g.
"DB read replica lagging"). Populated when the server includes a message field in its
body, regardless of ok.SDK-side description of why
ok=False — the HTTP code (e.g. "HTTP 503")
or the underlying network exception class (e.g. "ConnectError: ...").
None when the probe succeeded. Distinct from message: error is the
SDK’s reason for marking ok=False; message is whatever the gateway
itself returned.Parameters
Which endpoint(s) to probe. Omit (or pass
None) to probe every known
endpoint. Pass a single name or a list of names to filter. Today the only
known name is "api"; unknown names raise ValueError.Per-endpoint timeout in seconds. Default 5 — for a liveness check, “no
answer in 5 seconds” is itself a useful answer.
Examples
Probe everything (default):Authentication
The probe is unauthenticated —mc.status.health() does not send
x-api-key. You can construct Minerva() without an API key purely to run
health probes:
Errors
health() itself never raises for probe failures — the outcome is
encoded in the returned HealthStatus (ok=False with error set). The
only thing that raises is misuse of the call itself:
| Condition | Raises |
|---|---|
Unknown name in endpoints= | ValueError |
Bad timeout= (e.g. negative) | TypeError / ValueError (from httpx) |

