Api Datasets Logs Summary Retrieve
Get summary statistics for dataset logs including score summaries
Endpoint:
GET /api/datasets/{dataset_id}/logs/summary/
POST /api/datasets/{dataset_id}/logs/summary/ (for filtering)
Args (POST body, optional):
- filters (object, optional): Filter criteria to aggregate subset of logs
Returns (200 OK):
```json
{
"number_of_requests": 150,
"total_cost": 12.45,
"total_tokens": 50000,
"total_prompt_tokens": 30000,
"total_completion_tokens": 20000,
"avg_latency": 1.23,
"avg_tps": 45.2,
"avg_ttft": 0.8,
"scores": {
"<evaluator_id>": {
"evaluator_id": "<uuid>",
"evaluator_slug": "quality_check",
"evaluator_name": "Quality Check",
"score_value_type": "numerical",
"avg_score": 4.5,
"true_count": null,
"false_count": null
}
}
}
```
Smart Syncing:
When no filters are provided (or filters are empty), the endpoint will:
1. Count all logs in the dataset
2. Update dataset.log_count with the accurate count
3. Return the count
This ensures the dataset log_count stays accurate without requiring
separate sync operations.
Examples:
Get total count (syncs to dataset):
```
GET /api/datasets/{id}/logs/summary/
POST /api/datasets/{id}/logs/summary/
POST /api/datasets/{id}/logs/summary/ with {"filters": {}}
```
Get filtered count (no sync):
```
POST /api/datasets/{id}/logs/summary/
Body: {"filters": {"status_code": {"operator": "eq", "value": 200}}}
```
Note: Score summaries only include evaluators with score_value_type of
'numerical', 'percentage', or 'boolean'.
Authentication
AuthorizationBearer
JWT access token or Respan API key
Path parameters
dataset_id
Response
number_of_requests
total_cost
total_tokens
total_prompt_tokens
total_completion_tokens
avg_latency
avg_tps
avg_ttft
has_output
scores