flexkit logs
Reads the project’s logs: GraphQL API requests, webhook deliveries and AI model calls made by the chat agent and automations. Pick a time range, filter by operation, status or event, print JSON for scripts, or follow new entries as they arrive while you test.
Synopsis
flexkit logs [api|webhooks|llm] [options]The log type defaults to api, so flexkit logs --since 2h reads API requests. Entries are printed oldest first, so the newest entry is at the bottom of the table.
Time ranges
--since, --until and --before take either a duration back from now or an absolute time:
Without flags, flexkit logs shows the last hour, up to 50 entries. A range can span at most 90 days, and one request returns at most 500 entries. When a range holds more than --limit entries you get the newest ones, and the command prints the --before value that continues with older entries.
logs api
Show GraphQL API requests made to the project. Filter by the exact operation name with --operation and by HTTP status code with --status. Alias: requests.
flexkit logs api [--operation <name>] [--status <code>] [--since <time>] [--until <time>] [--limit <n>] [--follow] [--json]Examples
# API requests from the last hour
flexkit logs
# Server errors over the last two days
flexkit logs api --since 2d --status 500
# Watch one operation while you test a page
flexkit logs api --operation GetProducts --follow
# The ten slowest requests of a day
flexkit logs api --since 2026-11-02 --until 2026-11-03 --limit 500 --json \
| jq '.data | sort_by(-.duration_ms) | .[:10] | .[] | {timestamp, operation_name, duration_ms}'logs webhooks
Show webhook deliveries: the event that triggered them, the status code your endpoint answered, and the error of failed deliveries. Filter by event with --event create|update|delete and by result with --status succeeded|failed. Alias: webhook.
flexkit logs webhooks [--event <event>] [--status succeeded|failed] [--since <time>] [--until <time>] [--limit <n>] [--follow] [--json]Examples
# Failed deliveries in the last day
flexkit logs webhooks --since 1d --status failed
# Watch deliveries while you work on your endpoint
flexkit logs webhooks -f
# Only deliveries for deleted records, as JSON
flexkit logs webhooks --event delete --since 1w --json
# Count last week's failures per URL
flexkit logs webhooks --since 1w --status failed --limit 500 --json \
| jq '.data | group_by(.url) | map({url: .[0].url, failures: length})'logs llm
Show AI model calls made by the chat agent and by automations: the model, input and output tokens, cost and the automation that made the call (empty for chat).
flexkit logs llm [--since <time>] [--until <time>] [--limit <n>] [--follow] [--json]Examples
# Model calls from the last hour
flexkit logs llm
# Cost in dollars of the last 7 days (up to 500 calls)
flexkit logs llm --since 7d --limit 500 --json | jq '[.data[].actual_cost_micros] | add / 1000000'
# Watch an automation run spend tokens
flexkit logs llm --follow --interval 2Following new entries
--follow (-f) prints the matching entries of the time range, then checks for new ones every 5 seconds (change it with --interval, minimum 2) until you press Ctrl+C. Each check starts 30 seconds before the end of the previous one, measured by the server’s clock, so entries that are recorded a little late still show up. An error that won’t go away by itself, such as a revoked token or lost access, stops the command. An entry is printed once even when two checks return it. --follow can’t be combined with --until or --before.
Entries are recorded a few seconds after the request finishes, so a request you just made can take a moment to appear.
JSON output
--json prints JSON on stdout, with times as ISO 8601 UTC strings and the same fields as the Logs page:
- Without
--follow: the page as the API returns it, an object with the entries indata, newest first, andnextBefore, the--beforevalue for the next page (nullwhen there are no more entries). It also hastype,since,untilandlimit. - With
--follow: one entry per line (NDJSON), oldest first, first the entries of the time range and then each new entry as it arrives. Pipe it tojq -cor another line-based tool.
{
"type": "api",
"since": "2026-11-03T11:00:00.000Z",
"until": "2026-11-03T12:00:00.000Z",
"limit": 50,
"data": [
{
"type": "api-requests",
"timestamp": "2026-11-03T11:59:58.250Z",
"operation_name": "GetProducts",
"status_code": 200,
"duration_ms": 42
}
],
"nextBefore": "2026-11-03T11:42:08.000Z"
}Read every API request of a day, page by page, in a script:
before=""
while :; do
page=$(flexkit logs api --since 2026-11-02 --until 2026-11-03 --limit 500 --json --before "${before:-now}")
echo "$page" | jq -c '.data[]' >> requests.ndjson
before=$(echo "$page" | jq -r '.nextBefore // empty')
[ -n "$before" ] || break
donePages can repeat a few entries at their boundary (see the notes below), so drop the duplicates before counting: jq -s 'unique | length' requests.ndjson.
Follow server errors as they happen:
flexkit logs api -f --json | jq -c 'select(.status_code >= 500) | {timestamp, operation_name}'Options
See also the global options.
Permissions
- Logs are read-only. Every project member can read them, whatever their role.
- Commands work with a
flexkit loginsession and with project API tokens of any role, so a CI job can check for failed webhook deliveries withFLEXKIT_TOKEN.
Notes
- Paging with
--beforeworks at whole seconds: the next page can repeat a few entries from the second where the previous page ended. When a whole page falls within one second, the next page starts before that second so paging keeps moving, and entries of that second beyond the page are skipped; raise--limitor narrow the range to see them all. - A single
--followcheck returns at most 500 entries. If more arrive within one interval, lower--intervalor narrow the filters. - Webhook logs can’t be filtered by webhook id yet; filter the JSON output by
webhook_idwithjqinstead.