> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keywordsai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get experiment logs summary

Retrieves aggregated summary statistics for experiment traces matching the current filters. This is useful for getting overview metrics without retrieving individual traces.

## Authentication

* API key: `Authorization: Bearer <API key>`

## Path Parameters

<ParamField path="experiment_id" type="string" required>
  The ID of the experiment to get summary statistics for.
</ParamField>

## Query Parameters

<ParamField query="start_time" type="string" required={false}>
  Filter start time (ISO format).
</ParamField>

<ParamField query="end_time" type="string" required={false}>
  Filter end time (ISO format).
</ParamField>

## POST Request Body (Optional)

For advanced filtering, you can send a POST request with filters in the body:

<RequestExample>
  ```json Request theme={"system"}
  {
    "filters": [
      {
        "field": "status",
        "operator": "=",
        "value": "completed"
      },
      {
        "field": "total_cost",
        "operator": ">=",
        "value": 0.01
      }
    ]
  }
  ```
</RequestExample>

**Supported Filter Operators:**

* `=` or `""`: Exact match
* `!=` or `"not"`: Not equal
* `>`, `>=`, `<`, `<=` or `"gt"`, `"gte"`, `"lt"`, `"lte"`: Numeric comparisons
* `contains`: String contains (case-insensitive)
* `startsWith`: String starts with
* `endsWith`: String ends with
* `in` or `IN`: Value in list
* `not_in` or `NOT IN`: Value not in list

<Note>
  For more filter operators and examples, see the [Filters API Reference](/api-endpoints/reference/filters_api_reference).
</Note>

## Examples

<CodeGroup>
  ```python Python theme={"system"}
  import requests

  experiment_id = "experiment_id_123"
  url = f"https://api.keywordsai.co/api/v2/experiments/{experiment_id}/logs/summary/"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY"
  }

  # GET request
  response = requests.get(url, headers=headers)
  print(response.json())

  # POST request with filtering
  data = {
      "filters": [
          {
              "field": "status",
              "operator": "=",
              "value": "completed"
          }
      ]
  }
  response = requests.post(url, headers=headers, json=data)
  print(response.json())
  ```

  ```bash cURL theme={"system"}
  # GET request
  curl -X GET "https://api.keywordsai.co/api/v2/experiments/{experiment_id}/logs/summary/" \
    -H "Authorization: Bearer YOUR_API_KEY"

  # POST request with filtering
  curl -X POST "https://api.keywordsai.co/api/v2/experiments/{experiment_id}/logs/summary/" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "filters": [
        {
          "field": "status",
          "operator": "=",
          "value": "completed"
        }
      ]
    }'
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json 200 OK theme={"system"}
  {
    "total_count": 150,
    "total_cost": 12.45,
    "total_tokens": 50000,
    "total_prompt_tokens": 30000,
    "total_completion_tokens": 20000,
    "avg_latency": 1.23
  }
  ```
</ResponseExample>

**Response Fields:**

* `total_count`: Total number of traces matching filters
* `total_cost`: Sum of all trace costs (in dollars)
* `total_tokens`: Sum of all tokens (input + output)
* `total_prompt_tokens`: Sum of all input tokens
* `total_completion_tokens`: Sum of all output tokens
* `avg_latency`: Average latency across all traces (in seconds)

**Notes:**

* Uses same filtering logic as list endpoint for consistency
* Returns zeros if no traces match the filters
* Supports both GET and POST methods (POST for advanced filtering)
* Efficient aggregation without loading individual trace data
