Skip to main content
POST /v1/traces/find returns traces, each with its totals. count is every match, not only the ones in the page of results you get back. The examples use the sample data. Two conditions on two different spans of one trace: a failed tool call, and a model call of gpt-x.
The root span. In t2 only a child span has “refund”, so t2 is not found:
Ranges of totals. spanCount, errorCount, inputTokens, outputTokens, totalTokens, costNanos and durationMs, each {"min": a, "max": b} (both ends are in the range; leave one out for no end). Cost is in nano-dollars: one dollar is {"costNanos": {"min": 1000000000}}. Traces that cost more than $0.0001:
OR on traces: failed, or 1 to 15 tokens in total.
NOT on traces: traces with no tool call at all.
Previews. previewChars adds the first characters of the trace’s input and output to each row. The input is the root’s; the output is of the span that ended last and has one. The trace list is oldest first here (sort: "oldest"):
Only the count: "limit": 0.

Pages and cursors

A list returns limit rows (default 50, at most 10,000) and a nextCursor. Give it back as cursor for the next page. On the last page nextCursor is null.
  • A cursor is a place in the sort order, not a saved result. Each page costs about as much as page 1 (there is no offset).
  • While writes go on, a row is never returned twice and never skipped, as long as its sort key does not change. A new row that sorts before the cursor is not returned.
  • A cursor works only with the same list and the same sort.

Add up numbers

Exact sums, time series and percentiles per group.