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

# Get trace by ID

> Get a specific trace by ID



## OpenAPI

````yaml /public-apis/openapi/log-repositories.json get /v1/log-repositories/logs/traces
openapi: 3.0.0
info:
  version: 1.0.0
  contact:
    name: Maxim Engineering
    email: eng@getmaxim.ai
  title: Maxim SDK API - log-repositories
  description: API documentation for Maxim SDK log-repositories endpoints
servers:
  - url: https://api.getmaxim.ai
security: []
paths:
  /v1/log-repositories/logs/traces:
    get:
      tags:
        - Log repository
      summary: Get trace by ID
      description: Get a specific trace by ID
      parameters:
        - schema:
            type: string
            description: Unique identifier for the trace
          required: true
          name: id
          in: query
      responses:
        '200':
          description: Trace retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      tags:
                        type: object
                        additionalProperties:
                          type: string
                      startTimestamp:
                        type: string
                      sessionId:
                        type: string
                      type:
                        type: string
                      input:
                        nullable: true
                      output:
                        nullable: true
                      feedback:
                        type: object
                        properties:
                          score:
                            type: number
                          comment:
                            type: string
                        required:
                          - score
                          - comment
                      duration:
                        type: number
                      endTimestamp:
                        type: string
                      version:
                        type: number
                      timeline:
                        type: array
                        items:
                          type: object
                          properties:
                            traceId:
                              type: string
                            name:
                              type: string
                            id:
                              type: string
                            type:
                              type: string
                            startTimestamp:
                              type: string
                            tags:
                              type: object
                              additionalProperties:
                                type: string
                            timeline:
                              type: array
                              items:
                                type: object
                                properties:
                                  spanId:
                                    type: string
                                  modelParameters:
                                    type: object
                                    properties:
                                      presencePenalty:
                                        type: number
                                      maxTokens:
                                        type: number
                                      temperature:
                                        type: number
                                      frequencyPenalty:
                                        type: number
                                      topP:
                                        type: number
                                    required:
                                      - presencePenalty
                                      - maxTokens
                                      - temperature
                                      - frequencyPenalty
                                      - topP
                                  provider:
                                    type: string
                                  name:
                                    type: string
                                  messages:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        role:
                                          type: string
                                        content:
                                          type: string
                                      required:
                                        - role
                                        - content
                                  model:
                                    type: string
                                  id:
                                    type: string
                                  type:
                                    type: string
                                  startTimestamp:
                                    type: string
                                  completionResult:
                                    type: object
                                    properties:
                                      cost:
                                        type: object
                                        properties:
                                          output:
                                            type: number
                                          input:
                                            type: number
                                          total:
                                            type: number
                                        required:
                                          - output
                                          - input
                                          - total
                                      provider:
                                        type: string
                                      created:
                                        nullable: true
                                      usage:
                                        type: object
                                        properties:
                                          completion_tokens:
                                            type: number
                                          prompt_tokens:
                                            type: number
                                          total_tokens:
                                            type: number
                                        required:
                                          - completion_tokens
                                          - prompt_tokens
                                          - total_tokens
                                      model:
                                        type: string
                                      model_params:
                                        nullable: true
                                      id:
                                        type: string
                                      choices:
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            index:
                                              type: number
                                            message:
                                              type: object
                                              properties:
                                                role:
                                                  type: string
                                                content:
                                                  type: string
                                                function_call:
                                                  nullable: true
                                                tool_calls:
                                                  nullable: true
                                              required:
                                                - role
                                                - content
                                                - function_call
                                                - tool_calls
                                            finish_reason:
                                              type: string
                                            logprobs:
                                              nullable: true
                                          required:
                                            - message
                                            - finish_reason
                                            - logprobs
                                      error:
                                        nullable: true
                                    required:
                                      - cost
                                      - provider
                                      - created
                                      - usage
                                      - model
                                      - model_params
                                      - id
                                      - choices
                                      - error
                                  duration:
                                    type: number
                                  endTimestamp:
                                    type: string
                                  timestamp:
                                    type: string
                                  tags:
                                    type: object
                                    additionalProperties:
                                      type: string
                                  input:
                                    type: string
                                  docs:
                                    type: array
                                    items:
                                      type: string
                                required:
                                  - spanId
                                  - name
                                  - id
                                  - type
                          required:
                            - traceId
                            - name
                            - id
                            - type
                            - startTimestamp
                            - tags
                            - timeline
                      evaluationData:
                        type: array
                        items:
                          type: object
                          properties:
                            evaluatorName:
                              type: string
                            score:
                              type: number
                            pass:
                              type: boolean
                            reasoning:
                              type: string
                            variables:
                              type: object
                              additionalProperties:
                                type: string
                            optionalVariables:
                              type: object
                              additionalProperties:
                                type: string
                          required:
                            - evaluatorName
                            - score
                            - pass
                    required:
                      - id
                      - name
                      - tags
                      - startTimestamp
                      - sessionId
                      - type
                      - feedback
                      - duration
                      - endTimestamp
                      - version
                      - timeline
                      - evaluationData
                required:
                  - data
        '400':
          description: Invalid request parameters
        '404':
          description: Trace not found
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-maxim-api-key
      description: API key for authentication

````