---
title: "Read Examples With Runs Grouped"
method: POST
path: "/api/v1/datasets/{dataset_id}/group/runs"
tags: ["datasets"]
---

# Read Examples With Runs Grouped

`POST /api/v1/datasets/{dataset_id}/group/runs`

Fetch examples for a dataset, and fetch the runs for each example if they are associated with the given session_ids.

## Path parameters

- `dataset_id` string, uuid, required

## Request body

- QueryGroupedExamplesWithRuns
  - `session_ids` string[], required
  - `offset` integer
  - `limit` integer
  - `preview` boolean
  - `group_by` 'run_metadata' | 'example_metadata', required
  - `metadata_key` string, required
  - `per_group_limit` integer
  - `filters` object, nullable

## Response `200`

Successful Response

- GroupedExamplesWithRunsResponse — Response for grouped comparison view of dataset examples. Returns dataset examples grouped by a run metadata value (e.g., model='gpt-4'). Optional filters are applied to all runs before grouping. Shows: - Which examples were executed with each metadata value - Per-session aggregate statistics for runs on those examples - The actual example data with their associated runs Used for comparing how different sessions performed on the same set of examples.
  - `groups` ExampleGroupWithSessions[], required
    - `filter` string, required
    - `count` integer, nullable
    - `total_tokens` integer, nullable
    - `total_cost` string, nullable
    - `min_start_time` string, date-time, nullable
    - `max_start_time` string, date-time, nullable
    - `latency_p50` number, nullable
    - `latency_p99` number, nullable
    - `feedback_stats` object, nullable
    - `group_key` union, required
      - string
      - integer
      - number
    - `sessions` GroupedRunsSessionStats[], required
      - `start_time` string, date-time
      - `end_time` string, date-time, nullable
      - `extra` object, nullable
      - `name` string
      - `description` string, nullable
      - `default_dataset_id` string, uuid, nullable
      - `reference_dataset_id` string, uuid, nullable
      - `trace_tier` 'longlived' | 'shortlived'
      - `id` string, uuid, required
      - `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
      - `total_cost` string, nullable
      - `prompt_cost` string, nullable
      - `completion_cost` string, nullable
      - `tenant_id` string, uuid, required
      - `last_run_start_time` string, date-time, nullable
      - `last_run_start_time_live` string, date-time, nullable
      - `feedback_stats` object, nullable
      - `session_feedback_stats` object, nullable
      - `run_facets` object[], nullable
      - `error_rate` number, nullable
      - `streaming_rate` number, nullable
      - `test_run_number` integer, nullable
      - `example_count` integer, nullable
      - `filter` string, required
      - `min_start_time` string, date-time, nullable
      - `max_start_time` string, date-time, nullable
    - `examples` ExampleWithRunsCH[], required
      - `outputs` object, nullable
      - `dataset_id` string, uuid, required
      - `source_run_id` string, uuid, nullable
      - `metadata` object, nullable
      - `inputs` object, required
      - `created_at` string, date-time
      - `id` string, uuid, required
      - `name` string, required
      - `modified_at` string, date-time, nullable
      - `attachment_urls` object, nullable
      - `runs` RunSchemaComparisonView[], required
        - `name` string, required
        - `inputs` object, nullable
        - `inputs_preview` string, nullable
        - `run_type` 'tool' | 'chain' | 'llm' | 'retriever' | 'embedding' | 'prompt' | 'parser', required — Enum for run types.
        - `start_time` string, date-time
        - `end_time` string, date-time, nullable
        - `extra` object, nullable
        - `error` string, nullable
        - `execution_order` integer
        - `serialized` object, nullable
        - `outputs` object, nullable
        - `outputs_preview` string, nullable
        - `parent_run_id` string, uuid, nullable
        - `manifest_id` string, uuid, nullable
        - `manifest_s3_id` string, uuid, nullable
        - `events` object[], nullable
        - `tags` string[], nullable
        - `inputs_s3_urls` object, nullable
        - `outputs_s3_urls` object, nullable
        - `s3_urls` object, nullable
        - `trace_id` string, uuid, required
        - `dotted_order` string, nullable
        - `trace_min_start_time` string, date-time, nullable
        - `trace_max_start_time` string, date-time, nullable
        - `id` string, uuid, required
        - `session_id` string, uuid, required
        - `reference_example_id` string, uuid, nullable
        - `total_tokens` integer, nullable
        - `prompt_tokens` integer, nullable
        - `completion_tokens` integer, nullable
        - `total_cost` string, nullable
        - `prompt_cost` string, nullable
        - `completion_cost` string, nullable
        - `status` string, required
        - `feedback_stats` object, nullable
        - `app_path` string, nullable
        - `feedbacks` FeedbackSchema[]
          - `created_at` string, date-time
          - `modified_at` string, date-time
          - `key` string, required
          - `score` union
            - number
            - integer
            - boolean
          - `value` union
            - number
            - integer
            - boolean
            - string
            - object
          - `comment` string, nullable
          - `correction` union
            - object
            - string
          - `feedback_group_id` string, uuid, nullable
          - `comparative_experiment_id` string, uuid, nullable
          - `run_id` string, uuid, nullable
          - `session_id` string, uuid, nullable
          - `id` string, uuid, required
          - `trace_id` string, uuid, nullable
          - `start_time` string, date-time, nullable
          - `is_root` boolean
          - `feedback_source` FeedbackSource — The feedback source loaded from the database.
            - `type` string, nullable
            - `metadata` object, nullable
            - `user_id` string, uuid, nullable
            - `ls_user_id` string, uuid, nullable
            - `user_name` string, nullable
          - `extra` object, nullable
          - `feedback_thread_id` string, nullable
    - `example_count` integer, required
    - `prompt_tokens` integer, nullable
    - `completion_tokens` integer, nullable
    - `prompt_cost` string, nullable
    - `completion_cost` string, nullable
    - `error_rate` number, nullable

## 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/versions/a0acb3a6a101/schema)
