Skip to content

GET /healthz

Liveness probe. The gateway returns 200 as long as the FastAPI process is alive and the application object is loaded. It does not check upstream OpenRouter or the database; use the right probe for each layer.

Request

No parameters, no body.

curl -fsS "$SMART_GATEWAY_BASE_URL/healthz"

Response

200 OK:

{
  "status": "ok",
  "phase": "blueprint"
}
Field Value Notes
status ok Always ok if the response is 200.
phase blueprint Literal. Preserved for backward compatibility with earlier probes.

Status codes

Status When
200 Process is alive and accepting requests.
Any other The FastAPI process is failing or unreachable. Treat as down.

Production probes

The production nginx vhost exposes this endpoint at:

https://smart-openrounter.bee1x.one/healthz

A loopback probe is also possible:

curl -fsS http://127.0.0.1:9600/healthz

Both return identical bodies. Use the loopback probe for host-local health checks (does not depend on TLS); use the public probe from outside the host to validate the full chain.

Layered checks

/healthz does not cover:

  • Upstream OpenRouter reachability.
  • PostgreSQL connection.
  • Model health registry state.
  • Budget ledger state.

For those, see:

  • /metrics — Prometheus counters.
  • Structured logs — look for Routing decision made.
  • artifacts/WAVE-I/ — Post-production validation evidence.

When /healthz is the right probe

  • Container restart policy.
  • Load balancer member health.

When /healthz is the wrong probe

  • Alerting on OpenRouter outages — use sgw_requests_total{status="500"}.
  • Budget exhaustion alerts — use application logs and the budget metric (currently exposed only via application state).
  • Deep health (e.g. database is degraded) — use the SAFE_DEGRADED pattern in application logs.