---
title: "Get Trace Detail"
method: GET
path: "/admin/api/v1/traces/{otel_trace_id}"
tags: ["Traces"]
---

# Get Trace Detail

`GET /admin/api/v1/traces/{otel_trace_id}`

Return the trace + its span tree.

Trace lookup uses the full 16-byte W3C id stored on
``standalone_trace``. The span query uses the trailing 8-byte slice
(``trace_id[8:]``) — that's the form the exporter persists onto
``standalone_span.otel_trace_id``.

## Path parameters

- `otel_trace_id` string, required

## Response `200`

Successful Response

- StandaloneTraceDetail — Body of ``GET /admin/api/v1/traces/{otel_trace_id}``. ``tree`` holds the top-level spans of the trace. Orphan spans (those whose ``parent_span_id`` is not present in the same trace, e.g. truncated traces or cross-trace links) are also surfaced as roots so the UI never silently hides them.
  - `trace` StandaloneTraceListItem, required — One row in ``GET /admin/api/v1/traces`` list response. ``otel_trace_id`` is the lowercase hex encoding of the 16-byte W3C trace id. The DB stores raw bytes; routers convert at the boundary so JSON consumers never see a binary blob.
    - `otelTraceId` string, required
    - `name` string, required
    - `startedAt` string, date-time, required
    - `endedAt` string, date-time, nullable
    - `latencyMs` number, nullable
    - `totalTokens` integer, nullable
    - `totalCostUsd` number, nullable
    - `models` string[]
    - `status` string, nullable
    - `userId` string, nullable
    - `sessionId` string, nullable
    - `tags` string[]
  - `tree` StandaloneSpanTreeNode[]
    - `span` StandaloneSpanRead, required — One span read from the standalone_span table. ``otel_span_id`` and ``parent_span_id`` are 8-byte hex strings. ``otel_trace_id`` is the 8-byte slice of the parent trace id (the span table only stores the trailing half — see the exporter).
      - `otelSpanId` string, required
      - `otelTraceId` string, required
      - `parentSpanId` string, nullable
      - `name` string, required
      - `kind` string, required
      - `startedAt` string, date-time, required
      - `endedAt` string, date-time, nullable
      - `latencyMs` number, nullable
      - `model` string, nullable
      - `provider` string, nullable
      - `promptTokens` integer, nullable
      - `completionTokens` integer, nullable
      - `cacheReadTokens` integer, nullable
      - `cacheWriteTokens` integer, nullable
      - `totalTokens` integer, nullable
      - `costUsd` number, nullable
      - `costBreakdown` object, nullable
      - `costSource` string, nullable
      - `status` string, nullable
      - `attributes` object, nullable
      - `events` object[], nullable
    - `children` StandaloneSpanTreeNode[]

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/idun-group/apis/idun-agent-engine-server.md) · [All operations](https://skmtc.net/idun-group/apis/idun-agent-engine-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/idun-group/idun-agent-engine-server/revisions/8909cd73cc1c/schema)
