Skip to main content
This page is for operators debugging a report from a user, and for developers tracking spend. Every command here needs CYCLS_API_KEY set.

Find one failed request

When an agent run fails with an unhandled exception, the user sees a short reference and the full detail goes to structured logs.
The structured error record contains: Errors the loop handles itself, such as a rate limit retry, a compaction failure or a tool timeout, appear to the user as callouts and are not logged as errors. They are handled behavior, not failures.

Tail and filter

-q passes a structured filter to the log backend and is reapplied on every poll, so it composes with -f.

Aggregate model spend

Each model turn emits a level=usage record. cycls cost aggregates it.
Costs are zero unless the agent sets token prices:
Per-chat totals also persist in the chat index and are returned by GET /chats, so a sidebar can show spend without rereading turns.

SQL over logs and billing

Output is an aligned table on a terminal and JSON when piped. Use --format table|json|csv to force one. An empty result prints (0 rows) to stderr and exits 0. Two tables are available, scoped automatically to the deployments your API key owns.

logs

json_payload records by level:

billing

Example queries

Known behavior: the first cycls sql call after a deployment is created can take 5 to 10 seconds while the backend sets up. A per-query scanned-bytes cap applies, so add LIMIT or narrower predicates on wide scans. SQL engine errors are surfaced verbatim.

Emit your own records

The first argument is the level. user and chat_id attach attribution, and any other keyword becomes a field in json_payload, queryable with -q and sql.

Next

CLI reference

Every command and flag.