Query traces
Filter runs and group them by one or two dimensions into aggregates (count, failure rate, tokens, cost, duration, tool calls, signal fire rate), each with sample execution ids to drill into. Reads trace headers on indexed columns; model and tool-call metrics probe spans and cap the window at 7 days.
Authentication
AuthorizationBearer
API key or Clerk session token
Request
This endpoint expects an object.
agentIds
agentVersionIds
Hosted runs carry no agentVersionId on the trace header yet, so this filter matches ingested runs only.
cursor
flowIds
from
ISO 8601; default 7 days before to.
groupBy
includeChildren
Count subagent and nested-flow runs too; unscoped reads fold them by default.
includeToolCalls
Tool-call percentiles per group. Reads spans, so the window is capped at 7 days. Default false.
limit
model
Runs with any model call to this model. Reads spans, so the window is capped at 7 days.
signal
Runs where this signal fired: key or key:value.
signalRate
Fire rate of this signal (key or key:value) per group; uniform and filtered samples are reported apart.
source
Allowed values:
status
Allowed values:
stopReason
surfaceId
to
ISO 8601; default now. Windows over 30 days are refused.
Response
Aggregates
data
success
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error
503
Service Unavailable Error