v4

latestOpenAPI 3.1.02026-08-019681,1012.0 MB
trace

Recompute Metrics

post/projects/{project_id}/recompute-metrics

Path parameters

project_idstring uuid4 required

Request body

starting_tokeninteger
limitinteger
previous_last_row_idstring uuid4 nullable
log_stream_idstring uuid4 nullable

Log stream id associated with the traces.

experiment_idstring uuid4 nullable

Experiment id associated with the traces.

metrics_testing_idstring uuid4 nullable

Metrics testing id associated with the traces.

truncate_fieldsboolean
include_countsboolean

If True, include computed child counts (e.g., num_traces for sessions, num_spans for traces).

include_code_metric_metadataboolean

If True, include per-row scorer metadata (the dict returned alongside the score by code-based scorers via the (score, metadata) tuple-return contract) on each MetricSuccess in the response. Off by default to keep payloads small for callers that don't need it.

scorer_idsstring[] required

List of scorer IDs for which metrics should be recomputed.

Example request

{
  "filters": [
    {
      "case_sensitive": true,
      "name": "input",
      "operator": "eq",
      "type": "text",
      "value": "example input"
    }
  ],
  "log_stream_id": "00000000-0000-0000-0000-000000000000",
  "pagination": {
    "limit": 5,
    "starting_token": 0
  },
  "sort": {
    "ascending": false,
    "name": "updated_at",
    "sort_type": "column"
  }
}

Response

Successful Response

{"stackTrail":"paths:/projects/{project_id}/recompute-metrics:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}