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

# Get Trace

> Retrieve a single trace with all its spans.

Auth: `Bearer` + `X-Project-ID` | `X-API-Key` + `X-Project-Name`



## OpenAPI

````yaml /openapi.json get /traces/{trace_id}
openapi: 3.1.0
info:
  title: PandaProbe API
  description: >-
    Open-source agent engineering platform — trace LLM calls, evaluate agent
    performance, and monitor AI pipelines.
  version: 0.1.0
  contact:
    name: PandaProbe
    url: https://www.pandaprobe.com
    email: support@pandaprobe.com
servers:
  - url: https://api.pandaprobe.com
    description: Production
security: []
tags:
  - name: health
    description: Service health and readiness probes.
  - name: user
    description: Authenticated user profile.
  - name: traces
    description: Trace ingestion, querying, updating, and analytics.
  - name: sessions
    description: Session-based trace aggregation and analytics.
  - name: evaluations
    description: Evaluation runs, scores, analytics, and monitoring.
  - name: organizations
    description: Organization management and membership.
  - name: projects
    description: Project CRUD within organizations.
  - name: api-keys
    description: API key lifecycle management.
paths:
  /traces/{trace_id}:
    get:
      tags:
        - traces
      summary: Get Trace
      description: |-
        Retrieve a single trace with all its spans.

        Auth: `Bearer` + `X-Project-ID` | `X-API-Key` + `X-Project-Name`
      operationId: get_trace_traces__trace_id__get
      parameters:
        - name: trace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Trace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
        - ApiKey: []
        - ProjectID: []
        - ProjectName: []
components:
  schemas:
    TraceResponse:
      properties:
        trace_id:
          type: string
          format: uuid
          title: Trace Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        status:
          $ref: '#/components/schemas/TraceStatus'
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        output:
          anyOf:
            - {}
            - type: 'null'
          title: Output
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        started_at:
          type: string
          title: Started At
        ended_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Ended At
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        tags:
          items:
            type: string
          type: array
          title: Tags
        environment:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment
        release:
          anyOf:
            - type: string
            - type: 'null'
          title: Release
        spans:
          items:
            $ref: '#/components/schemas/SpanResponse'
          type: array
          title: Spans
      type: object
      required:
        - trace_id
        - project_id
        - name
        - status
        - input
        - output
        - metadata
        - started_at
        - ended_at
        - session_id
        - user_id
        - tags
      title: TraceResponse
      description: Public trace representation (single-item detail).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TraceStatus:
      type: string
      enum:
        - PENDING
        - RUNNING
        - COMPLETED
        - ERROR
      title: TraceStatus
      description: High-level status of a trace.
    SpanResponse:
      properties:
        span_id:
          type: string
          format: uuid
          title: Span Id
        trace_id:
          type: string
          format: uuid
          title: Trace Id
        parent_span_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Span Id
        name:
          type: string
          title: Name
        kind:
          $ref: '#/components/schemas/SpanKind'
        status:
          $ref: '#/components/schemas/SpanStatusCode'
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        output:
          anyOf:
            - {}
            - type: 'null'
          title: Output
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        token_usage:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Token Usage
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        started_at:
          type: string
          title: Started At
        ended_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Ended At
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        completion_start_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Completion Start Time
        model_parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Model Parameters
        cost:
          anyOf:
            - additionalProperties:
                type: number
              type: object
            - type: 'null'
          title: Cost
        latency_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Latency Ms
        time_to_first_token_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Time To First Token Ms
      type: object
      required:
        - span_id
        - trace_id
        - parent_span_id
        - name
        - kind
        - status
        - input
        - output
        - model
        - token_usage
        - metadata
        - started_at
        - ended_at
        - error
        - completion_start_time
        - model_parameters
        - cost
      title: SpanResponse
      description: Public span representation.
    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
    SpanKind:
      type: string
      enum:
        - AGENT
        - TOOL
        - LLM
        - RETRIEVER
        - CHAIN
        - EMBEDDING
        - OTHER
      title: SpanKind
      description: Categorises what a span represents in an agentic workflow.
    SpanStatusCode:
      type: string
      enum:
        - UNSET
        - OK
        - ERROR
      title: SpanStatusCode
      description: Mirrors the OTel StatusCode for a span's outcome.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
    ProjectID:
      type: apiKey
      in: header
      name: X-Project-ID
    ProjectName:
      type: apiKey
      in: header
      name: X-Project-Name

````