From a9e7acbd2077003a55fc78b4ba6b64ec921a73ca Mon Sep 17 00:00:00 2001 From: Valter Silva Date: Sat, 27 Jun 2026 15:51:44 +0800 Subject: [PATCH] docs: document nat serve /health endpoint in REST API guide - Add a "Health Check Endpoint" section to the REST API server endpoints guide covering GET /health (registered automatically by nat serve), its liveness/readiness purpose, a curl example, and the {"status":"healthy"} 200 response. - Note that this FastAPI health check (port 8000) is distinct from the MCP (9901) and FastMCP (9902) health routes, with cross-links. Closes #2073 Signed-off-by: Valter Silva --- .../rest-api/api-server-endpoints.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/source/reference/rest-api/api-server-endpoints.md b/docs/source/reference/rest-api/api-server-endpoints.md index 5960887229..f5046f70a9 100644 --- a/docs/source/reference/rest-api/api-server-endpoints.md +++ b/docs/source/reference/rest-api/api-server-endpoints.md @@ -85,6 +85,31 @@ uv pip install -e examples/getting_started/simple_calculator nat serve --config_file examples/getting_started/simple_calculator/configs/config.yml ``` +## Health Check Endpoint +- **Route:** `/health` +- **Method:** GET +- **Description:** A liveness/readiness probe for the running server. It is registered automatically + whenever you start `nat serve`, returns immediately without executing a workflow, and requires no + model or API credentials. This makes it suitable for reverse proxies, process supervisors, Docker + health checks, and Kubernetes-style readiness/liveness probes. +- **HTTP Request Example:** + ```bash + curl -s http://localhost:8000/health + ``` +- **HTTP Response Example:** + ```json + {"status":"healthy"} + ``` + +:::{note} +This endpoint checks the FastAPI server started by `nat serve` (default port `8000`). The MCP and +FastMCP servers expose their own separate `/health` routes on their own default ports — see +[Verifying MCP Server Health](../../run-workflows/mcp-server.md#verifying-mcp-server-health) +(default port `9901`) and +[Verifying FastMCP Server Health](../../run-workflows/fastmcp-server.md#verifying-fastmcp-server-health) +(default port `9902`). +::: + ## Generate Non-Streaming Transaction - **Route:** `/v1/workflow` (legacy: `/generate`) - **Description:** A non-streaming transaction that waits until all workflow data is available before sending the