Aggregate function logs
Count GenAI function log lines and the conversations they belong to, bucketed by hour or day.
POST
Aggregate function logs
Counts the log lines your GenAI functions wrote, grouped by event, function, conversation, level, environment, project, error type or turn, and optionally bucketed by hour or day. Takes the same filters as search. Use it to see which events fire most, which functions raise, and when.
An empty
Request
Headers
string
required
Account API key with read access to conversations.
Body
datetime
required
Inclusive window start, ISO 8601.
datetime
required
Exclusive window end. The window may span at most 30 days.
string[]
required
Aggregations to compute, one column each:
count (log lines), conversation_count, first_seen, last_seen (earliest and latest timestamp).string[]
Dimensions to group by, one column each:
event, function_name, conversation_id, level, client_env, project_id, error_type, turn_index.string
hourly or daily. Adds a leading bucket column. Omit for one unbucketed result per group.string
IANA timezone (for example
Europe/London) applied to the buckets. Defaults to UTC.string
Restrict to one agent. Omit to aggregate the whole account.
string
Matches the conversation ID or the call SID.
string[]
Function (tool) names, up to 20.
string[]
debug, info, warning, error, critical.string[]
Environments:
test, sandbox, pre-release, live, scenarios.string[]
Exception classes on failure lines, for example
KeyError, up to 20.object
Whole-word, case-insensitive terms matched on the event label:
{ "all": [...], "any": [...], "none": [...] }, up to 10 terms each.string
Trace ID of the function-execution span.
string
Span ID of the function-execution span.
integer
0-based turn the function call belongs to. Must be an integer.
object
{ "field": "<a group_by or aggs value>", "order": "asc" | "desc" }. Applied after the ascending bucket sort.integer
default:"20"
Rows per page, 1–100.
integer
default:"0"
Rows to skip, 0–1000.
Response
string[]
Column names in row order:
bucket (when interval is set), then each group_by dimension, then each aggregation.array[]
One array per bucket and group, values in
columns order.integer
integer
boolean
Examples
Which functions log errors, and why
error_type means the function logged the error itself and carried on; a class name means it raised.
Log volume per day
Request
Response
Most frequent events in one conversation
Request
Errors
Last modified on November 10, 2026

