The Agent Logs API exposes the daemon’s redacted log stream for query, single-entry fetch, source listing, volume statistics, SSE tailing, and filtered file export. All log entries returned by these routes are ALWAYS redacted at the gateway before reaching the client. These endpoints are active-only : there is no realm dimension to scope, so any per-request X-Hoody-Realm header or ?realm= query parameter is rejected with realm_scope_unsupported. Local sources export a point-in-time-consistent snapshot of the in-daemon ring; platform sources export a single query page and mark the export partial when more rows remained.
GET /api/v1/agent/logs
Queries the active log stream (logs.query). Filters ride on query parameters (source, level, host, since, until, …). ?limit=N caps the result set (the daemon default is 200) and is forwarded; the stream paginates by cursor (since_seq / before_seq), not by page.
Name In Type Required Description sourcequery string No Filter to a log source/facet (see logsSources). levelquery string No Filter to a minimum log level. hostquery string No Filter to a host. sincequery string No Lower time/cursor bound (since_seq cursor passes through verbatim). untilquery string No Upper time bound. limitquery integer No Caps the result set (daemon default 200). A non-numeric value is rejected 400. X-Hoody-Cwdheader string No Per-request working-directory scope: the .hoody project layer / record cwd / tool+workflow cwd. X-Hoody-Config-Dirheader string No Per-request --config-dir override selecting which on-disk .hoody install a stateless read/write resolves (HoodyPaths). X-Hoody-Containerheader string No Per-request bound remote container (omitted = local). Rejected (400) on routes with no container dimension. X-Hoody-Realmheader string No Per-request realm selector: "global" or a 24-hex id (also accepted as ?realm=). Rejected (400 realm_scope_unsupported) on active-only / no-realm routes. realmquery string No Per-request realm selector — the in:query alias of the X-Hoody-Realm header (read only when the header is absent): "global" or a 24-hex id. Rejected (400 realm_scope_unsupported) on active-only / no-realm routes.
" ts " : " 2025-01-15T14:32:08.117Z " ,
" message " : " session resumed " ,
" attrs " : { " session_id " : " 5f3e1c0d9b2a4f1e8c7d6b5a " }
" ts " : " 2025-01-15T14:32:08.243Z " ,
" message " : " tool invoked " ,
" session_id " : " 5f3e1c0d9b2a4f1e8c7d6b5a " ,
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC, which has no realm dimension to scope. Omit the realm header on this route, or open a session to scope by realm.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy), not by connecting to the container directly.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
await client . agent . logs . queryLogs ({ source : " daemon " , level : " info " , limit : 50 });
curl -G " https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/logs " \
--data-urlencode " source=daemon " \
--data-urlencode " level=info " \
--data-urlencode " limit=50 "
GET /api/v1/agent/logs/entries/{ref}
Reads one log entry by ref. Entries are ALWAYS redacted. Active-only: a realm header is rejected.
Name In Type Required Description refpath string Yes Path identifier. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400 realm_scope_unsupported). realmquery string No Per-request realm selector — query alias of X-Hoody-Realm. Rejected (400 realm_scope_unsupported).
" ts " : " 2025-01-15T14:32:08.117Z " ,
" message " : " session resumed " ,
" attrs " : { " session_id " : " 5f3e1c0d9b2a4f1e8c7d6b5a " }
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route, or open a session to scope by realm.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy, not by connecting to the container directly.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
await client . agent . logs . readLogEntry ( " 18421 " );
curl " https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/logs/entries/18421 "
GET /api/v1/agent/logs/sources
Lists the available log sources / facets (logs.sources). Active-only: a realm header is rejected.
Name In Type Required Description X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400 realm_scope_unsupported). realmquery string No Per-request realm selector — query alias of X-Hoody-Realm. Rejected (400 realm_scope_unsupported).
{ " id " : " daemon " , " label " : " Daemon " , " local " : true },
{ " id " : " session " , " label " : " Session " , " local " : true },
{ " id " : " tool " , " label " : " Tool " , " local " : true },
{ " id " : " llm " , " label " : " LLM " , " local " : true },
{ " id " : " activity " , " label " : " Activity " , " local " : false },
{ " id " : " events " , " label " : " Events " , " local " : false },
{ " id " : " proxy " , " label " : " Proxy " , " local " : false }
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route, or open a session to scope by realm.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy, not by connecting to the container directly.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
await client . agent . logs . logsSources ();
curl " https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/logs/sources "
GET /api/v1/agent/logs/stats
Returns log volume / level statistics (logs.stats). Active-only: a realm header is rejected.
Name In Type Required Description X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400 realm_scope_unsupported). realmquery string No Per-request realm selector — query alias of X-Hoody-Realm. Rejected (400 realm_scope_unsupported).
" window " : { " since " : " 2025-01-15T00:00:00Z " , " until " : " 2025-01-15T23:59:59Z " }
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route, or open a session to scope by realm.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy, not by connecting to the container directly.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
await client . agent . logs . logsStats ();
curl " https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/logs/stats "
GET /api/v1/agent/logs/stream
Tails the active log stream over Server-Sent Events (logs.tail). The stream paginates with a cursor it advances each round (since_seq = the previous reply’s next_seq), so no row is skipped under load. The tail rides the SAME seq / replay convention the session stream uses:
an entry frame per redacted row CARRYING id: <seq> (a reconnecting client resumes via the Last-Event-ID header, which overrides ?since_seq)
a lagged frame with {code: "replay_gap"} when the caller’s cursor fell behind the ring
periodic heartbeats
end on disconnect
Filters ride query parameters (source, level, host, since_seq, …); ?limit caps each poll batch. Local sources only. Active-only: a realm header returns 400 realm_scope_unsupported. Entries are ALWAYS redacted.
Name In Type Required Description sourcequery string No Filter the tail to a log source/facet. levelquery string No Filter to a minimum log level. hostquery string No Filter to a host. since_seqquery integer No Initial resume cursor (the Last-Event-ID header overrides it). A non-numeric value is rejected 400. limitquery integer No Caps each poll batch. A non-numeric value is rejected 400. Last-Event-IDheader string No SSE resume cursor — the gateway int64 seq to resume from; OVERRIDES the ?since_seq query param. Sent automatically by an SSE client on reconnect. X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400 realm_scope_unsupported). realmquery string No Per-request realm selector — query alias of X-Hoody-Realm. Rejected (400 realm_scope_unsupported).
data: {"seq":18421,"ts":"2025-01-15T14:32:08.117Z","level":"info","source":"daemon","host":"agent-1","message":"session resumed","attrs":{"session_id":"5f3e1c0d9b2a4f1e8c7d6b5a"}}
data: {"seq":18422,"ts":"2025-01-15T14:32:08.243Z","level":"debug","source":"tool","host":"agent-1","message":"tool invoked","attrs":{"session_id":"5f3e1c0d9b2a4f1e8c7d6b5a","tool":"bash","status":"ok"}}
data: {"code":"replay_gap","from_seq":18001,"head_seq":18399}
data: {"reason":"client_disconnect"}
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route, or open a session to scope by realm.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy, not by connecting to the container directly.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit). Honor Retry-After and retry.
await client . agent . logs . streamLogs ({ source : " daemon " , level : " info " , limit : 100 });
curl -N " https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/logs/stream?source=daemon&level=info&limit=100 "
GET /api/v1/agent/logs/export
Streams the filtered, ALWAYS-redacted log set as a download (Content-Disposition: attachment).
format=jsonl (default, one wire row per line) or txt (human-readable).
Local sources export a point-in-time-consistent snapshot of the in-daemon ring (bounded at the seq observed when the export starts).
source=activity|events|proxy exports ONE platform query page (default limit=2000) and marks the export partial when more remained.
Every export ends with an in-band terminator — jsonl emits a final {"_hoody_export":{...}} line and txt emits a trailing # export: … comment carrying rows / gap / partial. Its absence means the download was truncated.
Filters mirror the Logs tab exactly (source, min_level, comp, session_id, text, since, until, event, tool, model, status, method, min_status, max_status, errors_only, event_type, resource_type, container_id, kind, host); ?since_seq exports incrementally; ?limit caps total rows; ?filename overrides the download name (reduced to a safe basename). Active-only: a realm header returns 400 realm_scope_unsupported.
Name In Type Required Description sourcequery string No Log source to export (see logsSources; one local source, one platform source, or omitted for all local sources). min_levelquery string No Minimum log level (debug|info|warn|error). compquery string No Component filter (daemon source). session_idquery string No Session id filter. textquery string No Case-insensitive substring filter over message + attrs. sincequery string No Lower time bound (RFC3339 or relative like 1h/7d). untilquery string No Upper time bound (RFC3339 or relative). eventquery string No Session lifecycle event filter (session source). toolquery string No Tool name filter (tool source). modelquery string No Model filter (llm source). statusquery string No Tool outcome filter: ok|error|cancelled (tool source). methodquery string No HTTP method filter (activity source). min_statusquery integer No Minimum HTTP status (activity source). max_statusquery integer No Maximum HTTP status (activity source). errors_onlyquery boolean No Only error rows (activity source; true/false). event_typequery string No Event type filter (events source). resource_typequery string No Resource type filter (events source). containerquery string No Container filter (proxy source; empty = all running realm containers). Maps to the daemon’s container_id filter. kindquery string No Proxy row kind: request|response|event (proxy source). hostquery string No Proxy URL host filter (exact or dot-aligned suffix). since_seqquery integer No Exclusive lower seq bound for incremental exports (local sources). limitquery integer No TOTAL row cap across the export (default: everything the snapshot matches; platform default 2000). formatquery string No Export format: jsonl (default) or txt. filenamequery string No Download filename override (reduced to a safe basename). X-Hoody-Cwdheader string No Per-request working-directory scope. X-Hoody-Config-Dirheader string No Per-request --config-dir override. X-Hoody-Containerheader string No Per-request bound remote container. X-Hoody-Realmheader string No Per-request realm selector. Rejected (400 realm_scope_unsupported). realmquery string No Per-request realm selector — query alias of X-Hoody-Realm. Rejected (400 realm_scope_unsupported).
{ " seq " : 18421 , " ts " : " 2025-01-15T14:32:08.117Z " , " level " : " info " , " source " : " daemon " , " host " : " agent-1 " , " message " : " session resumed " , " attrs " :{ " session_id " : " 5f3e1c0d9b2a4f1e8c7d6b5a " }}
{ " seq " : 18422 , " ts " : " 2025-01-15T14:32:08.243Z " , " level " : " debug " , " source " : " tool " , " host " : " agent-1 " , " message " : " tool invoked " , " attrs " :{ " session_id " : " 5f3e1c0d9b2a4f1e8c7d6b5a " , " tool " : " bash " , " status " : " ok " }}
{ " _hoody_export " :{ " rows " : 2 , " gap " : false , " partial " : false , " head_seq " : 18422 , " format " : " jsonl " }}
" message " : " invalid request "
Error Code Title Description Resolution bad_requestBad request The request was malformed or carried invalid parameters. Correct the request body or query parameters. realm_scope_unsupportedRealm scope unsupported A per-request realm header was supplied to an active-only / global-no-realm RPC. Omit the realm header on this route, or open a session to scope by realm.
" message " : " request must arrive through the Hoody proxy "
Error Code Title Description Resolution forbiddenForbidden (not via the Hoody proxy) Forbidden — the request did not reach the service through the public endpoint. Reach the agent through hoody-proxy, not by connecting to the container directly.
" message " : " request rate limit exceeded "
Error Code Title Description Resolution rate_limitedToo many requests The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. Honor the Retry-After header and retry; reduce the request rate.
" code " : " internal_error " ,
" message " : " internal server error "
Error Code Title Description Resolution internal_errorInternal error An unexpected error occurred while handling the request. Retry; if persistent, inspect the daemon logs.
" code " : " service_unavailable " ,
" message " : " service unavailable "
Error Code Title Description Resolution service_unavailableService unavailable The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit). Honor Retry-After and retry.
await client . agent . exportLogs ({
filename : " agent-daemon-info.jsonl "
" https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/logs/export?source=daemon&min_level=info&format=jsonl&filename=agent-daemon-info.jsonl "