---
title: "Retrieve an experiment trace"
method: GET
path: "/api/v2/experiments/{experiment_id}/logs/{log_id}/"
tags: ["experiments"]
---

# Retrieve an experiment trace

`GET /api/v2/experiments/{experiment_id}/logs/{log_id}/`

Retrieve one experiment trace with its full span tree and enriched evaluator scores.

## Path parameters

- `experiment_id` string, required
- `log_id` string, required

## Headers

- `Authorization` string, required

## Response `200`

Experiment trace details.

- ExperimentsRetrieveExperimentSpanResponse200
  - `id` string, required — Trace ID. Use this value as `log_id` for trace detail and wait-workflow resume routes.
  - `trace_unique_id` string — Trace unique ID.
  - `root_span_unique_id` string, nullable
  - `environment` string, nullable
  - `customer_identifier` string, nullable
  - `name` string, nullable
  - `input` unknown
  - `output` unknown
  - `expected_output` unknown
  - `status` string, nullable
  - `comparison_key` string, nullable — Stable key for comparing the same input across experiments.
  - `start_time` string, date-time, nullable
  - `end_time` string, date-time, nullable
  - `duration` number, double, nullable — Trace duration in seconds.
  - `span_count` integer, nullable
  - `llm_call_count` integer, nullable
  - `total_cost` number, double, nullable
  - `total_tokens` integer, nullable
  - `total_prompt_tokens` integer, nullable
  - `total_completion_tokens` integer, nullable
  - `error_count` integer, nullable
  - `scores` object — Scores keyed by evaluator ID or slug. Each value includes evaluator metadata and the score value field matching `score_value_type`.
  - `span_tree` ApiV2ExperimentsExperimentIdLogsLogIdGetResponsesContentApplicationJsonSchemaSpanTreeItems[] — Hierarchical span tree for this trace.
    - `id` string, required — Trace ID. Use this value as `log_id` for trace detail and wait-workflow resume routes.
    - `trace_unique_id` string — Trace unique ID.
    - `root_span_unique_id` string, nullable
    - `environment` string, nullable
    - `customer_identifier` string, nullable
    - `name` string, nullable
    - `input` unknown
    - `output` unknown
    - `expected_output` unknown
    - `status` string, nullable
    - `comparison_key` string, nullable — Stable key for comparing the same input across experiments.
    - `start_time` string, date-time, nullable
    - `end_time` string, date-time, nullable
    - `duration` number, double, nullable — Trace duration in seconds.
    - `span_count` integer, nullable
    - `llm_call_count` integer, nullable
    - `total_cost` number, double, nullable
    - `total_tokens` integer, nullable
    - `total_prompt_tokens` integer, nullable
    - `total_completion_tokens` integer, nullable
    - `error_count` integer, nullable
    - `scores` object — Scores keyed by evaluator ID or slug. Each value includes evaluator metadata and the score value field matching `score_value_type`.
    - `span_name` string, nullable
    - `log_type` string, nullable
    - `model` string, nullable
    - `children` object[]

## Other responses

- `401` — Unauthorized - Missing or invalid authentication
- `404` — Not Found
- `413` — The query exceeded a memory or execution-time resource limit.

## Changes

> 6 revisions in range; 3 could not be searched.

- **2026-07-31** `c26d550029f8` — 5 breaking, 12 info
  - the `expected_output` response's property type/format changed from ``/`` to `string`/`` for status `200`
  - the `input` response's property type/format changed from ``/`` to `string`/`` for status `200`
  - the `output` response's property type/format changed from ``/`` to `string`/`` for status `200`
  - the `scores` response's property type/format changed from `object`/`` to `string`/`` for status `200`
  - …13 more

[Change history](https://skmtc.dev/keywordsai/apis/api-reference/changes/api/v2/experiments/:experiment_id/logs/:log_id/get.md)

---

[API](https://skmtc.dev/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.dev/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/c61efaf24756/schema)
