Skip to Content
CLIlogs

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.

TypeWhat it shows
apiGraphQL API requests: time, operation, status code, duration, request plus response size, location.
webhooksWebhook deliveries: time, event and entity, status code, HTTP method, duration, URL, error.
llmAI model calls: time, model, input and output tokens, cost, duration, automation id.

Time ranges

--since, --until and --before take either a duration back from now or an absolute time:

ValueMeaning
30s, 15m, 1h, 1.5hSeconds, minutes or hours ago.
2d, 1wDays or weeks ago.
nowThe current time.
2026-11-02Midnight on that day, in your local time.
2026-11-02T08:30A date-time without a zone is read in local time, as the table prints it; with --utc, as UTC.
2026-11-02T08:30:00+02:00A date-time with a zone or Z is read as written.

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 2

Following 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 in data, newest first, and nextBefore, the --before value for the next page (null when there are no more entries). It also has type, since, until and limit.
  • 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 to jq -c or 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
done

Pages 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

OptionApplies toDescription
--since <time>, -sallStart of the time range. Default: 1 hour before the end of the range (--until or --before, else now).
--until <time>allEnd of the time range. Default: now.
--before <time>allOnly entries older than this time, to page back through a busy range.
--limit <n>, -nallEntries to fetch, 1–500. Default: 50.
--operation <name>apiOnly requests with this exact GraphQL operation name.
--status <code>apiOnly requests that returned this HTTP status code, such as 500.
--status <result>webhooksOnly succeeded or failed deliveries.
--event <event>webhooksOnly deliveries for create, update or delete events.
--follow, -fallKeep running and print new entries as they arrive. Ctrl+C stops.
--interval <seconds>allHow often --follow checks for new entries. Default: 5, minimum: 2.
--utcallPrint times in UTC instead of your local time zone (JSON is always UTC).
--jsonallPrint JSON on stdout: the page, or one entry per line with --follow.
--project <ID>, -pallProject to use. Default: the linked project.

See also the global options.

Permissions

  • Logs are read-only. Every project member can read them, whatever their role.
  • Commands work with a flexkit login session and with project API tokens of any role, so a CI job can check for failed webhook deliveries with FLEXKIT_TOKEN.

Notes

  • Paging with --before works 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 --limit or narrow the range to see them all.
  • A single --follow check returns at most 500 entries. If more arrive within one interval, lower --interval or narrow the filters.
  • Webhook logs can’t be filtered by webhook id yet; filter the JSON output by webhook_id with jq instead.
Last updated on