Skip to main content
POST
Genai Spans Query

Body

application/json

Request to query agent spans for a project.

When group_by is empty (or omitted), returns raw span rows in the response's spans field. When group_by is non-empty, returns aggregate group rows in the response's groups field.

project_id
string
required
query
Query · object | null
group_by
AgentGroupByRef · object[] | null
measures
AgentSpanMeasureSpec · object[]
group_filters
AgentSpanGroupFilter · object[]
group_distributions
AgentSpanGroupDistributionSpec · object[]
Maximum array length: 20
custom_attr_columns
AgentSpanValueRef · object[]
include_details
boolean
default:false
include_costs
boolean
default:false
sort_by
AgentSortBy · object[] | null
limit
integer
default:100
Required range: 0 <= x <= 10000
offset
integer
default:0
Required range: x >= 0
started_after
string<date-time> | null
started_before
string<date-time> | null

Response

Successful Response

Response from a spans query.

Exactly one of spans or groups will be populated, based on whether the request specified group_by.

spans
AgentSpanSchema · object[]
groups
AgentSpanGroupRow · object[]
total_count
integer
default:0