API Referenceanalytics
Query Analytics
Execute a flexible analytics query. Supports cross-table queries with measures, dimensions, filters, and time dimensions. Available cubes: Traces, Spans, Classifications, LlmUsage, HitlFeedback.
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Query Parameters
workspace_id*Workspace Id
Workspace ID for authorization
Format
uuidproject_id*Project Id
Project ID for tenant isolation
Format
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X post "http://localhost:8000/api/v1/analytics/query?workspace_id=497f6eca-6276-4993-bfeb-53cbbbba6f08&project_id=497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{ "dimensions": [ "Traces.projectId" ], "filters": [ { "member": "Traces.projectId", "operator": "equals", "values": [ "550e8400-e29b-41d4-a716-446655440000" ] } ], "limit": 100, "measures": [ "Traces.count" ], "timeDimensions": [ { "dateRange": "last 7 days", "dimension": "Traces.createdAt", "granularity": "day" } ] }'{
"annotation": {
"dimensions": {
"Traces.projectId": {}
},
"measures": {
"Traces.count": {}
}
},
"data": [
{
"Traces.count": 42,
"Traces.projectId": "550e8400-e29b-41d4-a716-446655440000"
}
]
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
