List span groups
https://api.respan.ai/api/request-logs/groups/Group spans by a supported dimension and return one aggregate row per group. trace and thread roll spans up through their dedicated entity views.
Servers
https://api.respan.ai: Respan API Server
Authentication
RespanApiKey
Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.
HTTP scheme: bearer; format: Respan API key.
Authorization: Bearer $RESPAN_API_KEYOr:
DashboardJwt
Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.
HTTP scheme: bearer; format: Dashboard JWT.
Authorization: Bearer $RESPAN_DASHBOARD_JWTQuery parameters
group_by string Optionaltrace and thread use entity rollups.Allowed:
"model", "provider_id", "organization_key_id", "prompt_id", "deployment_id", "deployment_name", "custom_identifier", "customer_identifier", "trace", "thread"Default:
modelsort_by string Optionalnumber_of_requestsstart_time string Optionaldate-timeend_time string Optionaldate-timeenvironment string Optionalpage integer Optional1page_size integer Optional1Maximum:
1000Responses
200
Paginated groups and aggregate metrics.
application/json
$ object Body
count integer Required in parentnext is null to get every result.next string or null Optionalprevious string or null Optionalcurrent_filters object Optionalfilters_data object Optionalresults array<object> Required in parent
results[] object Array item
Additional properties are allowed
results[].date_group string Optionaldate-timeresults[].model string Optionalresults[].provider_id string Optionalresults[].organization_key_id string Optionalresults[].prompt_id string Optionalresults[].deployment_id string Optionalresults[].deployment_name string Optionalresults[].custom_identifier string Optionalresults[].customer_identifier string Optionalresults[].trace_unique_id string Optionalresults[].thread_identifier string Optionalresults[].number_of_requests integer or null Optionalresults[].span_count integer or null Optionalresults[].total_cost number or null Optionalresults[].total_tokens integer or null Optionalresults[].error_count integer or null Optionalresults[].error_percentage number or null Optionalresults[].average_cost number or null Optionalresults[].average_tokens integer or null Optionalresults[].average_latency number or null Optionalresults[].average_ttft number or null Optionalresults[].average_tps number or null Optionalresults[].cache_hit_percentage number or null OptionalOpenAPI response schema
{
"type": "object",
"required": [
"count",
"results"
],
"properties": {
"count": {
"type": "integer",
"description": "Number of results on this page, not the total. Request pages until `next` is null to get every result."
},
"next": {
"type": "string",
"nullable": true
},
"previous": {
"type": "string",
"nullable": true
},
"current_filters": {
"type": "object",
"additionalProperties": true
},
"filters_data": {
"type": "object",
"additionalProperties": true
},
"results": {
"type": "array",
"items": {
"type": "object",
"description": "Aggregated metrics plus the selected group key. Trace and thread groups include their richer entity fields.",
"properties": {
"date_group": {
"type": "string",
"format": "date-time"
},
"model": {
"type": "string"
},
"provider_id": {
"type": "string"
},
"organization_key_id": {
"type": "string"
},
"prompt_id": {
"type": "string"
},
"deployment_id": {
"type": "string"
},
"deployment_name": {
"type": "string"
},
"custom_identifier": {
"type": "string"
},
"customer_identifier": {
"type": "string"
},
"trace_unique_id": {
"type": "string"
},
"thread_identifier": {
"type": "string"
},
"number_of_requests": {
"type": "integer",
"nullable": true
},
"span_count": {
"type": "integer",
"nullable": true
},
"total_cost": {
"type": "number",
"nullable": true
},
"total_tokens": {
"type": "integer",
"nullable": true
},
"error_count": {
"type": "integer",
"nullable": true
},
"error_percentage": {
"type": "number",
"nullable": true
},
"average_cost": {
"type": "number",
"nullable": true
},
"average_tokens": {
"type": "integer",
"nullable": true
},
"average_latency": {
"type": "number",
"nullable": true
},
"average_ttft": {
"type": "number",
"nullable": true
},
"average_tps": {
"type": "number",
"nullable": true
},
"cache_hit_percentage": {
"type": "number",
"nullable": true
}
},
"additionalProperties": true
}
}
}
}400
Unsupported group_by value. Invalid sort_by falls back to number_of_requests.
application/json
$ object Body
error string Required in parentOpenAPI response schema
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "string"
}
}
}Example
{
"error": "Not supported group_by value"
}403
The API key is missing, invalid or expired, or it doesn’t grant analytics read access.
application/json
$ object Body
detail string Required in parentOpenAPI response schema
{
"type": "object",
"required": [
"detail"
],
"properties": {
"detail": {
"type": "string"
}
}
}Example
{
"detail": "Your API key is invalid or expired, please check your API key in the platform settings."
}OpenAPI source
The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.
OpenAPI operation
{
"tags": [
"Spans"
],
"parameters": [
{
"name": "group_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"model",
"provider_id",
"organization_key_id",
"prompt_id",
"deployment_id",
"deployment_name",
"custom_identifier",
"customer_identifier",
"trace",
"thread"
],
"default": "model"
},
"description": "Grouping dimension. `trace` and `thread` use entity rollups."
},
{
"name": "sort_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": "number_of_requests"
}
},
{
"name": "start_time",
"in": "query",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
}
},
{
"name": "end_time",
"in": "query",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
}
},
{
"name": "environment",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "page_size",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 1000
}
}
],
"responses": {
"200": {
"description": "Paginated groups and aggregate metrics.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"count",
"results"
],
"properties": {
"count": {
"type": "integer",
"description": "Number of results on this page, not the total. Request pages until `next` is null to get every result."
},
"next": {
"type": "string",
"nullable": true
},
"previous": {
"type": "string",
"nullable": true
},
"current_filters": {
"type": "object",
"additionalProperties": true
},
"filters_data": {
"type": "object",
"additionalProperties": true
},
"results": {
"type": "array",
"items": {
"type": "object",
"description": "Aggregated metrics plus the selected group key. Trace and thread groups include their richer entity fields.",
"properties": {
"date_group": {
"type": "string",
"format": "date-time"
},
"model": {
"type": "string"
},
"provider_id": {
"type": "string"
},
"organization_key_id": {
"type": "string"
},
"prompt_id": {
"type": "string"
},
"deployment_id": {
"type": "string"
},
"deployment_name": {
"type": "string"
},
"custom_identifier": {
"type": "string"
},
"customer_identifier": {
"type": "string"
},
"trace_unique_id": {
"type": "string"
},
"thread_identifier": {
"type": "string"
},
"number_of_requests": {
"type": "integer",
"nullable": true
},
"span_count": {
"type": "integer",
"nullable": true
},
"total_cost": {
"type": "number",
"nullable": true
},
"total_tokens": {
"type": "integer",
"nullable": true
},
"error_count": {
"type": "integer",
"nullable": true
},
"error_percentage": {
"type": "number",
"nullable": true
},
"average_cost": {
"type": "number",
"nullable": true
},
"average_tokens": {
"type": "integer",
"nullable": true
},
"average_latency": {
"type": "number",
"nullable": true
},
"average_ttft": {
"type": "number",
"nullable": true
},
"average_tps": {
"type": "number",
"nullable": true
},
"cache_hit_percentage": {
"type": "number",
"nullable": true
}
},
"additionalProperties": true
}
}
}
}
}
}
},
"400": {
"description": "Unsupported group_by value. Invalid sort_by falls back to number_of_requests.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "string"
}
}
},
"example": {
"error": "Not supported group_by value"
}
}
}
},
"403": {
"description": "The API key is missing, invalid or expired, or it doesn't grant analytics read access.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"detail"
],
"properties": {
"detail": {
"type": "string"
}
}
},
"example": {
"detail": "Your API key is invalid or expired, please check your API key in the platform settings."
}
}
}
}
},
"security": [
{
"RespanApiKey": []
},
{
"DashboardJwt": []
}
],
"summary": "List span groups",
"operationId": "request_logs_groups_list",
"description": "Group spans by a supported dimension and return one aggregate row per group. `trace` and `thread` roll spans up through their dedicated entity views."
}OpenAPI path metadata
{}Referenced OpenAPI components
{
"securitySchemes": {
"DashboardJwt": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "Dashboard JWT",
"description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
"x-fern-bearer": {
"name": "dashboardJwt",
"env": "RESPAN_DASHBOARD_JWT"
}
},
"RespanApiKey": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "Respan API key",
"description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
"x-fern-bearer": {
"name": "respanApiKey",
"env": "RESPAN_API_KEY"
}
}
}
}