---
title: "Backend-aware health check: 200/`ok` when the primary routing backend answers, 503/`degraded` when it does not."
method: GET
path: "/health"
tags: ["meta"]
---

# Backend-aware health check: 200/\`ok\` when the primary routing backend answers, 503/\`degraded\` when it does not.

`GET /health`

## Request

- Base URL: `https://api.mapmap.ai`
- URL: `https://api.mapmap.ai/health`
- Auth: none declared

## Response `200`

Gateway and backend healthy

- HealthResponse: `GET /health` response body.
  - `backend` string, required: Name of the routing engine serving requests (`valhalla`, `graphhopper` or `auto`).
  - `build` string, required: Git commit the running image was built from (`SN_BUILD_SHA`, baked in at image build), or `unknown`. The deploy guard (`deploy/hetzner/rebuild-gateway.sh`) compares this against the commit it built to prove a rebuild actually shipped, Docker build-cache poisoning has previously shipped stale code silently.
  - `status` string, required: `ok` when the routing backend answers its health probe, `degraded` otherwise.
  - `version` string, required: Gateway crate version.
  - `voice` HealthVoice: `voice` in [`HealthResponse`].
    - `tts` TtsStatus, required: The router's state for `GET /health` (`voice.tts`). Never a URL, never the token.
      - `breaker` string, required: `closed` (the primary may be used) or `open` (it failed, and is not used until the cooldown has passed and a probe has answered 200 since). Always `closed` without a primary.
      - `breaker_cooldown_s` integer, nullable: Seconds left of the cooldown while the breaker is open; `null` once it has passed (or when the breaker is closed).
      - `breaker_trips` integer, required: Times the breaker has opened since the gateway started.
      - `last_answer_age_s` integer, nullable: Seconds since that answer.
      - `last_host` 'primary' | 'fallback': Which `sn-tts` host answered a synthesis.
      - `primary` boolean, required: Whether a primary host (`SN_TTS_PRIMARY_URL`) is configured.
      - `primary_healthy` boolean, required: Whether the primary is taking syntheses right now.
      - `probe_age_s` integer, nullable: Seconds since the last `GET /ready` probe of the primary; `null` before the first, or without a primary.
      - `probe_ok` boolean, nullable: Whether that probe answered 200.

## Other responses

- `503`: Routing backend unreachable or failing

---

[API](https://skmtc.dev/mapmap/apis/sn-gateway.md) · [All operations](https://skmtc.dev/mapmap/apis/sn-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/mapmap/apis/sn-gateway/revisions/2293be8b4c38?raw)
