---
title: "Get trace by id"
method: GET
path: "/v1/private/traces/{id}"
tags: ["Traces"]
---

# Get trace by id

`GET /v1/private/traces/{id}`

Get trace by id

## Path parameters

- `id` string, uuid, required

## Query parameters

- `strip_attachments` boolean — If true, returns attachment references like [file.png]; if false, downloads and reinjects attachment content from S3 (default: false for backward compatibility)

## Response `200`

Trace resource

- TracePublic
  - `id` string, uuid
  - `project_id` string, uuid
  - `name` string
  - `start_time` string, date-time, required
  - `end_time` string, date-time
  - `input` JsonListStringPublic
  - `output` JsonListStringPublic
  - `metadata` JsonListStringPublic
  - `tags` string[]
  - `error_info` ErrorInfoPublic
    - `exception_type` string, required
    - `message` string
    - `traceback` string, required
  - `usage` object
  - `created_at` string, date-time
  - `last_updated_at` string, date-time
  - `created_by` string
  - `last_updated_by` string
  - `feedback_scores` FeedbackScorePublic[]
    - `name` string, required
    - `category_name` string
    - `value` number, required
    - `reason` string
    - `source` 'ui' | 'sdk' | 'online_scoring', required
    - `source_queue_id` string, uuid
    - `created_at` string, date-time
    - `last_updated_at` string, date-time
    - `created_by` string
    - `last_updated_by` string
    - `value_by_author` object
  - `span_feedback_scores` FeedbackScorePublic[] — Aggregated feedback scores from all spans in this trace, averaged by score name
    - `name` string, required
    - `category_name` string
    - `value` number, required
    - `reason` string
    - `source` 'ui' | 'sdk' | 'online_scoring', required
    - `source_queue_id` string, uuid
    - `created_at` string, date-time
    - `last_updated_at` string, date-time
    - `created_by` string
    - `last_updated_by` string
    - `value_by_author` object
  - `comments` CommentPublic[]
    - `id` string, uuid
    - `text` string, required
    - `source_queue_id` string, uuid
    - `created_at` string, date-time
    - `last_updated_at` string, date-time
    - `created_by` string
    - `last_updated_by` string
  - `guardrails_validations` GuardrailsValidationPublic[]
    - `span_id` string, uuid
    - `checks` CheckPublic[]
      - `name` 'TOPIC' | 'PII' | 'LLM_JUDGE' | 'PROMPT_INJECTION' | 'CUSTOM_CLASSIFIER'
      - `result` 'passed' | 'failed'
  - `total_estimated_cost` number
  - `span_count` integer
  - `duration` number, double — Duration in milliseconds as a decimal number to support sub-millisecond precision
  - `ttft` number, double — Time to first token in milliseconds
  - `thread_id` string
  - `visibility_mode` 'default' | 'hidden'
  - `llm_span_count` integer
  - `has_tool_spans` boolean
  - `providers` string[] — List of unique provider names from all spans in this trace, sorted alphabetically
  - `experiment` ExperimentItemReferencePublic — Experiment reference with ID, name, dataset ID, and dataset item ID
    - `id` string, uuid, required — Experiment ID
    - `name` string, required — Experiment name
    - `dataset_id` string, uuid, required — Dataset ID
    - `dataset_item_id` string, uuid, required — Dataset Item ID
  - `source` 'sdk' | 'experiment' | 'playground' | 'optimization' | 'evaluator'
  - `environment` string

---

[API](https://skmtc.net/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.net/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/versions/4ed2fbc97cc3/schema)
