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

# Get span summary

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

## Request

- Base URL: `https://api.respan.ai`
- URL: `https://api.respan.ai/api/request-logs/summary/`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Returns aggregate span statistics for a time range. Send `start_time`, `end_time`, and `environment` as query parameters, and additional `filters` in the JSON body. Fields such as `log_type` are not read from query parameters. Empty or omitted `filters` may use pre-aggregated data; non-empty `filters` query individual spans using the List spans filter format.

## Query parameters

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

## Request body

- object
  - `filters` Filters: Each key is a field to filter on, and each value is a condition: `{"<field>": {"operator": "<operator>", "value": [...]}}`. A result must match every condition. To set two conditions on one field, such as a range, pass a list of conditions. **Operators:** `""` (equals, the default), `not`, `in`, `not_in`, `lt`, `lte`, `gt`, `gte`, `contains`, `not_contains`, `icontains` (ignores case), `startswith`, `not_startswith`, `endswith`, `not_endswith`, `empty`, `not_empty`. Put values in a list: `""` and `in` match any of the listed values, and `not` and `not_in` match none of them. Other operators take one value; for `empty` and `not_empty`, send `[""]`. The fields you can filter on depend on the endpoint; `metadata__<key>` filters custom metadata where the endpoint supports it.
    - `status` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `status_code` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `unique_id` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `customer_identifier` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `thread_identifier` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `custom_identifier` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `group_identifier` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `prompt_id` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `trace_unique_id` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `span_parent_id` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `is_root_span` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `span_workflow_name` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `span_name` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `model` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `log_type` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `stream` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `has_tool_calls` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `cache_bit` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `cache_key` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `prompt_tokens` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `completion_tokens` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `total_tokens` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `cost` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `latency` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `positive_feedback` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown

## Response `200`

Summary statistics for matching spans.

- object
  - `number_of_requests` integer, required: Total number of matching spans/log rows.
  - `total_cost` number, 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, required: Average latency in seconds.
  - `avg_tps` number, required: Average tokens per second.
  - `avg_ttft` number, required: Average time to first token in seconds.
  - `scores` object, required: Aggregated score summaries grouped by evaluator ID.

## Other responses

- `400`: Bad Request
- `403`: The API key is missing, invalid or expired.
- `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

## Changes

- **2026-10-21** `c30bcb383ee8`: 4 breaking, 4 info
  - the `avg_latency` response's property format changed from `double` to no format for status `200`
  - the `avg_tps` response's property format changed from `double` to no format for status `200`
  - the `avg_ttft` response's property format changed from `double` to no format for status `200`
  - the `total_cost` response's property format changed from `double` to no format for status `200`
  - …4 more
- **2026-10-02** `b830b79cfd52`: 46 breaking, 5 warning, 142 info
  - removed the enum value `iexact` of the request property `filters/cache_key/operator`
  - removed the enum value `iexact` of the request property `filters/completion_tokens/operator`
  - removed the enum value `iexact` of the request property `filters/cost/operator`
  - removed the enum value `iexact` of the request property `filters/custom_identifier/operator`
  - …189 more
- **2026-09-17** `6fa8242da8c2`: 1 warning, 1 info
  - deleted the `header` request parameter `Authorization`
  - the endpoint scheme security `RespanApiKey` was added to the API
- **2026-09-12** `22b868ef3f22`: 1 info
  - api operation id `get-spans-summary` removed and replaced with `spans_getSpansSummary`
- …earlier changes not shown

[Operation history](https://skmtc.dev/keywordsai/apis/respan-api/changes/api/request-logs/summary/post.md)

---

[API](https://skmtc.dev/keywordsai/apis/respan-api.md) - [All operations](https://skmtc.dev/keywordsai/apis/respan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/keywordsai/apis/respan-api/revisions/900841387635?raw)
