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

# Get Trace Details

> Retrieve the full, granular details of a specific Langfuse trace, including all its underlying observations.

Dive deep into the exact execution steps of a single Voice Agent action.

While the [List Session Traces](/api-reference/traces/list-session-traces) endpoint gives you a high-level overview of a call's latency and cost, this endpoint exposes the raw, underlying data. It acts as an X-ray for your agent, revealing the exact prompts sent to the LLM, the model parameters used, and the precise token breakdown.

<Info>
  **Authentication Required:** You must include your API key in the `x-api-key` header to authenticate this request.
</Info>

### Required Parameters

You need two identifiers to retrieve a specific trace:

1. **`sessionId` (Path):** The UUID of the LiveKit session where the action occurred.
2. **`traceId` (Path):** The ID of the specific trace you want to inspect.

### Demystifying the `observations` Array

The core value of this endpoint lies in the `observations` array. An observation represents a single unit of work (like an LLM generation, a tool call, or a database retrieval).

When debugging agent behavior, look closely at these fields within each observation:

* **`input` & `output`**: The exact string or JSON payload sent to the model, and the exact string returned. This is critical for debugging why an agent said something unexpected.
* **`model` & `modelParameters`**: Confirms which model (e.g., `gpt-4o`) handled the request and the temperature/top\_p settings applied at that exact moment.
* **`usageDetails` & `costDetails`**: A granular breakdown of prompt tokens vs. completion tokens, and the exact fractional USD cost associated with this single step.
* **`latency` & `Timing`**: Compare `startTime`, `completionStartTime` (time to first token), and `endTime` to pinpoint exactly where delays are happening in your pipeline.

### Troubleshooting Errors


## OpenAPI

````yaml get /traces/session/{sessionId}/{traceId}
openapi: 3.0.3
info:
  title: Lyzr Voice LiveKit API
  version: 1.0.0
servers:
  - url: https://voice-livekit.studio.lyzr.ai/v1
security: []
paths:
  /traces/session/{sessionId}/{traceId}:
    get:
      summary: Get Trace Details
      description: >-
        Retrieve the full, granular details of a specific Langfuse trace,
        including all its underlying observations.
      parameters:
        - name: sessionId
          in: path
          required: true
          description: The unique UUID of the LiveKit session.
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - name: traceId
          in: path
          required: true
          description: The specific identifier of the trace to retrieve.
          schema:
            type: string
            example: trace-abc-123
      responses:
        '200':
          description: Trace details retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  trace:
                    type: object
                    properties:
                      traceId:
                        type: string
                      name:
                        type: string
                      sessionId:
                        type: string
                      timestamp:
                        type: string
                        format: date-time
                      latencySeconds:
                        type: number
                        format: float
                      totalCostUsd:
                        type: number
                        format: float
                      htmlPath:
                        type: string
                      observations:
                        type: array
                        description: >-
                          An array of detailed steps, spans, or generation
                          events that occurred during this trace.
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            traceId:
                              type: string
                            parentObservationId:
                              type: string
                            type:
                              type: string
                            name:
                              type: string
                            level:
                              type: string
                            startTime:
                              type: string
                              format: date-time
                            endTime:
                              type: string
                              format: date-time
                            completionStartTime:
                              type: string
                              format: date-time
                            statusMessage:
                              type: string
                            model:
                              type: string
                            modelParameters:
                              type: object
                              additionalProperties: true
                            input:
                              type: string
                            output:
                              type: string
                            metadata:
                              type: object
                              additionalProperties: true
                            usageDetails:
                              type: object
                              additionalProperties:
                                type: number
                            costDetails:
                              type: object
                              additionalProperties:
                                type: number
                            environment:
                              type: string
        '404':
          description: Trace not found for the session or caller scope.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Trace not found.
                  details:
                    type: string
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````