---
title: "Get spans summary"
method: POST
path: "/api/request-logs/summary/"
tags: ["spans"]
---

# Get spans summary

`POST /api/request-logs/summary/`

Get aggregated statistics for spans/log rows in a time range. `start_time`, `end_time`, and `environment` are URL query parameters. Additional filters must be sent in the JSON body under `filters`; fields such as `log_type` are not read as summary query parameters. When `filters` is omitted or empty, the backend may use the pre-aggregated summary path; when `filters` is non-empty, it queries raw logs using the same filter object shape as List spans.

## Query parameters

- `start_time` string, date-time
- `end_time` string, date-time
- `environment` 'prod' | 'test'

## Headers

- `Authorization` string, required

## Request body

- object
  - `filters` Filters — Filter criteria. See [Filters API Reference](/docs/apis/reference/filters-api-reference) for operator syntax.
    - `status` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `status_code` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `unique_id` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `customer_identifier` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `thread_identifier` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `custom_identifier` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `group_identifier` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `prompt_id` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `trace_unique_id` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `span_parent_id` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `is_root_span` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `span_workflow_name` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `span_name` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `model` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `log_type` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `stream` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `tools` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `cache_hit` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `cache_key` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `prompt_tokens` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `completion_tokens` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `total_tokens` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `cost` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `latency` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `metadata` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `messages` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `positive_feedback` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown
    - `evaluator_id` FilterValue — A filter condition with an operator and value.
      - `operator` '' | 'iexact' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'icontains' | 'startswith' | 'endswith' | 'in' | 'isnull' | 'not' — Comparison operator. Empty string for exact match.
      - `value` unknown[], required — Value(s) to filter by.
        - unknown

## Response `200`

Summary statistics for matching spans.

- SpansGetSpansSummaryResponse200
  - `number_of_requests` integer, required — Total number of matching spans/log rows.
  - `total_cost` number, double, required — Total cost in USD for all matching spans/log rows.
  - `total_tokens` integer, required — Total tokens across all matching spans/log rows.
  - `total_prompt_tokens` integer, required — Total prompt/input tokens.
  - `total_completion_tokens` integer, required — Total completion/output tokens.
  - `avg_latency` number, double, required — Average latency in seconds.
  - `avg_tps` number, double, required — Average tokens per second.
  - `avg_ttft` number, double, required — Average time to first token in seconds.
  - `scores` object, required — Aggregated score summaries grouped by evaluator ID.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized - Missing/invalid authentication
- `413` — The query exceeded the service's memory or execution-time limit. Narrow the time range or add filters before retrying.
- `429` — Rate Limited
- `500` — Internal Server Error

---

[API](https://skmtc.net/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.net/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/4e064cf81dae/schema)
