On this page

This OpenAPI document

GET/openapi.json

Operation getOpenApiSpecAuthBearer token

Responses

StatusDescriptionBody
200OpenAPI 3.1 documentOpenApiDocument
Errors 401 · 403
401Missing or wrong bearer token (unauthorized)
403The request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)host_not_allowedcross_origin

Error bodies use the error format.

Example

Request
curl "http://127.0.0.1:7385/openapi.json" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"

Stop the daemon gracefully (loopback only)

POST/daemon/shutdown

Operation shutdownDaemonAuthBearer tokenLoopback only

Answers 202 first, then runs the same bounded shutdown as Ctrl+C / SIGTERM: the HTTP server closes (3 s deadline), every agent is unloaded in immediate mode (running turns are cut, no 5 s grace) under a per-agent deadline (10 s, ADF_SHUTDOWN_TIMEOUT_MS), compute containers stop, and the process exits; the whole shutdown is capped at 20 s. adf daemon stop uses it; on Windows it is the only graceful way to stop a detached daemon. Local callers only (see Local-only routes: never through a proxy). No body.

Header parameters

NameTypeDescription
X-ADF-Local-Proofstring

Required only when the daemon runs with ADF_DAEMON_BEHIND_PROXY: the contents of <settings dir>/daemon-local-proof (daemon-local-proof-<port> off the default port) on the daemon host (the adf CLI and terminal app send it automatically to their own daemon).

Responses

StatusDescriptionBody
202Accepted; the daemon exits shortlyShutdownAccepted
acceptedrequiredboolean

Value true

pidrequiredinteger

Daemon process id

Errors 401 · 403 · 405
401Missing or wrong bearer token (unauthorized)
403Not a local caller (loopback_only): the request came from another machine, through a proxy (forwarded headers), or: with ADF_DAEMON_BEHIND_PROXY, without this machine's X-ADF-Local-Proof. Owner secrets and shutdown are handled on the daemon host only. Or the request guard refused it: Host header not allowed (host_not_allowed, DNS-rebinding protection) or a browser cross-site request (cross_origin)loopback_onlyhost_not_allowedcross_origin
405Shutdown is not available on this daemon

Error bodies use the error format.

Example

Request
curl -X POST "http://127.0.0.1:7385/daemon/shutdown" \
  -H "Authorization: Bearer $ADF_DAEMON_TOKEN"
Response 202
{
  "accepted": true,
  "pid": 41230
}