---
title: "Stats Runs"
method: POST
path: "/api/v1/runs/stats"
tags: ["run"]
---

# Stats Runs

`POST /api/v1/runs/stats`

Get all runs by query in body payload.

## Request body

- RunStatsQueryParams — Query params for run stats.
  - `id` string[], nullable
  - `trace` string, uuid, nullable
  - `parent_run` string, uuid, nullable
  - `run_type` 'tool' | 'chain' | 'llm' | 'retriever' | 'embedding' | 'prompt' | 'parser' — Enum for run types.
  - `session` string[], nullable
  - `reference_example` string[], nullable
  - `execution_order` integer, nullable
  - `start_time` string, date-time, nullable
  - `end_time` string, date-time, nullable
  - `error` boolean, nullable
  - `query` string, nullable
  - `filter` string, nullable
  - `trace_filter` string, nullable
  - `tree_filter` string, nullable
  - `is_root` boolean, nullable
  - `data_source_type` 'current' | 'historical' | 'lite' | 'root_lite' | 'runs_feedbacks_rmt_wide' — Enum for run data source types.
  - `skip_pagination` boolean, nullable
  - `search_filter` string, nullable
  - `use_experimental_search` boolean
  - `group_by` RunStatsGroupBy — Group by param for run stats.
    - `attribute` 'name' | 'run_type' | 'tag' | 'metadata', required
    - `path` string, nullable
    - `max_groups` integer
  - `groups` string[], nullable
  - `select` RunStatsSelect[], nullable

## Response `200`

Successful Response

- union
  - RunStats
    - `run_count` integer, nullable
    - `latency_p50` number, nullable
    - `latency_p99` number, nullable
    - `first_token_p50` number, nullable
    - `first_token_p99` number, nullable
    - `total_tokens` integer, nullable
    - `prompt_tokens` integer, nullable
    - `completion_tokens` integer, nullable
    - `median_tokens` integer, nullable
    - `completion_tokens_p50` integer, nullable
    - `prompt_tokens_p50` integer, nullable
    - `tokens_p99` integer, nullable
    - `completion_tokens_p99` integer, nullable
    - `prompt_tokens_p99` integer, nullable
    - `last_run_start_time` string, date-time, nullable
    - `feedback_stats` object, nullable
    - `run_facets` object[], nullable
    - `error_rate` number, nullable
    - `streaming_rate` number, nullable
    - `total_cost` number, nullable
    - `prompt_cost` number, nullable
    - `completion_cost` number, nullable
    - `cost_p50` number, nullable
    - `cost_p99` number, nullable
    - `prompt_token_details` object, nullable
    - `completion_token_details` object, nullable
    - `prompt_cost_details` object, nullable
    - `completion_cost_details` object, nullable
  - object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/langchain-ai/apis/langsmith.md) · [All operations](https://skmtc.net/langchain-ai/apis/langsmith/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langchain-ai/langsmith/revisions/a0acb3a6a101/schema)
