> ## Documentation Index
> Fetch the complete documentation index at: https://docs.visceralai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Trace Detail

> Every span of one trace, oldest first, with framework node identity — the run map.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/workspaces/{workspace_id}/traces/{trace_id}
openapi: 3.1.0
info:
  title: Visceral Backend
  version: 0.2.0
  description: >-
    The Visceral backend HTTP API. SDK and ingestion endpoints authenticate with
    a workspace API key; dashboard and CLI endpoints authenticate with a user
    session token. Both are sent as `Authorization: Bearer <token>`.
servers:
  - url: https://api.visceralai.dev
security: []
paths:
  /v1/workspaces/{workspace_id}/traces/{trace_id}:
    get:
      tags:
        - stats
      summary: Trace Detail
      description: >-
        Every span of one trace, oldest first, with framework node identity —
        the run map.
      operationId: trace_detail_v1_workspaces__workspace_id__traces__trace_id__get
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
        - name: trace_id
          in: path
          required: true
          schema:
            type: string
            title: Trace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - sessionToken: []
components:
  schemas:
    TraceDetail:
      properties:
        trace_id:
          type: string
          title: Trace Id
        spans:
          items:
            $ref: '#/components/schemas/SpanInfo'
          type: array
          title: Spans
        truncated:
          type: boolean
          title: Truncated
      type: object
      required:
        - trace_id
        - spans
        - truncated
      title: TraceDetail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SpanInfo:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        span_id:
          type: string
          title: Span Id
        parent_span_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Span Id
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        event_type:
          type: string
          title: Event Type
        event_name:
          type: string
          title: Event Name
        span_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Span Kind
        openinference_span_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Openinference Span Kind
        start_time:
          type: string
          format: date-time
          title: Start Time
        end_time:
          type: string
          format: date-time
          title: End Time
        duration_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration Ms
        status_code:
          type: string
          title: Status Code
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Input Tokens
        output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Output Tokens
        cost_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost Usd
        tool_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
        framework:
          anyOf:
            - type: string
            - type: 'null'
          title: Framework
        node_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Node Name
      type: object
      required:
        - id
        - span_id
        - parent_span_id
        - agent_id
        - event_type
        - event_name
        - span_kind
        - openinference_span_kind
        - start_time
        - end_time
        - duration_ms
        - status_code
        - model
        - input_tokens
        - output_tokens
        - cost_usd
        - tool_name
        - session_id
        - framework
        - node_name
      title: SpanInfo
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    sessionToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Short-lived user access token (ES256 JWT) issued by `POST
        /v1/auth/login` or the CLI device flow.

````