---
title: "Get span by id"
method: GET
path: "/v1/private/spans/{id}"
tags: ["Spans"]
---

# Get span by id

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

Get span 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`

Span resource

- SpanPublic
  - `id` string, uuid
  - `project_name` string — If null, the default project is used
  - `project_id` string, uuid
  - `trace_id` string, uuid
  - `parent_span_id` string, uuid
  - `name` string
  - `type` 'general' | 'tool' | 'llm' | 'guardrail'
  - `start_time` string, date-time, required
  - `end_time` string, date-time
  - `input` JsonListStringPublic
  - `output` JsonListStringPublic
  - `metadata` JsonListStringPublic
  - `model` string
  - `provider` string
  - `tags` string[]
  - `usage` object
  - `error_info` ErrorInfoPublic
    - `exception_type` string, required
    - `message` string
    - `traceback` string, required
  - `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
  - `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
  - `total_estimated_cost` number
  - `total_estimated_cost_version` string
  - `duration` number, double — Duration in milliseconds as a decimal number to support sub-millisecond precision
  - `ttft` number, double — Time to first token in milliseconds
  - `source` 'sdk' | 'experiment' | 'playground' | 'optimization' | 'evaluator'
  - `environment` string

## Other responses

- `404` — Not found

---

[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)
